feat(cli): enable /remember, /forget, /dream in ACP mode#4811
Conversation
These three memory-related slash commands return `submit_prompt` or `message` action types which are fully supported by the ACP session handler. Adding `acp` to their `supportedModes` allows web-shell clients to invoke them via `POST /session/:id/prompt` passthrough. Changes: - /remember: add supportedModes (zero handler changes needed) - /forget: add supportedModes + wrap memory manager calls in try-catch so filesystem/model errors surface as user-friendly messages instead of raw JSON-RPC errors - /dream: add supportedModes + document that onComplete callback (dream metadata tracking) is not invoked in ACP mode Known limitation: /dream's onComplete (writeDreamManualRun) is silently skipped in ACP — the auto-dream scheduler may not know a manual dream already ran. Accepted because eagerly calling it would record completion before consolidation actually finishes. Refs #4514
📋 Review SummaryThis PR enables 🔍 General Feedback
🎯 Specific Feedback🟢 Medium
🔵 Low
✅ Highlights
|
There was a problem hiding this comment.
Pull request overview
Enables the /remember, /forget, and /dream built-in slash commands to be available in ACP (web-shell/editor integration) by explicitly declaring ACP support, and adds targeted test coverage and a more user-facing error surface for /forget.
Changes:
- Add
supportedModes: ['interactive', 'acp']to/remember,/forget, and/dreamso they are no longer filtered out in ACP mode. - Wrap
/forget’s memory-manager operations in atry/catchto return a friendlier command-level error message. - Add/extend Vitest coverage for the three commands, including
supportedModesassertions.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/cli/src/ui/commands/rememberCommand.ts | Declares ACP support for /remember. |
| packages/cli/src/ui/commands/rememberCommand.test.ts | Adds tests for /remember behavior and ACP support declaration. |
| packages/cli/src/ui/commands/forgetCommand.ts | Declares ACP support and adds try/catch error wrapping for /forget. |
| packages/cli/src/ui/commands/forgetCommand.test.ts | Adds tests for /forget, including error wrapping and ACP support declaration. |
| packages/cli/src/ui/commands/dreamCommand.ts | Declares ACP support for /dream and documents that onComplete is not invoked in ACP. |
| packages/cli/src/ui/commands/dreamCommand.test.ts | Extends tests for /dream, including ACP support and config-not-loaded error. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thanks for the PR, @doudouOUC! Template: the PR uses custom headings ("Summary", "Context", "Test plan", "Known Limitations") instead of the PR template headings. The most impactful gap is the missing Reviewer Test Plan — there's no "How to verify" section with reproduction steps, no Before/After evidence, and no "Tested on" OS table. The developer-facing test plan (listing test files) is useful but different from what reviewers need. Please align with the template when you get a chance. Not blocking — proceeding with review. Direction: clearly aligned. Enabling Approach: the scope is tight and correct. Adding 中文说明感谢贡献,@doudouOUC! 模板: PR 使用了自定义标题("Summary"、"Context"、"Test plan"、"Known Limitations"),而非 PR 模板 要求的标题。最关键的缺失是 Reviewer Test Plan——没有"How to verify"复现步骤、没有 Before/After 证据截图、没有"Tested on"操作系统表格。开发者视角的测试计划(列出测试文件)有用但和审查者需要的不同。请找时间对齐模板。不阻塞——继续审查。 方向: 明确对齐。在 ACP(web-shell)模式下启用 方案: 范围精简且正确。为每个命令添加 — Qwen Code · qwen3.7-max |
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
…ertions - Call writeDreamManualRun eagerly before returning submit_prompt so auto-dream dedup works correctly in ACP mode (timestamp is slightly early but acceptable for scheduler min_hours check) - Switch supportedModes test assertions from toContain to toEqual per codebase convention (catches accidental mode additions) Refs #4514
Review response — 6df1781
|
- dreamCommand: add try-catch for error resilience in ACP; make eager writeDreamManualRun conditional on executionMode === 'acp' to avoid double-write in interactive mode and cancel-semantics regression - rememberCommand: add explicit if (!config) guard (consistency with dream/forget; avoids silent fallthrough in ACP) - Add config:null test for rememberCommand - Split dream test into interactive (no eager write) vs ACP (eager write) Refs #4514
Review response round 2 — 1b86a37
|
PR #4811 Local Verification ReportBranch: Changes Summary
Test Results
Verdict✅ Ready to merge. All 15 unit tests pass with clean coverage of supportedModes, error handling, null-config guards, and the interactive vs ACP writeDreamManualRun split. Lint clean, zero typecheck errors in changed files. Well-scoped change — only adds Verified by wenshao |
Summary
/remember,/forget,/dreamslash commands in ACP mode (web-shell) by addingsupportedModes: ['interactive', 'acp']/forgethandler so filesystem/model errors return user-friendly messages instead of raw JSON-RPC errors/dream'sonCompletecallback (dream metadata tracking) is not invoked in ACP modeContext
These three commands were blocked in web-shell because
filterCommandsForMode('acp')excluded them — they lacked explicitsupportedModesdeclaration, defaulting to['interactive']only. Their handlers returnsubmit_promptormessagetypes which are fully supported by the ACP session's#processSlashCommandResult.No dedicated HTTP routes needed — they work via the existing
POST /session/:id/promptpassthrough once the mode filter allows them through.Known Limitations
/dream'sonComplete(callswriteDreamManualRun) is silently skipped in ACP mode. The auto-dream scheduler may not know a manual dream already ran. Accepted because eagerly calling it would record completion before consolidation actually finishes./forget'sselectForgetCandidatesusesrunSideQuerywith its own 8s timeout, independent of session abort signal. Pre-existing architectural limitation.Test plan
rememberCommand.test.ts— 4 tests (error on empty args, submit_prompt for managed/non-managed memory, supportedModes assertion)forgetCommand.test.ts— 6 tests (error on empty args/no config, success, no-match fallback, error propagation from memory manager, supportedModes assertion)dreamCommand.test.ts— 3 tests (supportedModes assertion, error on no config, consolidation prompt)commandUtils.test.ts— 14 existing tests pass (mode filtering logic)Refs #4514
🤖 Generated with Qwen Code