Skip to content

feat(opencode): enable exact recoverable conversation rewind - #531

Merged
rynfar merged 10 commits into
pylonfrom
upstream/2026-09-12-exact-rollback
Sep 12, 2026
Merged

feat(opencode): enable exact recoverable conversation rewind#531
rynfar merged 10 commits into
pylonfrom
upstream/2026-09-12-exact-rollback

Conversation

@rynfar

@rynfar rynfar commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator

OpenCode checkpoints could not offer Pylon's rewind actions because its relative numTurns API could not prove retries, compensation or restart recovery. This change uses native immutable forks to enable both restore-files and keep-files rewind through the existing exact rollback saga.

Each eligible completed Pylon turn has a private, immutable snapshot. Admission verifies the current idle native history, account, workspace, incarnation and pending inputs; application selects a fresh verified fork, and compensation selects the untouched source. Native message contents and parent/compaction relationships are checked after ID remapping. Concurrent native completion handlers cannot replace the first captured checkpoint. Original checkpoint targets remain distinct from the current source after compaction and restart. Proofs and snapshot IDs stay private. Historical checkpoints without an exact snapshot remain unavailable. Experimental native plan-file mode and externally managed servers with unobservable runtime flags also remain ineligible for exact rewind; ordinary plan/history/resume continue normally. Native forks cannot copy the external plan file, and Pylon does not alter workspace files or runtime flags to conceal that limit.

The shared service persists selected native cursors before capture/apply/inspect/release receipts, rejects missing cursors and stale same-incarnation writes, and persists compaction state on success/failure before publishing completion. Prime's existing exact saga and provider lifecycle remain intact. Native fork snapshots add storage proportional to the histories retained; no approximate count-based fallback is introduced.

Validation: independent adversarial adapter and service review; 363 focused adapter/helper/service/saga/reconciliation/capability tests; server typecheck and scoped lint. An isolated installed OpenCode 1.18.29 import/fork/read smoke verified full/truncated semantic equality, compaction-tail ID mapping, parentless fork identity, idle/input APIs and unchanged source/workspace. It used synthetic data, no prompts or inherited credentials, and stopped both owned processes. This is native API evidence, not rendered UI or an LLM compaction run. Final-head CI is required before merge.

Part of #526; completes the OpenCode portion of the #513 exception for upstream fd5553f1afcef4f410a067687faa991743b5034c and efccda9ac9230db22b36990cffabdad218fa41b0. Codex and Claude follow separately. The compact ledger records the already merged sidebar, public preview, mobile Antigravity and Claude quota dispositions; the cycle cursor remains unchanged pending final accounting.

Preview workflow closure additionally depends on the independently reviewed checkout repair in #532; the owning issue tracks its actual post-merge execution.

Model: GPT-6. Harness: Codex.

@vercel

vercel Bot commented Sep 12, 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 added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XXL labels Sep 12, 2026
@github-actions

github-actions Bot commented Sep 12, 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.1 KiB 14.1 KiB +4 B (+0.0%) 15.1 KiB
Codex Thread snapshot wire 7.2 KiB 7.2 KiB −5 B (−0.1%) 7.3 KiB
Codex Live turn WebSocket wire 6.9 KiB 6.9 KiB +9 B (+0.1%) 7.8 KiB
Codex Live turn WebSocket decoded 58.8 KiB 58.8 KiB 0 B (0.0%) 66.4 KiB
Codex Live turn messages 10 10 0 (0.0%) 21
Claude Total thread wire 14.1 KiB 14.1 KiB −12 B (−0.1%) 15.1 KiB
Claude Thread snapshot wire 7.2 KiB 7.2 KiB −6 B (−0.1%) 7.3 KiB
Claude Live turn WebSocket wire 6.9 KiB 6.9 KiB −6 B (−0.1%) 7.8 KiB
Claude Live turn WebSocket decoded 59.7 KiB 59.7 KiB 0 B (0.0%) 66.4 KiB
Claude Live turn messages 10 10 0 (0.0%) 21

Baseline: d4e599b · PR result: 42e4959 · 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.3 KiB

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

@rynfar
rynfar force-pushed the upstream/2026-09-12-exact-rollback branch from 030ac21 to 42e4959 Compare September 12, 2026 17:12
@vercel

vercel Bot commented Sep 12, 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 12, 2026 5:13pm UTC

@rynfar
rynfar merged commit 9764d77 into pylon Sep 12, 2026
20 checks passed
@rynfar
rynfar deleted the upstream/2026-09-12-exact-rollback branch September 12, 2026 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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