Skip to content

fix(server): allow forks from provider-finished runs - #13541

Merged
Yash-Singh1 merged 2 commits into
t3code/codex-turn-mappingfrom
fork-usage-limited-turns
Sep 26, 2026
Merged

Yash-Singh1 merged 2 commits into
t3code/codex-turn-mappingfrom
fork-usage-limited-turns

Conversation

@Yash-Singh1

Copy link
Copy Markdown
Collaborator

What Changed

Allow forks from completed, waiting, failed, interrupted, and cancelled runs. Keep in-progress and rolled-back runs ineligible. Update the Codex replay fixtures and recording script to match current app-server behavior.

Why

A provider-finished run can still have a usable native thread or transcript, even when it ends because of a usage limit or another failure. Restricting forks to completed runs blocked users from continuing that work in a new thread.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Sep 25, 2026
Comment thread apps/server/src/orchestration-v2/ThreadForkService.ts
Comment thread apps/server/src/orchestration-v2/Orchestrator.ts
@macroscopeapp

macroscopeapp Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 778fae5

Macroscope's review found this PR approvable — This is a localized server bug fix that permits forks from provider-finished runs while keeping active and rolled-back runs blocked. Native versus portable fork behavior is explicitly bounded and covered by execution tests, with no schema, security, billing, deployment, or default-setting impact.

You can add or adjust custom eligibility rules. Learn more.

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire — 4.9 KiB — 6.8 KiB ✅
Codex Thread snapshot wire — 3.7 KiB — 4.9 KiB ✅
Codex Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅
Codex Live turn WebSocket decoded — 20.4 KiB — 29.3 KiB ✅
Codex Live turn messages — 2 — 8 ✅
Claude Total thread wire — 4.9 KiB — 6.8 KiB ✅
Claude Thread snapshot wire — 3.7 KiB — 4.9 KiB ✅
Claude Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅
Claude Live turn WebSocket decoded — 20.8 KiB — 29.3 KiB ✅
Claude Live turn messages — 2 — 8 ✅

Baseline: unavailable · PR result: 778fae5 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 106.1 KiB
  • Claude decoded thread snapshot: 106.4 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@macroscopeapp

This comment has been minimized.

@macroscopeapp

This comment has been minimized.

@macroscopeapp

This comment has been minimized.

@juliusmarminge
juliusmarminge force-pushed the t3code/codex-turn-mapping branch from fe4f6ad to 87c67bd Compare September 25, 2026 05:55
@Yash-Singh1
Yash-Singh1 force-pushed the fork-usage-limited-turns branch from 5d4c72c to 945a40e Compare September 25, 2026 09:06
- Only fork natively when the source run completed or is waiting; failed, interrupted, and cancelled runs fall back to a portable transcript that stops at the selected run
- Pass the source run status into decideForkExecution
- Add execution tests for Codex and Claude forks of failed, interrupted, and cancelled runs
@Yash-Singh1
Yash-Singh1 merged commit b882b10 into t3code/codex-turn-mapping Sep 26, 2026
24 checks passed
@Yash-Singh1
Yash-Singh1 deleted the fork-usage-limited-turns branch September 26, 2026 08:43
juliusmarminge added a commit that referenced this pull request Sep 26, 2026
Brings in the V2 bug-hunt fixes merged since this branch was cut
(#13541, #13775, #13786, #13793, #13796, #13802). No conflicts.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). 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