Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): start V2 provider turn when checkpoint baseline capture fails #12153

MergedSunkenInTime(GitHub profile, opens in a new tab)merged 4 commits intot3code/codex-turn-mapping fromrefs/pull/12153/headmerged by juliusmarminge View on GitHub

What changed

When the Git checkpoint baseline fails before the provider starts, V2 now logs a warning and starts the provider anyway. The turn runs without a baseline checkpoint, the same way V1 behaves on main.

In RunExecutionServiceV2.startRootRun, the captureBaseline call gets an Effect.catchCause that logs "orchestration V2 checkpoint baseline capture failed; starting provider without a baseline" and continues. Interrupts still propagate. Nothing downstream needs to change. materializeBaselineCheckpoint already reports the checkpoint as missing when the ref does not exist, and capture already skips the diff summary when the previous ref is absent.

A new test in RunExecutionService.test.ts fails the baseline and checks that startTurn is still called once and that no failed run, attempt, or node event and no error turn item is written.

Why

ProviderTurnStartService writes the run, attempt, and node as running before it calls startRootRun. If the baseline capture then failed, for example with a VcsProcessTimeoutError after 30 seconds on a worktree with 70k untracked files, the error escaped as RunExecutionStartError, EffectWorker logged it, and nothing wrote a terminal state. The thread showed "Thinking" until the user pressed Stop.

On main, the V1 CheckpointReactor captures the baseline next to provider start and only logs a warning when it fails. V2 made the baseline a hard gate. This change restores the V1 behavior so a slow or failing checkpoint never blocks the agent.

Checkpoint speed itself is a separate problem. captureCheckpoint runs git add -A -- . into a temp index, so a worktree with many large untracked files will still time out and skip the checkpoint for that turn. Excluding the directory in .git/info/exclude avoids that.

Reproduction

The original report came from a Windows host on 0.0.41-preview.20260916.1794 with a worktree holding about 71k untracked scratch files (43 GB). Removing the /work/ line from .git/info/exclude and sending "Reply with hello." made the checkpoint time out after 30 seconds. The thread showed Working for about 8 minutes until Stop. Restoring the exclusion made the same thread answer.

Local repro without a large worktree:

  1. Put a git shim first on the dev server's PATH. When GIT_INDEX_FILE is set (only checkpoint capture sets it) and the arguments include add, the shim sleeps 45 seconds and then runs the real git. Every other call passes through.
  2. Run vp run dev --home-dir <isolated dir>, pair the browser, add a small local git repo as a project, and pick Claude Code.
  3. Send any message and wait more than 30 seconds.

Before the fix the thread showed "Working for 1m 6s" with Stop still visible. The server log had RunExecutionStartError, caused by CheckpointBaselineCaptureError, caused by VcsProcessTimeoutError ... after 30000ms.

UI changes

Before, stuck after the timeout:

Before: Working for 1m 6s

The after screenshots below are from an earlier revision of this PR that failed the run with a visible error. The current revision starts the provider instead, so the thread proceeds as normal after the 30 second timeout. I have not re-recorded that path in the browser yet because the test machine has no provider credentials, so the provider would fail right after starting.

Earlier revision: checkpoint failure shown as a failed run

Verification

vp test run apps/server/src/orchestration-v2/RunExecutionService.test.ts passes 39 of 39. The apps/server typecheck, vp fmt --check, and vp lint on the two changed files are clean.

Not verified on the original Windows host. A full provider reply after a skipped baseline was not exercised in the browser because the test machine has no provider credentials.

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

Work done by Devin (Claude) via the Devin harness.


Devin session

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Macroscope has since reviewed this pull request. An earlier review was skipped by a cost limit; a review has now completed, so that notice no longer applies.

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at 36105ba

      Macroscope's review found this PR approvable — This is a narrowly scoped server bug fix that lets provider turns proceed when checkpoint baseline capture fails, while preserving interrupt handling and recording a warning. The added test verifies the fallback without changing successful-run behavior.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. juliusmarminge merged this93205db

    5. juliusmarminge closed this

Sign in to join this conversation.