t3code
t3code copied to clipboard
Thread briefly becomes inactive while a turn starts
Problem
When a provider session starts a turn, the thread can briefly transition from Connecting to inactive before becoming Working. This makes status-grouped thread lists jump between sections during startup.
The lifecycle currently exposes provider readiness between session connection and turn start as an idle-ready state, even though a turn-start request is still pending.
Expected behavior
A pending turn should remain Connecting through provider readiness and transition directly to Working when the turn starts. A failed start should still settle to ready or error, and genuinely idle sessions should remain inactive.
Acceptance criteria
- [x] New and restarted sessions do not expose an inactive frame during turn startup.
- [x] Provider readiness preserves Connecting while a turn start is pending.
- [x] Turn start transitions directly from Connecting to Working.
- [x] Failed starts and genuinely idle sessions keep their existing terminal states.
- [x] Lifecycle coverage includes successful startup, failed startup, and idle readiness.