fix(core): keep command-lister ACP session ephemeral (stop resourceNotFound on restart) - #18
Merged
Conversation
…ound spam on restart) The command-lister session (GET /v1/agent/commands) never carries a conversation turn, so the agent writes no transcript for it. Persisting it in the (cwd, clientSessionId)->acpSessionId store meant that after a dev-server restart the runtime tried to loadSession an unresumable id, and Claude Code logged `[acp-child] session/load -32002 Resource not found` on every reload. The failure was already caught (fell back to newSession, commands still 200), but the stderr noise looked like a broken integration. getOrCreateSession now treats the reserved command-lister key as store-exempt: it skips both the resume attempt and the persist write, minting a fresh session each run. Chat sessions are unaffected and still resume across restarts. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Problem
After a dev-server restart, every page reload logged:
Empirically traced (real Claude conversation + restart): chat sessions resume fine (verified: agent recalled a secret word across a restart). The error comes from the command-lister session (
GET /v1/agent/commands), which only lists slash commands and never carries a conversation turn — so the agent never writes a transcript for it. It was still persisted in the(cwd, clientSessionId)→acpSessionIdstore, so on restart the runtime tried toloadSessionan unresumable id → the agent emitted the-32002to stderr. It was already caught (fell back tonewSession,/commandsstill 200), but the noise looked like a broken integration.Fix
getOrCreateSessionnow treats the reserved command-lister key as store-exempt: it skips both the resume attempt and the persist write, minting a fresh session each run. Chat sessions are unaffected and still resume across restarts.Tests
packages/coretypecheck / lint / build green; vitest 358 passed (added: command-lister session never consults the store nor callsloadSession, mints a fresh session, leaves any stale entry untouched).Changeset:
@agent-devtools/corepatch.🤖 Generated with Claude Code