Keep active turns running until session settles#2517
Keep active turns running until session settles#2517hogeheer499-commits wants to merge 1 commit intopingdotgg:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Needs human review This PR modifies the turn state machine in the orchestration projection pipeline, changing when turns transition from 'running' to 'completed'. This is a significant runtime behavior change to core orchestration logic that warrants human review. You can customize Macroscope's approvability policy. Learn more. |
What changed
runningwhile the thread session still reports that same turn as active.Why this should exist
This is a focused server projection correctness fix.
A local T3 Code 0.0.22 desktop state showed this inconsistent projection:
The event stream showed a running session, then a non-streaming assistant message for the active turn, then more provider activity. The old projection logic treated that non-streaming assistant message as final turn completion. That is too early for providers that emit non-streaming assistant segments during longer work.
The regression test mirrors that sequence. It then deletes the projection rows and bootstraps from the event log again, so the test covers both online projection and replay.
Scope
Validation
npx --yes [email protected] run --filter t3 test src/orchestration/Layers/ProjectionPipeline.test.ts- 19 passednpx --yes [email protected] run --filter t3 test src/orchestration/Layers/ProviderRuntimeIngestion.test.ts- 38 passednpx --yes [email protected] run --filter t3 test- 121 files passed, 961 tests passed, 1 file / 4 tests skippednpx --yes [email protected] run fmt:check- passednpx --yes [email protected] run lint- 0 errors, existing warnings onlynpx --yes [email protected] run --filter t3 typecheck- exit 0, existing Effect language-service messages only