fix(server): fail V2 runs when provider sessions cannot open - #12790
juliusmarminge merged 2 commits into
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a localized V2 startup bug fix that terminalizes runs when provider sessions fail to open, while preserving interruption, stale-run, retry, and successful-start behavior. The production change is self-contained and accompanied by targeted regression tests, with no schema, default, deployment, or static-analysis configuration impact. You can add or adjust custom eligibility rules. Learn more. |
a1f8051 to
0337dd6
Compare
89bddb3 to
639946b
Compare
The session-open failure path duplicated the turn-item, run, attempt and node event assembly already used by the sign-out and empty-compaction path. Extract settleRunBeforeStart and use it in both; payloads are unchanged, including startedAt staying null when the provider never opened and the trailing provider-thread update on the account path. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Rebased onto One follow-up commit on top ( Verified in Nothing else changed. Rebased and touched up by a maintainer's agent; a human will re-review. |
639946b to
f780c2a
Compare
dcaf479
into
pingdotgg:t3code/codex-turn-mapping
The Fork Nightly Orchestrator v2 Test gate has failed on the upstream SelectionRestart integration test since upstream pingdotgg#12790 changed how provider session open failures settle a run. Add the fork-side fixture alignment patch (f2f8d2d) to the replay stack so the nightly can build on the current upstream head.
pingdotgg#12790 settles a V2 run as failed when the provider session cannot open. The selection restart fixture simulated a transient replacement-open failure and expected the restart to retry it, which no longer happens, so the integration test died waiting for attempt 2 to complete. Drop the simulated failure injection and pin the restart lifecycle on its own: superseded first attempt, completed replacement attempt, no hard-interrupt items, and a freshly allocated replacement session.
pingdotgg#12790 settles a V2 run as failed when the provider session cannot open. The selection restart fixture simulated a transient replacement-open failure and expected the restart to retry it, which no longer happens, so the integration test died waiting for attempt 2 to complete. Drop the simulated failure injection and pin the restart lifecycle on its own: superseded first attempt, completed replacement attempt, no hard-interrupt items, and a freshly allocated replacement session.
pingdotgg#12790 settles a V2 run as failed when the provider session cannot open. The selection restart fixture simulated a transient replacement-open failure and expected the restart to retry it, which no longer happens, so the integration test died waiting for attempt 2 to complete. Drop the simulated failure injection and pin the restart lifecycle on its own: superseded first attempt, completed replacement attempt, no hard-interrupt items, and a freshly allocated replacement session.
Co-authored-by: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
A provider session that rejects during V2 startup leaves the run in
starting, so a delegated task continues to reportrunningafter the effect worker exhausts its retries. This occurred with a Grok ACP protocol startup failure in preview0.0.43-preview.20260919.1974.Persist a failed run, attempt, root node, and error item when session opening returns a typed failure. The existing current-attempt/status guard prevents stale failures from overwriting interruption; database write failures remain retryable. Pure interruption propagates unchanged.
This is a T3 Code lifecycle bug, not a Fleet configuration bug. The failing regression invokes
ProviderTurnStartServicedirectly. A rejectedproviderSessions.openexits beforestartRootRunand, on the original code, leaves the durable run instarting. No Fleet code or hook participates in that path.Validation: the new regression failed against the original code, then all 9 focused
ProviderTurnStartServicetests passed. The existing SQL stale-start guard test passed. Server typecheck, scoped lint/type diagnostics, formatting, and diff checks passed. The running preview was not replaced, so this does not claim a successful Grok session on an installed candidate.Targets the V2 branch tracked by #2829. The change handles session opening before
startRootRun.Models: GPT-5.6 Sol for implementation and independent review; GPT-6 Astra for controller verification. Harness: Codex through T3 Code preview.