fix(acp): allow uninstall while disabled - #2188
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
Included review availability: Your plan includes up to 8 reviews per rolling hour; 4 remain after this review. 📝 WalkthroughWalkthroughSession transfer now supports active sessions and unavailable ACP sessions. It uses lightweight ACP snapshots, reports pending-input inspection failures, cancels active generation, deletes queued inputs, and then migrates session ownership. ChangesSession transfer behavior
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The change allows disabled ACP agents to be uninstalled while stopping active sessions and discarding queued input; targeted tests and CI checks pass, and no actionable merge-blocking risk remains after normal checks. Sequence Diagram(s)sequenceDiagram
participant SessionAssignment
participant SessionSnapshot
participant GenerationController
participant PendingInputStore
participant AgentContext
SessionAssignment->>SessionSnapshot: inspect transfer state
SessionAssignment->>GenerationController: cancel active generation
SessionAssignment->>GenerationController: wait for generation to stop
SessionAssignment->>PendingInputStore: delete queued inputs
SessionAssignment->>AgentContext: migrate session ownership
AgentContext-->>SessionAssignment: return updated assignment
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Code Review🔴 Blocking:
|
Re-review: blocking issue resolved ✅The polling loop in Verification
Remaining (non-blocking, previously noted)The orphaned steer-input edge case is still unaddressed — after cancel+transfer, a pending Minor nit
LGTM — the blocking issue is properly fixed and tested. |
Summary
Root cause
Disabling a registry ACP Agent removes it from the executable ACP configuration list. The uninstall flow queried related sessions with a full runtime snapshot, which tried to resolve that disabled Agent and failed with
AgentUnavailableError: invalid-config.The transfer flow also treated running sessions and queued input as hard blockers. Agent removal should instead discard queue-only input and stop active work before ownership changes. Cancellation is asynchronous, so transfer now waits until the runtime leaves
generating(with a bounded timeout) before changing the Agent context. Session deletion already performs runtime cleanup before removing durable data.Behavior
Validation
pnpm run format:checkpnpm run i18npnpm run lintpnpm run typecheck:nodepnpm exec vitest run test/main/session/assignment.test.ts test/main/session/session.integration.test.ts(156 passed)pnpm run test:main(8149 passed, 457 skipped)Local
pnpm run typecheckis blocked by the unchangedMarkdownRenderer.vuereadonly theme tuple error; the clean CIstaticjob, including typecheck, passed on the current revision.Closes #2186
Summary by CodeRabbit
Bug Fixes
Tests