Commit Graph

1514 Commits

Author SHA1 Message Date
Alex Newman 1b9f601c41 MAESTRO: Fix OpenClaw SDK API mismatch — use real PluginApi interface
E2E testing against the official OpenClaw Docker image revealed the plugin
was built against a custom interface that didn't match the real SDK:
- api.log() → api.logger.info/warn/error() (PluginLogger interface)
- api.getConfig() → api.pluginConfig (direct property)
- command handler (args[], ctx) → (ctx) with ctx.args string
- service stop optional, service context typed

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 21:28:08 -05:00
Alex Newman b2ddf59db4 MAESTRO: Add comprehensive PR triage report for 27 open PRs in claude-mem repository
Categorized all 27 open PRs into 9 groups (Owner, Security, Critical Bug Fixes,
Windows, Features, Infrastructure, Documentation, Other) with MERGE/REVIEW/CLOSE/DEFER
recommendations. 19 REVIEW, 5 CLOSE, 5 DEFER. Identified key coordination clusters
for security fixes, subprocess management, and session ID handling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 21:04:32 -05:00
Alex Newman a0d737ba51 MAESTRO: Add Critical & High-Priority Issues triage report
Categorized 17 open issues into Tier 1 (Critical Security & Stability)
and Tier 2 (High-Priority Bug Fixes) with KEEP/DISCARD/DEFER
recommendations for each. Cross-referenced 6 issues to active PRs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 20:55:14 -05:00
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 1d090b33f5 MAESTRO: Mark session/search issue triage task complete in ISSUE-TRIAGE-09.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 19:38:40 -05:00
Alex Newman 700aae8a31 MAESTRO: Triage 8 worker/database issues in Phase 09 (#1011, #998, #979, #966, #916, #911, #855, #740)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 19:35:37 -05:00
Alex Newman fbdff0b178 MAESTRO: Mark Issue Triage Phase 06 Task 2 complete - Windows bug triage
Triaged 8 remaining Windows-specific bugs: labeled 5 issues (priority
high/medium/low), closed 2 as duplicate/vague, closed 1 fix proposal
with PR guidance.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 19:27:41 -05:00
Alex Newman 018549c3c7 MAESTRO: Verify all 37 duplicate issue closures in Phase 04 triage
Confirmed all duplicate issues across 6 clusters (CLAUDE.md pollution,
FOLDER_CLAUDEMD_ENABLED, orphaned processes, Windows popups, Zod schema,
SessionStart exit code) are successfully closed on GitHub.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 19:20:53 -05:00
Alex Newman 63e8755be5 MAESTRO: Close issue #976 as duplicate of #975 (Zod cyclical schema cluster)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 19:19:08 -05:00
Alex Newman c8aaa79ab6 MAESTRO: Close 5 remaining stale/fixed issues in Phase 03 triage (#591, #626, #582, #815, #948)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 19:12:52 -05:00
Alex Newman 194e44f52a MAESTRO: Close support/help and wrong-product issues (#633, #759, #880, #678)
Phase 02 issue triage - closed 4 non-bug issues with helpful responses:
- #633: Cursor install support question
- #759: Wrong product (VS Code != Claude Code)
- #880: Self-resolved installation issue
- #678: Resolution note, not a bug report

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 19:09:38 -05:00
Alex Newman efd47a9586 MAESTRO: Close 5 junk/spam/troll issues (#971, #925, #893, #878, #881) in Phase 01 triage
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 19:07:48 -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
xingyu e4e1d3fb92 fix: Windows platform improvements — re-enable Chroma, fix DB race, simplify env isolation
1. ProcessManager: Migrate spawnDaemon() from WMIC to PowerShell Start-Process
   - WMIC deprecated in Windows 11, PowerShell inherits env vars properly
   - Use -WindowStyle Hidden to prevent console popups
   - Fix redundant backslash escaping in PowerShell $_ variables

2. ChromaSync: Re-enable vector search on Windows
   - Remove overly defensive platform check that disabled all semantic search
   - Worker daemon starts with -WindowStyle Hidden; child processes inherit
   - MCP SDK's StdioClientTransport uses shell:false, no new console created

3. worker-service: Unified DB-ready gate middleware
   - Replace single-endpoint /api/sessions/init wait with global middleware
   - Hold all DB-dependent requests until database is initialized (30s timeout)
   - Whitelist static assets, /health, and viewer page for immediate response
   - Separate dbReadyPromise (DB only) from initializationComplete (full init)
   - Fixes "Database not initialized" errors on /stream, /summarize, /init

4. EnvManager: Switch from allowlist to blocklist for subprocess env
   - Only strip ANTHROPIC_API_KEY to prevent Issue #733 billing hijack
   - Pass through all other vars (ANTHROPIC_AUTH_TOKEN, ANTHROPIC_BASE_URL, etc.)
   - Simpler, less fragile than maintaining an exhaustive system vars allowlist
2026-02-07 18:30:57 +08: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