Skip to content

fix(server): checkpoint capture no longer throws on an undefined stop flag - #41709

Merged
juliusmarminge merged 2 commits into
mainfrom
factory/main-e3ac310920
Nov 23, 2026
Merged

juliusmarminge merged 2 commits into
mainfrom
factory/main-e3ac310920

Conversation

@juliusmarminge

Copy link
Copy Markdown
Member

Two pull requests merged at nearly the same time left checkpoint capture reading a variable that no longer exists, so every capture threw and runs could not settle (main's typecheck and server tests were red). The pending-Stop lookup now keys off legacyWaiting, so it runs only for runs still waiting, the only ones capture still settles.

Reproduction on main

Run the failing check on main.

Evidence

The checks on this pull request are the proof: it changes what main's checks run, not what the app does.

Tests

  • vp test run src/orchestration-v2/ThreadStop.test.ts src/orchestration-v2/CheckpointCaptureService.test.ts without the fix: fails with ReferenceError: stoppedNow is not defined
  • vp test run src/orchestration-v2/CheckpointCaptureService.test.ts src/orchestration-v2/runtimeLayer.test.ts: 220 passed
  • vp test run on ClaudeAdapterV2, BackgroundWorkStop, CheckpointRollbackService.taskFolder, LegacyV1Cutover, MuseReplayFixtures, ThreadStop: 576 passed
  • vp run typecheck (apps/server): pass
  • vp run check:changed: pass

Not in this change

  • The schemaClassMissingBrand suggestions in the typecheck log are suggestions, not errors, and were left alone.

Who did the work

  • Written by Claude Opus 5.5, in Claude Code
  • Reviewed by GPT-6.1 Sol, in Codex

Run by the t3code factory in T3 Code.

… flag

#41685 and #41362 merged together left CheckpointCaptureService reading
`stoppedNow`, which #41362 had replaced with `legacyWaiting`. Only runs
still `waiting` are settled by capture, so look up a pending Stop only for them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 23, 2026
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Checkpoint capture now skips interrupt request and result turn-item lookup when a run is not in the legacy waiting state. Legacy waiting runs still use those items to determine the final status.

Changes: Checkpoint capture stop handling

Layer / File(s) Summary
Gate interrupt-item lookup by run status
apps/server/src/orchestration-v2/CheckpointCaptureService.ts
For runs outside the legacy waiting state, stopSignals is now empty. The existing interrupt-item lookup and status decision therefore apply only to legacy waiting runs.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Possibly related issues

  • pingdotgg/t3code#41617: This issue concerns stop detection in checkpoint capture. The change touches the same path, but does not establish that it fixes the unpaired-request case.
  • pingdotgg/t3code#15124: This issue also involves checkpoint capture and the waiting state. The change limits interrupt-item handling by state, but does not address the issue’s awareness and Stop-target display symptoms.

Possibly related PRs

Suggested labels: bugfix

Suggested reviewers: voltcrash, exsidius

Merge Risk: Minimal · up to 00046

This restores checkpoint capture after a regression where captures threw a ReferenceError and runs never settled. Pending Stop handling is preserved for runs still waiting. No concrete merge-blocking risk was established.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the fix for checkpoint capture throwing on an undefined stop flag, which matches the one-line change in CheckpointCaptureService.ts that keys the pending-Stop lookup off legacyWaiting.…
Description check Passed The description covers the problem (captures throwing on a removed variable, stoppedNow), the change (pending-Stop lookup gated on legacyWaiting), and detailed verification with test commands and …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the fix for checkpoint capture throwing on an undefined stop flag, which matches the one-line change in CheckpointCaptureService.ts that keys the pending-Stop lookup off legacyWaiting. It follows the conventional commit format and is specific enough for a teammate scanning history.

Full details: Description check

Explanation

The description covers the problem (captures throwing on a removed variable, stoppedNow), the change (pending-Stop lookup gated on legacyWaiting), and detailed verification with test commands and results. The template's Scope section is missing: it does not link an issue or explain why the fix needs no issue, and it does not state whether a maintainer requested the PR. The Problem and Change sections are also not labeled with the template headings. Reproduction is a single vague line ("Run the failing check on main") without the environment. The Evidence section is not in the template. The template's Scope requirement is the main gap.

Resolution

Add a Scope section that links the issue showing the bug, or explains why a small obvious fix needs no issue. Also state whether a maintainer requested the PR. Consider using the template headings (Problem, Change, Scope, Verification) and making the reproduction steps concrete.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 42c9107 and 0004692.

Files selected for processing: 1

  • apps/server/src/orchestration-v2/CheckpointCaptureService.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

… run

Since #41362 a run settles as completed when its provider turn ends, and
commands treat it as waiting until its checkpoint capture commits. A Stop
accepted in that window stored only its request, so the run stayed completed.
Checkpoint capture now looks for that pending Stop on completed runs too and
settles the run as interrupted with its result, as #41685 intended.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added size:S 10-29 changed lines (additions + deletions). and removed size:XS 0-9 changed lines (additions + deletions). labels Nov 23, 2026
@juliusmarminge
juliusmarminge merged commit 7872c23 into main Nov 23, 2026
35 of 36 checks passed
@juliusmarminge
juliusmarminge deleted the factory/main-e3ac310920 branch November 23, 2026 22:44
e-kotov added a commit to e-kotov/t3code that referenced this pull request Nov 23, 2026
Match upstream pingdotgg#41709 byte-for-byte in production. Retain behavioral regression coverage for a real Stop accepted during capture on both persisted waiting and completed runs, and the eager full integration fixture.
bigx333 pushed a commit to bigx333/t3code that referenced this pull request Nov 24, 2026
… flag (pingdotgg#41709)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 7872c23)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted 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