Repository navigation
fix(cli): support custom ACP history synchronization - #752
UniversePeak wants to merge 3 commits into
Conversation
Model: gpt-5.6-luna
Model: gpt-5.6-luna
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 87f89b469c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| return ( | ||
| isObjectRecord(value) && | ||
| (value.cliType === 'builtin' || value.cliType === 'registry') && | ||
| (value.cliType === 'builtin' || value.cliType === 'registry' || value.cliType === 'custom') && |
There was a problem hiding this comment.
Update the CommonJS control guard for custom providers
When @lody/shared/node/local-project-control is loaded via require—the package's declared CommonJS export—the request is validated by local-project-control.cjs, whose provider guard still accepts only builtin and registry. Consequently, every custom sync, import, or conflict-resolution request is rejected before reaching the new resolver for CommonJS consumers; mirror this change in the CJS implementation and exercise that export in the test.
AGENTS.md reference: AGENTS.md:L123-L129
Useful? React with 👍 / 👎.
Mirror custom ACP provider support in the CommonJS local-project history guard and cover the actual CJS export with a regression test. Model: glm-5.3-flash
Related issue
Closes #187
Problem / pressure
The local-project history UI lists every agent configuration, including custom ACP agents, but the history sync launch path only received
cliTypeandagentType. Builtin and registry agents can resolve their executables from static definitions; a custom agent's executable is stored in its machine-scopedcustomAcpconfiguration. As a result, every custom history sync failed before spawning the ACP process withCustom ACP <agentType> has no launch command configured.Summary
customAcplaunch spec through the shared history catalog client so session listing and replay use the same command and arguments as normal custom ACP sessions.Visual explanation
flowchart LR UI["Local-project history UI"] -->|"syncHistory / importHistory / resolveHistoryConflict"| Guard["Local-project control guard"] Guard -->|"custom ACP provider accepted"| Client["history-session-catalog-client"] Client -->|"list / import / replay request"| Daemon["Owning daemon"] Daemon -->|"resolve machine-scoped customAcp config for cliType:agentType"| Spec["Launch spec: command + argv (+ env)"] Spec -->|"spawn history ACP process"| ACP["Custom ACP server"] Daemon -->|"missing config or command: unchanged clear failure"| Err["Error: no launch command configured"]Custom ACP providers now pass the same control boundary as builtin and registry providers, and the daemon supplies the launch command from its authoritative machine-scoped configuration on every history entry point.
Before / after
customAcpcommand before spawning history ACP processes.Test plan
corepack pnpm --filter acp-extension-core build— passed, required local ACP package entry was built.corepack pnpm --filter acp-extension-claude build— passed, required local workspace entry was built.corepack pnpm --filter lody typecheck— passed.corepack pnpm --filter @lody/shared typecheck— passed.corepack pnpm --filter lody exec vitest run tests/history-session-catalog-client.test.ts -t 'custom ACP'— passed, 1 test.corepack pnpm --filter @lody/shared exec vitest run tests/local-project-control.test.ts— passed, 29 tests.corepack pnpm --filter lody exec vitest run tests/local-project-history-sync-service.test.ts— passed, 30 tests.git diff --check— passed.@lody/sharedsuite — 1,012 passed, 3 unrelated baseline failures (one local CLI host-lease assertion and two source-guard tests timed out); no changed history-control test failed.Context handoff
Instructions for reviewing agents
LocalProjectHistorySyncService.resolveLaunchProvider, the three history operation paths, andhistory-session-catalog-client.tsto ensure only daemon-authoritative machine config supplies the custom command.cliType:agentTypeis the right identity boundary and that keepingcustomAcpout of the control-plane wire schema avoids trusting caller-supplied executable paths.Authoring context
Original user prompt
Show original prompt
Shared conversation
Status: unavailable
Reason: The authoring conversation was conducted in a local Hermes assistant environment that does not provide a public conversation-sharing link.