Repository navigation
fix(server): Claude wake turns no longer strand new sessions - #170
Merged
Merged
Conversation
A continuation turn that starts a new Claude session has nothing to drain. This case fails on main: Claude receives no prompt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A background wake that landed on a new Claude session sent no prompt, so Claude never saved the conversation. T3 still counted the turn, so the next switch to Claude resumed a missing conversation and failed with "could not find this conversation". The handoff history inlined into the wake was lost too. A wake that would start a new session now runs as a prompted turn. Resume and this check share one predicate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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.
Why
Switching a thread back to Claude could fail with "Claude Code could not find this conversation to resume." When a background wake turn landed on a new Claude session, it sent Claude no prompt, so Claude never saved the conversation. T3 still counted the turn, and the next Claude turn resumed a conversation that did not exist. The thread history handed to that session was lost with it.
Real data showed this three times on one thread. Each failing resume pointed at a session created by a 1 to 5 second wake run with no output. No transcript existed for any of them.
What changed
shouldResumeNativeSessiondecides whether a session exists. Query open uses it to pick resume and turn start uses it for this check, so the two cannot disagree.Blast Radius
Claude adapter only. A wake that starts a new session is now a billed Claude turn. Before this change it was a silent no-op that broke the next turn.
Verification
main(expected [] to have a length of 1 but got +0) and passes with the fix. The test commit lands before the fix.ClaudeAdapterV2.test.ts: 470 passed.vp run check:changed: format, lint, knip, typecheck and tests pass.Opus 5.5 (Claude Code in T3 Code), fix implemented by gpt-6.2-sol (Codex).
🤖 Generated with Claude Code