Conversation
Auto-detect platform via DROID_PLUGIN_ROOT env var in hook-command.ts, extract Droid-specific stdin fields in droid adapter, and add Factory-aware fallback paths in hooks.json so the plugin resolves correctly on Factory-only installs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PR Review: Feat/Factory AI (Droid Integration)Overall: This PR implements a well-reasoned fix for the non-functional Factory CLI (Droid) integration. The three root causes identified in PLAN.md are addressed directly, the implementation is clean, and test coverage was added for the new logic. A few things worth discussing below. What's Well Done
Issues & SuggestionsMedium Priority1. Repeated inline shell logic in The new fallback resolution logic is ~200 characters of shell per hook and appears 6+ times. This is a maintenance hazard — a future fix needs to be applied in multiple places. A shared helper script (e.g., # Current (repeated in every hook):
_R="${CLAUDE_PLUGIN_ROOT}"; [ -z "$_R" ] && _R="${DROID_PLUGIN_ROOT}"; [ -z "$_R" ] && { [ -d "$HOME/.factory/..." ] && _R="..." || _R="..."; };
# Better: delegate to a script
_R=$(bash "$PLUGIN_ROOT/resolve-root.sh")2. The function auto-upgrades 3. export const CLAUDE_PLUGIN_SETTINGS_KEY = 'claude-mem@thedotmack';
export const FACTORY_PLUGIN_SETTINGS_KEY = 'claude-mem@thedotmack'; // same valueThe distinction is purely semantic right now. This is fine if the intent is "same key, different settings file location" — but if that's the case, a comment explaining the design would prevent future confusion. Low Priority4. Droid-specific fields extracted but potentially unused
5. const r = (raw ?? {}) as any;Same pattern as the Claude Code adapter, so consistency is fine — but if there's ever a chance to add a proper 6. Silent Factory sync failure In 7. No integration test for the full Droid flow Unit tests cover 8. PLAN.md committed to repo PLAN.md is a great artifact, but planning docs tend to rot quickly once the code diverges. Consider either:
TestingExisting tests were extended well — Missing coverage:
SummaryThe core implementation is solid and fixes real bugs. The main concern I'd flag before merging is the repeated shell logic in
|
Add CLAUDE_MEM_CHROMA_LAZY_INIT (default 'true') and CLAUDE_MEM_CHROMA_STARTUP_DELAY_MS (default '5000') settings. When lazy init is enabled, skip eager ChromaSync.backfillAllProjects() at startup — Chroma connects lazily on first search instead, preventing the HNSW index rebuild from consuming 250-380% CPU on session start. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Truncate additionalContext to 50KB before returning hookSpecificOutput to prevent Claude Code session files from growing unbounded. Large context causes all subsequent hook invocations to slow down. - Add MAX_CONTEXT_SIZE_BYTES (50,000) constant in context handler - Truncate with helpful message directing users to mem-search - Confirm observation handler doesn't contribute (no hookSpecificOutput) - Fix context-reinjection-guard mock to export getProjectContext - Add 7 new tests for truncation behavior Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…#1346) Handle EADDRINUSE in in-process worker start by falling through to use existing worker via HTTP instead of exiting the process. Downgrade port-in-use log from ERROR to INFO since concurrent startup is expected. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Wrap extractLastMessage() in try-catch so missing/empty transcripts degrade gracefully instead of crashing with exit code 2. The handler now logs a warning and proceeds with an empty last_assistant_message. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…t hook (#1323) Legacy /sessions/* routes bypassed the /api/* initialization guard middleware, allowing requests to hit the database before initializeBackground() completes. Added a matching guard for /sessions/* that waits for the initializationComplete promise with a 30s timeout, returning 503 if DB isn't ready. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add home directory boundary validation to writeAgentsMd() and loadTranscriptWatchConfig() to prevent user-configured context.path from writing to arbitrary filesystem locations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
No description provided.