Skip to content

fix(server): keep queued turns active during handoff - #65

Merged
incognitojam merged 1 commit into
mainfrom
t3code/fix-premature-completion-state
Aug 9, 2026
Merged

fix(server): keep queued turns active during handoff#65
incognitojam merged 1 commit into
mainfrom
t3code/fix-premature-completion-state

Conversation

@incognitojam

Copy link
Copy Markdown
Collaborator

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.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XS labels Aug 9, 2026
@incognitojam
incognitojam merged commit 57c7b10 into main Aug 9, 2026
14 checks passed
@incognitojam
incognitojam deleted the t3code/fix-premature-completion-state branch August 9, 2026 14:55
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant