Skip to content

feat(pair): refuse a rewind while the executor is working - #658

Merged
rynfar merged 1 commit into
pylonfrom
feat/pair-rewind-guard
Sep 18, 2026
Merged

rynfar merged 1 commit into
pylonfrom
feat/pair-rewind-guard

Conversation

@rynfar

@rynfar rynfar commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

What

Web and mobile refuse to rewind a lead while its pair executor holds a turn, and say why: "Stop the executor before rewinding. It works in this thread's worktree and would write over the restored files."

Why

A lead and its executor share one worktree. The server already interrupts a running executor when a rewind is requested, but it says so itself: the executor can still write for a moment before the interrupt lands, onto files the rewind is restoring. Changing rewind admission in the decider was ruled out to keep pair mode out of the core, so the clients ask first and the reactor stays as the backstop.

How

  • pairRewindBlockedReason in client-runtime/state/pair.ts (pure): blocked while the executor is starting, running, or paused on an approval or a question, since it resumes and writes once answered. Not blocked when the pair is off, the executor is idle or finished, or the thread is another lead's or another environment's.
  • Web: ChatView's rewind handler checks it right after the existing "interrupt the current turn first" check and reports it the same way. That is the only change to ChatView.
  • Mobile: ThreadRouteScreen shows it as a "Rollback unavailable" alert before the confirmation.

Verification

  • vp test run packages/client-runtime/src/state: all passing, with two new tests written first (one seen failing; the "allows it" cases pass against the stub by construction).
  • Typecheck @t3tools/client-runtime, @t3tools/web, @t3tools/mobile: 0 errors. Format clean; no new lint warnings in the two touched screens.
  • Not run in a browser or on a simulator.

Part of #622.

Model: Claude Fable 5.1, in Pylon via the Claude Code harness.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@vercel

vercel Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
pylon-marketing Ready Ready Preview Sep 18, 2026 10:15pm UTC

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M labels Sep 18, 2026
@rynfar
rynfar force-pushed the feat/pair-rewind-guard branch from 7363387 to c8f534a Compare September 18, 2026 22:21
@vercel

vercel Bot commented Sep 18, 2026

Copy link
Copy Markdown

Deployment failed for project pylon-marketing with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/pylon-code?upgradeToPro=build-rate-limit

@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 14.0 KiB 14.0 KiB +2 B (+0.0%) 15.1 KiB ✅
Codex Thread snapshot wire 7.2 KiB 7.2 KiB +3 B (+0.0%) 7.3 KiB ✅
Codex Live turn WebSocket wire 6.7 KiB 6.7 KiB −1 B (−0.0%) 7.8 KiB ✅
Codex Live turn WebSocket decoded 58.0 KiB 58.0 KiB 0 B (0.0%) 66.4 KiB ✅
Codex Live turn messages 9 9 0 (0.0%) 21 ✅
Claude Total thread wire 14.0 KiB 13.9 KiB −18 B (−0.1%) 15.1 KiB ✅
Claude Thread snapshot wire 7.2 KiB 7.2 KiB −7 B (−0.1%) 7.3 KiB ✅
Claude Live turn WebSocket wire 6.7 KiB 6.7 KiB −11 B (−0.2%) 7.8 KiB ✅
Claude Live turn WebSocket decoded 58.9 KiB 58.9 KiB 0 B (0.0%) 66.4 KiB ✅
Claude Live turn messages 9 9 0 (0.0%) 21 ✅

Baseline: e397226 · PR result: 29445f3 · 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: 115.6 KiB
  • Claude decoded thread snapshot: 116.4 KiB

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

@rynfar
rynfar force-pushed the feat/pair-rewind-guard branch from c8f534a to 29445f3 Compare September 18, 2026 22:33
@rynfar

rynfar commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator Author

Merging with the Vercel preview check red: it failed with build-rate-limit (the account's build quota, tracked in #655), not because of this change. Every code check is green.

@rynfar
rynfar merged commit fe0c286 into pylon Sep 18, 2026
18 of 19 checks passed
@rynfar
rynfar deleted the feat/pair-rewind-guard branch September 18, 2026 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 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