Commit Graph

1245 Commits

Author SHA1 Message Date
Alex Newman db207807cb MAESTRO: Address PR review feedback — fix connection lifecycle, lazy channel access, buffer safety
- Move sseAbortController/connectionState from module globals into closure for multi-instance safety
- Make start() idempotent by aborting existing connection before creating a new one
- Track connectionPromise and await it on stop() for proper cleanup
- Guard channel API access lazily to prevent crash when integrations are missing
- Add 1MB MAX_SSE_BUFFER_SIZE to prevent unbounded buffer growth
- Log malformed JSON parse errors instead of silently ignoring
- Replace error: any with proper instanceof Error type narrowing
- Remove hardcoded user paths from TESTING.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 20:06:29 -05:00
Alex Newman f1ecf5bc68 MAESTRO: Add manual E2E testing checklist for OpenClaw plugin verification
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 18:52:38 -05:00
Alex Newman 719079581a MAESTRO: Add smoke test script for OpenClaw plugin registration validation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 18:49:47 -05:00
Alex Newman f8d8de53e8 MAESTRO: Implement SSE observation feed consumer with channel routing and exponential backoff
Replaces stub start/stop methods with working SSE consumer that connects to
claude-mem worker's /stream endpoint, parses new_observation events, and
forwards formatted messages to configured OpenClaw channels (Telegram, Discord,
Signal, Slack, WhatsApp, Line). Includes reconnection with exponential backoff
(1s-30s), connection state tracking, and on/off command toggle. Added 17 tests
covering unit and SSE integration scenarios.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 18:44:35 -05:00
Alex Newman baa37eba07 MAESTRO: Add OpenClaw plugin entry point with service and command registration
Creates openclaw/src/index.ts with:
- Inline OpenClawPluginApi interface definition
- registerService for claude-mem-observation-feed (stub start/stop for Phase 2)
- registerCommand for /claude-mem-feed status command
- Plugin initialization logging

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 18:37:49 -05:00
Alex Newman 8933343433 MAESTRO: Add OpenClaw plugin scaffold with configuration files
Create openclaw/ directory with plugin manifest (openclaw.plugin.json),
package.json, tsconfig.json, and .gitignore. Plugin manifest includes
full configSchema with observationFeed settings for live streaming
observations to messaging channels.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 18:36:20 -05:00
Alex Newman dac989c697 docs: update CHANGELOG.md for v9.1.1
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 02:19:20 -05:00
Alex Newman 5969d670d0 chore: bump version to 9.1.1
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
v9.1.1
2026-02-07 02:18:44 -05:00
Alex Newman 39990f2818 docs: update CHANGELOG.md for v9.1.0
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 01:07:00 -05:00
Alex Newman 8dfcb5e612 chore: bump version to 9.1.0
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
v9.1.0
2026-02-07 01:05:38 -05:00
Alex Newman 4d91053f8c MAESTRO: Mark PR #657 merge complete in PR-Triage-12.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 05:53:33 -05:00
Alex Newman ff503d08a7 MAESTRO: Merge PR #657 - Add generate/clean CLI commands for CLAUDE.md management
Cherry-picked source changes from PR #657 (224 commits behind main).
Adds `claude-mem generate` and `claude-mem clean` CLI commands:
- New src/cli/claude-md-commands.ts with generateClaudeMd() and cleanClaudeMd()
- Worker service generate/clean case handlers with --dry-run support
- CLAUDE_MD logger component type
- Uses shared isDirectChild from path-utils.ts (DRY improvement over PR original)

Skipped from PR: 91 CLAUDE.md file deletions (stale), build artifacts,
.claude/plans/ dev artifact, smart-install.js shell alias auto-injection
(aggressive profile modification without consent).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 05:52:54 -05:00
Alex Newman 0ee8c00c5f MAESTRO: Merge PR #863 - Ragtime email investigation batch processor
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 05:42:15 -05:00
Alex Newman d4e122a1f8 Merge pull request #863 from thedotmack/claude/setup-ragtime-epstein-analysis-JApkL
feat: implement ragtime email investigation with self-iteration and cleanup
2026-02-06 05:41:54 -05:00
Alex Newman 5508194189 MAESTRO: Close PR #854 - Pro cloud sync premature, hold for when backend is live
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 05:40:43 -05:00
Alex Newman ded11645e3 MAESTRO: Mark PR #968 evaluation complete - already closed by author
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 05:25:49 -05:00
Alex Newman 7afbba4c3f MAESTRO: Close PR #660 - Network mode bundles documentation deletions and unrelated features
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 05:24:54 -05:00
Alex Newman bf439043cf MAESTRO: Merge PRs #920 and #699 - Add project exclusion and folder CLAUDE.md exclusion settings
Cherry-picked both PRs to main (both had merge conflicts with current main).

PR #920 (@Spunky84): CLAUDE_MEM_EXCLUDED_PROJECTS setting with glob patterns
to exclude entire projects from memory tracking (privacy/confidentiality).
Early-exit in session-init and observation handlers. 11 unit tests.

PR #699 (@leepokai): CLAUDE_MEM_FOLDER_MD_EXCLUDE setting with JSON array
of paths to exclude from CLAUDE.md file generation (fixes SwiftUI/Xcode
build conflicts and drizzle kit migration failures). Closes #620.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 05:23:01 -05:00
Alex Newman 24ce746b91 MAESTRO: Mark PR #662 evaluation complete in triage document 2026-02-06 04:14:14 -05:00
Alex Newman 98920bd860 MAESTRO: Merge PR #662 - Add save_memory MCP tool for manual memory storage
Adds save_memory MCP tool allowing users to manually save observations
for semantic search. Source changes cherry-picked from PR #662 by
@darconada (build artifact conflicts resolved by direct application).

Closes #645.

Co-Authored-By: darconadalabarga <darconada@arsys.es>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 04:13:44 -05:00
Alex Newman fbcbdfca62 MAESTRO: Close PR #860 - Clawdbot detection is dead code with no user demand
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 03:45:45 -05:00
Alex Newman 6ae8890092 MAESTRO: Close PR #746 - OpenCode platform adapter needs clean resubmission
Core adapter code is sound but PR includes build artifacts, planning docs,
and settings changes. Requested focused re-submission with source-only changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 03:44:46 -05:00
Alex Newman c113e23001 MAESTRO: Close PR #680 - multi-model OpenRouter fallback bundles too many features and deletes docs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 03:43:16 -05:00
Alex Newman b58a61c0b3 MAESTRO: Close PR #644 - OpenAI provider duplicates OpenRouter coverage
OpenAI models are already accessible via OpenRouter. The proposed 491-line
OpenAIAgent duplicates the existing OpenAI-compatible API in OpenRouterAgent.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 03:41:43 -05:00
Alex Newman 936080d710 MAESTRO: Close PR #786 - GLM provider has process.env concurrency bug and YAGNI preset
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 03:28:29 -05:00
Alex Newman 10675f7125 MAESTRO: Close PR #808 - direct Anthropic API provider duplicates SDK path
Memory concerns addressed by PR #806. Two Anthropic providers would create
confusion and maintenance overhead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 03:25:13 -05:00
Alex Newman 39e4aa1976 MAESTRO: Mark PR #844 complete in PR-Triage-11 - session-complete hook cherry-picked
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 03:24:00 -05:00
Alex Newman 5dffb1ebb0 MAESTRO: fix(hooks): add session-complete handler to enable orphan reaper cleanup
Cherry-picked from PR #844 by @thusdigital. Sessions stayed in active
sessions map forever after summarize, causing the orphan reaper to think
all processes were still active. Adds session-complete as Stop phase 2
hook that calls POST /api/sessions/complete to remove sessions from the
active map, allowing the reaper to correctly identify and clean up
orphaned worker processes. Fixes #842.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 03:23:13 -05:00
Alex Newman 56df2c45e5 MAESTRO: Close PR #833 as stale - PRAGMA foreign_keys unnecessary for cleanup script
observations table has no children; FK constraints addressed in v8.5.6 (PR #889)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 03:19:06 -05:00
Alex Newman 4c719d776a MAESTRO: Mark PR #889 complete in PR-Triage-11 - FK constraint fix cherry-picked
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 03:16:50 -05:00
Alex Newman da1d2cd36a MAESTRO: fix(db): prevent FK constraint failures on worker restart
Cherry-picked source changes from PR #889 by @Et9797. Fixes #846.

Key changes:
- Add ensureMemorySessionIdRegistered() guard in SessionStore.ts
- Add ON UPDATE CASCADE migration (schema v21) for observations and session_summaries FK constraints
- Change message queue from claim-and-delete to claim-confirm pattern (PendingMessageStore.ts)
- Add spawn deduplication and unrecoverable error detection in SessionRoutes.ts and worker-service.ts
- Add forceInit flag to SDKAgent for stale session recovery

Build artifacts skipped (pre-existing dompurify dep issue). Path fixes (HealthMonitor.ts, worker-utils.ts)
already merged via PR #634.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 03:16:17 -05:00
Alex Newman 7ed1e576b2 MAESTRO: Mark PR #721 complete in PR-Triage-11 - Cursor bun runtime fix cherry-picked
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 03:10:01 -05:00
Alex Newman 8030c44af4 MAESTRO: fix(cursor): use bun runtime and fix hooks directory detection
Cherry-picked source changes from PR #721. Fixes two Cursor standalone
setup bugs:

1. findCursorHooksDir() now checks for hooks.json (unified CLI mode)
   in addition to legacy common.sh/common.ps1 scripts
2. installCursorHooks() now uses bun instead of node for hook commands
   since worker-service.cjs depends on bun:sqlite
3. Added findBunPath() to detect bun executable across platforms

Build artifacts skipped (pre-existing dompurify viewer dep issue).
Source-only cherry-pick, TypeScript compilation clean for modified file.

Co-Authored-By: polux0 <aleksaprosperitylabs@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 03:09:26 -05:00
Alex Newman 2f935a56b9 MAESTRO: Mark PR #771 complete in PR-Triage-11 - stdin hang fix merged
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 03:06:38 -05:00
Claude 830d7a2b23 fix: detect complete JSON instead of waiting for EOF
Root cause: Claude Code doesn't close stdin after writing hook input,
so stdin.on('end') never fires.

Previous approach: Timeout-based workaround (wait 5s then parse).

New approach: JSON is self-delimiting. We attempt to parse after each
data chunk. Once we have valid JSON, we resolve immediately without
waiting for EOF. This is the proper fix - hooks now exit in <500ms
instead of waiting for any timeout.

Changes:
- Add tryParseJson() to detect complete JSON
- Parse after each stdin chunk, resolve immediately on success
- Add 50ms parse delay for multi-chunk delivery edge case
- Safety timeout (30s) only for truly malformed input
- Removes dependency on stdin.on('end') which never fires

Testing:
- Normal operation: 448ms (was 5000ms+ with timeout approach)
- Stdin stays open: Process exits immediately after JSON complete

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 03:06:03 -05:00
Claude 5cbe0a38ca fix: address code review feedback
- Change from absolute timeout to inactivity timeout (reset on each data chunk)
  to avoid truncating large/slow payloads
- Fix race condition: add resolved=true before resolving in catch block
- Fix unreliable readable check: just access the property, don't check value
- Add cleanup() call in catch block for consistency

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 03:06:03 -05:00
Claude c477ded1b5 fix: handle stdin unavailability and timeout to prevent hook hangs
Fixes #727 (PostToolUse hooks hanging at "1/2 done")
Addresses #646 (Bun stdin EINVAL crash)

Root causes:
1. Bun crashes with EINVAL when Claude Code doesn't provide valid stdin fd
2. stdin.on('end') never fires if Claude Code doesn't close stdin properly

Changes:
- Add isStdinAvailable() to safely check stdin before reading
- Wrap stdin access in try-catch to handle Bun's lazy fstat crash
- Add 5-second timeout to prevent indefinite hangs
- Gracefully return undefined instead of crashing on stdin errors
- Properly clean up event listeners to prevent memory leaks

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 03:06:03 -05:00
Alex Newman 3040ea8a97 MAESTRO: Mark PR #524 complete in PR-Triage-11 - minimum bun version check merged
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 03:04:59 -05:00
quicktime 9ad640a5c4 fix: add minimum bun version check to smart-install.js
Bun 1.1.14+ is required because:
- `.changes` property on SQLite statements (added in 1.1.14)
- Multi-statement SQL support in db.run() (fixed in 1.0.26)

Older versions cause silent failures in database migrations.

Fixes #519

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 03:04:32 -05:00
Alex Newman 109fb1b506 MAESTRO: Cherry-pick PR #712 - respect environment variables with correct priority
Adds applyEnvOverrides() method to SettingsDefaultsManager ensuring
env vars take highest priority over file and default settings.
Configuration priority is now: env > file > defaults.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 03:03:28 -05:00
Alex Newman 55e13047e4 MAESTRO: Mark PR #634 complete in PR-Triage-11 - CLAUDE_CONFIG_DIR path fix cherry-picked
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 03:00:43 -05:00
Alex Newman 75a0f2e981 fix: respect CLAUDE_CONFIG_DIR for plugin paths (#626)
Add MARKETPLACE_ROOT constant to paths.ts and update 5 source files to use
centralized path constants instead of hardcoded ~/.claude paths. Preserves
backwards compatibility when CLAUDE_CONFIG_DIR is not set.

Based on PR #634 by @Kuroakira, cherry-picked onto main due to build artifact
merge conflicts (source changes applied cleanly).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 03:00:08 -05:00
Alex Newman d935229711 MAESTRO: Mark PR #831 complete in PR-Triage-11 - Gemini model name fix merged
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 02:56:20 -05:00
Alex Newman 91e1d5baad fix: correct Gemini model name from gemini-3-flash to gemini-3-flash-preview
The Gemini API requires the -preview suffix for the Gemini 3 Flash model.
gemini-3-flash does not exist - only gemini-3-flash-preview is available.
This was causing 404 errors when users selected this model option.

Closes #831

Co-Authored-By: Glucksberg <markuscontasul@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 02:55:30 -05:00
Alex Newman 8de8afbab8 MAESTRO: Mark PR #862 complete in PR-Triage-11 - transcript parser graceful empty handling merged
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 02:52:24 -05:00
Dennis Hartrampf 75df2e52c1 fix: handle missing assistant messages gracefully in transcript parser
When a user exits Claude Code before any assistant response is generated,
the summarize Stop hook would crash with:
"No message found for role 'assistant' in transcript"

This happened because extractLastMessage() threw an error when no message
of the requested role was found. The fix returns an empty string instead,
which the summarize handler already handles gracefully (it logs
hasLastAssistantMessage: false and continues).

This is consistent with the function's existing behavior - it already
returns '' in other edge cases (line 64).

Fixes sessions that exit early before assistant responds.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 02:52:02 -05:00
Alex Newman 40e699209f MAESTRO: Mark PR #835 complete in PR-Triage-11 - nested XML parser fix merged
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 02:51:18 -05:00
Glucksberg 256ebcead0 fix: handle nested XML tags in parser extractField and extractArrayElements
The parser's regex patterns used `[^<]*` and `[^<]+` which fail immediately
when content contains any `<` character (like nested tags or code snippets).

Example failure case:
```xml
<investigated>
  <item>Checked parser.ts</item>
</investigated>
```

The `[^<]*` pattern stops at the first `<` of `<item>`, causing extractField()
to return null even though valid content exists.

## Changes

- `extractField()`: Changed from `[^<]*` to `[\s\S]*?` (non-greedy match any char)
- `extractArrayElements()`: Changed from `[^<]+` to `[\s\S]*?` for both array and element patterns

The `[\s\S]*?` pattern matches any character including newlines, non-greedily,
allowing nested XML tags to be captured correctly.

Fixes #798

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 02:50:36 -05:00
Alex Newman 44bfb74932 MAESTRO: Mark PR #970 complete in PR-Triage-10 - issue template duplicate check merged
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 02:48:13 -05:00
brianmccann 97c84a3963 fix: update bug and feature request templates to include duplicate check reminder 2026-02-06 02:47:43 -05:00