Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): a turn after a steered queued message reuses the last checkpoint #43745

MergedMauriceCRRR(GitHub profile, opens in a new tab)merged 3 commits intomain fromrefs/pull/43745/headmerged by juliusmarminge View on GitHub

Problem

After a queued message is steered into a running turn, the next turn takes a full snapshot of the workspace before its prompt is sent.

A message sent while a turn runs is queued as its own run and gets an ordinal. When it is steered into the running turn, that run is cancelled and never writes a checkpoint. The next turn's baseline looks for the checkpoint of the ordinal before it, finds none, and snapshots the workspace while the prompt waits. When the snapshot runs out of its 5-second budget the turn starts without a baseline, and its changed files and diff are empty.

On a 0.1.12 install this was seen twice within an hour: a run ran, the next message was steered into it, and the run after that took a full snapshot. A baseline that finds its checkpoint takes about 20 ms there; these took the full 5 seconds, because a snapshot of that workspace was slow for a separate reason.

Change

At turn start, if every run between the last run that ran and the new one is a queued message that was steered into that last run, the baseline points the missing ref at that run's end checkpoint instead of taking a snapshot. Everything that reads the previous ordinal (the end capture, the baseline record, the diff queries, the clients) works as before.

It steps over a run only on the record the steer itself writes: the run is cancelled without a checkpoint, and its message's turn item says it was promoted to a steer and now belongs to the run whose checkpoint is reused. Such a message was cancelled while that turn was still running, so whatever its run could have written is in that checkpoint. The checkpoint must be recorded as ready for that run. A queued message that was removed, a message steered into any other run, a failed or rolled-back run, a run whose end checkpoint was not recorded or not captured, a missing row and a folder with populated submodules keep the snapshot, and so does a copy that fails or takes longer than the baseline budget.

One thing changes for the user: edits made between the two turns, by hand or by another thread in the same folder, now count towards the next turn, as they already do when no message was steered in between. The snapshot used to leave them out.

Not changed: a baseline ref that a turn start wrote before a server restart sent that turn back to the queue survives a rewind, and the resumed turn then compares against it. That is so today for the snapshot and stays so for the copy.

Scope

A bug in the checkpoint baseline. Production code is +119 −5 in seven files: the walk over the runs, one optional field to carry its result to the baseline, one checkpoint operation that gives an existing commit a second ref (no existing operation does that without making a new commit), and a checkpointIds filter on an existing projection query.

Fixes #43743.

Verification

macOS 27.2, Apple silicon, git 2.54.0, Node 26.13.1.

  • SteeringCompletion.integration.test.ts, two new rows with a real git workspace: after a steered queued message, the next turn's baseline ref names the same commit as the previous turn's end checkpoint; after a removed queued message it names a different commit, its own snapshot. Dropping the new argument from the forkBaseline call makes the first row fail.
  • CheckpointService.test.ts, five rows: no source, an existing ref, a copy, a declined copy and a copy over its budget. With a source and a missing ref no snapshot is taken; on main that row takes one.
  • ProviderTurnStartService.test.ts, the walk: a steered message, and several steered into the same run, find the run before them. A removed message, a message steered into another run, a target that took the message and ended without a checkpoint, a queued message that ran, a run stopped before its provider turn, a failed run, a rolled-back run, a missing row, a checkpoint recorded as an error or missing, and a thread whose first run was a steered message find none.
  • GitVcsDriver.test.ts: the copy names the identical commit, leaves an existing ref alone, and declines an unknown source and a repository with a populated submodule.
  • Passed: vp test run on ProviderTurnStartService.test.ts (115), CheckpointService.test.ts (12), SteeringCompletion.integration.test.ts (84), RunExecutionService.test.ts (85), CheckpointCaptureService.test.ts (13), CheckpointStore.test.ts (16) and ProjectionStore.test.ts (64); vp run --filter t3 typecheck. GitVcsDriver.test.ts: everything passes except the three "checkpoint bulk staging cleans operation-owned packs …" cases, which fail the same way on main on this Mac (#39913).
  • Not checked: a real steered message in a running app with this change, Linux and Windows.

Written by Claude Opus 5.5 and reviewed by GPT-6.2 Astra, both run in T3 Code.

    1. Pushed0e1115c

    2. Evidence

      Queue a message during a Claude turn, steer it using Send now, wait for the ready checkpoint, then request a file edit with workspace snapshots taking over five seconds. Both runs used fresh synthetic projects, Linux web, Chromium 1280x800, light theme, and Claude Haiku 5.5.

      BeforeAfter
      Before: completed edit has no available turn patchAfter: note.txt retains its before-to-after diff
      6bec332fca0e1115ceb8
      Before recordingAfter recording

      Base had no baseline ref 3 and its edit checkpoint listed no files. Head's baseline ref 3 equalled checkpoint ref 2, and its edit checkpoint listed note.txt (+1/-1). Both edited the file on disk.

      Seed and command driver - Reproduction instructions and recording details - Runtime observations

      Each recording joins the original interaction with a later inspection clip from the same unchanged app state. Playback speed and app content are unchanged.

      Not shown:

      • The original macOS desktop 0.1.12 environment was not exercised; this proves the shared server failure and fix through Linux web.
      • The reported 5,017/5,035 ms timings were not measured. A real seven-second Git clean filter reproduced the baseline timeout condition.
    3. juliusmarminge added labelstakeover:ready

    4. juliusmarminge removed labelstakeover:in-progress

    5. juliusmarminge merged thiseadd4e7

    6. juliusmarminge closed this

    7. juliusmarminge removed labelstakeover:ready

Sign in to join this conversation.