fix: harden reconnect for ACP chat and terminal sessions#114
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
promptingstates: add prompt timeout, cancel grace fallback force-stop, and stronger replay/control-state convergence.Validation
pnpm lintpnpm typecheckpnpm testAdditional validation executed locally:
go test ./internal/acppnpm --filter @simple-agent-manager/acp-client testpnpm --filter @simple-agent-manager/terminal testpnpm --filter @simple-agent-manager/acp-client typecheckpnpm --filter @simple-agent-manager/terminal typecheckpnpm --filter @simple-agent-manager/web typecheckMobile/desktop note:
UI Compliance Checklist (Required for UI changes)
Exceptions (If any)
Agent Preflight (Required)
Classification
External References
N/A: no external third-party API contract changes were made; work was based on in-repo architecture/spec/docs and existing implementation.
Codebase Impact Analysis
Changed code paths span multiple components:
packages/vm-agent/internal/acp/*(prompt timeout/force-stop, control/replay delivery behavior)packages/vm-agent/internal/config/config.goandpackages/vm-agent/internal/server/server.go(new ACP prompt env wiring)packages/acp-client/src/hooks/useAcpSession.ts(resolver-based reconnect + replay race handling)packages/terminal/src/*(resolver-based reconnect for terminal sockets)apps/web/src/components/ChatSession.tsxandapps/web/src/pages/Workspace.tsx(fresh tokenized URL resolution for chat + terminal reconnect)packages/acp-client/src/hooks/useAcpSession.test.ts,packages/terminal/src/*.test.tsx,packages/vm-agent/internal/acp/session_host_test.go(coverage for changed behavior)Documentation & Specs
Updated documentation/spec artifacts in the same change:
AGENTS.mdCLAUDE.mdtasks/backlog/2026-02-17-acp-session-stuck-after-reconnect.mdConstitution & Risk Check
Validated against
.specify/memory/constitution.md, especially Principle XI (No Hardcoded Values):ACP_PROMPT_TIMEOUT,ACP_PROMPT_CANCEL_GRACE_PERIOD) with defaults.