fix(server): keep queued turns active during handoff - #65
Merged
Conversation
incognitojam
added a commit
that referenced
this pull request
Aug 10, 2026
## Problem When a user sent a follow-up while the current provider turn was completing, the server could briefly project the thread as ready and completed before the replacement turn started. Clients then showed finished work and played the completion sound before returning to thinking. ## Fix Treat a pending turn start as the lifecycle authority during the handoff. Provider ready and successful completion events now keep the session in starting until the replacement turn begins. A focused ingestion regression test covers both lifecycle signals and verifies that the previous turn remains unsettled. ## Testing - `vp test run apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.test.ts` - `vp test run apps/web/src/lib/completionSound.logic.test.ts packages/client-runtime/src/state/threadReducer.test.ts` - `vp run --filter t3 typecheck` Implemented with gpt-5.6-sol via the Codex harness in T3 Code.
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
When a user sent a follow-up while the current provider turn was completing, the server could briefly project the thread as ready and completed before the replacement turn started. Clients then showed finished work and played the completion sound before returning to thinking.
Fix
Treat a pending turn start as the lifecycle authority during the handoff. Provider ready and successful completion events now keep the session in starting until the replacement turn begins. A focused ingestion regression test covers both lifecycle signals and verifies that the previous turn remains unsettled.
Testing
vp test run apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.test.tsvp test run apps/web/src/lib/completionSound.logic.test.ts packages/client-runtime/src/state/threadReducer.test.tsvp run --filter t3 typecheckImplemented with gpt-5.6-sol via the Codex harness in T3 Code.