droid integration - #744
Conversation
Implement engram setup droid for Factory Droid integration. - Registers mcpServers.engram in ~/.factory/mcp.json with absolute binary path. - Extracts UserPromptSubmit hook scripts to ~/.factory/hooks/engram/. - Writes UserPromptSubmit entry to ~/.factory/hooks.json as a workaround for Droid not executing plugin UserPromptSubmit hooks. - Installs the Engram plugin via droid plugin marketplace/install. - Updates README and docs/AGENT-SETUP.md with Droid instructions.
Update the Droid installer to write ~/.factory/hooks.json in the standalone format Droid expects, and use the correct engram___* ToolSearch select pattern instead of the Claude Code mcp__engram__* pattern. This ensures the UserPromptSubmit hook output is understood by Droid's ToolSearch when the hook fires in interactive sessions.
Add DROID-SETUP-NOTES.md documenting the engram setup droid command, validation findings, known limitations, and current user configuration.
Read tools (mem_search, mem_context, mem_stats, mem_doctor, mem_timeline, mem_review) previously returned plain text "Project resolution failed: ..." when project resolution hit an ambiguous cwd or unknown explicit project. This broke REQ-314 and gave agents no available_projects to recover with. Add a readProjectErrorResult helper that delegates to writeProjectErrorResult and emits a structured JSON envelope with error_code, available_projects, and a read-specific hint. No recovery_token is issued for reads because they only need an explicit project override, not a project_choice_reason. mem_get_observation is left unchanged; its degraded plain-text path is intentional. Also adds TestReadTools_AmbiguousEnvelope covering the five non-exempt read tools and the no-recovery-token assertion.
Add a Droid-first-message recovery line for ambiguous_project errors in the user-prompt-submit hook, and sync an AMBIGUOUS PROJECT section across all shared protocol-text sources (setup.go memoryProtocolMarkdown, claude-code/codex session-start and post-compaction hooks, opencode/pi TypeScript plugins, and the claude-code/codex engram-memory skills). Also update CHANGELOG.md.
The injected protocol told agents when to call mem_save but not that
content is required, so proactive saves emitted {title,type} only and
tripped the runtime content-required guard (upstream Gentleman-Programming#363). Add a
content-format reminder to the Droid UserPromptSubmit injection and the
Claude Code ACTIVE PROTOCOL heredoc.
Refs Gentleman-Programming#363
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
When Droid starts in a parent directory containing multiple git repos, the Engram read tools fail with ambiguous_project. The UserPromptSubmit hook now scans child repos on the first message and, if more than one is found, injects the candidate list and a rule that tells the agent to always pass project=<matching repo> on read tools. This keeps single-repo behavior unchanged and avoids the extra ambiguous_project round-trip. - Add list_child_projects() helper mirroring Go scanChildren. - Update print_toolsearch_message() to emit the proactive rule. - Document behavior in DROID-SETUP-NOTES.md. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
|
Sorry, I did not mean to open this PR; I am working on a droid plugin. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (22)
📝 WalkthroughWalkthroughChangesDroid integration and project resolution
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant EngramSetup
participant DroidCLI
participant DroidConfig
participant PromptHook
participant MCPServer
User->>EngramSetup: run engram setup droid
EngramSetup->>DroidCLI: validate and install plugin
EngramSetup->>DroidConfig: write MCP and user hook configuration
DroidCLI->>PromptHook: invoke UserPromptSubmit
PromptHook->>MCPServer: persist prompt or inspect project activity
MCPServer-->>PromptHook: project and observation data
PromptHook-->>DroidCLI: ToolSearch or save reminder JSON
Suggested reviewers: ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Warning |
🔗 Linked Issue
Closes #
🏷️ PR Type
type:bug— Bug fixtype:feature— New featuretype:docs— Documentation onlytype:refactor— Code refactoring (no behavior change)type:chore— Maintenance, dependencies, toolingtype:breaking-change— Breaking change📝 Summary
📂 Changes
path/to/file🧪 Test Plan
go test ./...go test -tags e2e ./internal/server/...🤖 Automated Checks
These run automatically and all must pass before merge:
Closes #N/Fixes #N/Resolves #Nstatus:approvedlabeltype:*labelgo test ./...passesgo test -tags e2e ./internal/server/...passes✅ Contributor Checklist
Closes #N)type:*label to this PRgo test ./...go test -tags e2e ./internal/server/...Co-Authored-Bytrailers in commits💬 Notes for Reviewers
Summary by CodeRabbit
New Features
engram setup droidintegration for MCP configuration, hooks, and plugin installation.Bug Fixes
Documentation