GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(server): point Claude resume cursor at reverted transcript by maslinedwin · Pull Request #7198 · pingdotgg/t3code

Conversation

@maslinedwin

@maslinedwin maslinedwin commented Aug 16, 2026 •
edited by macroscopeapp Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Fixes #6127

What changed

Revert already restored files and trimmed the visible timeline, but the next Claude turn still saw the discarded prompts. rollbackThread left lastAssistantUuid on the reverted leaf, updateResumeCursor wrote that leaf back as resumeSessionAt, and the SDK query was started with resume only.

After rollback the adapter now:

  • recomputes lastAssistantUuid from the last retained parent assistant uuid (or clears it when nothing remains)
  • persists that cursor, with pinResumeSessionAt set only for the post-revert resume
  • passes resumeSessionAt to the SDK on the next start, and recreates the live query on the next sendTurn, so the model resumes at the retained transcript

Ordinary resume is unchanged: a cursor that still carries resumeSessionAt without the pin still starts with options.resumeSessionAt === undefined, which is the stale-checkpoint guard.

Verification

CI=true vp test run apps/server/src/provider/Layers/ClaudeAdapter.test.ts   # 71 passed
CI=true vp test run apps/server/src/provider/Layers/ProviderService.test.ts # 29 passed

Model: grok-4. Harness: T3 Code / Grok Build.


Note

Medium Risk
Changes conversation rollback and SDK resume semantics in the Claude provider path; behavior is well-covered by new tests but affects core thread continuity after revert.

Overview
Fixes a bug where conversation rollback trimmed the UI timeline but the next Claude turn still resumed from discarded transcript state.

Claude adapter: rollbackThread now recomputes lastAssistantUuid from retained turns (per-turn lastAssistantUuid), sets pinResumeSessionAt on the resume cursor, and defers replacing the live SDK query until the next sendTurn via replaceQueryAfterRollback. That restart passes resume + resumeSessionAt only when a checkpoint remains; otherwise it starts a fresh sessionId. Late frames from the old query are ignored while the query is stale. Recreated queries carry current model/permission options from stored queryOptions. Normal resume still omits resumeSessionAt unless pinResumeSessionAt is set.

Provider service: After rollback, session bindings are upserted from listSessions so persisted state matches the new cursor.

Tests extend the Claude adapter harness (fresh query per createQuery) and add rollback/resume coverage.

Reviewed by Cursor Bugbot for commit d0c6b93. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Fix Claude resume cursor to point at the last retained assistant turn after rollback

  • After rollbackThread, the adapter now pins the resume cursor to the lastAssistantUuid of the last retained completed turn, so subsequent sendTurn/startSession calls resume at the correct checkpoint.
  • Introduces replaceQueryAfterRollback in ClaudeAdapter.ts, which shuts down the old prompt queue and query, then either resumes at the pinned assistant uuid or starts a fresh session when no checkpoint remains.
  • Mid-session model and permission mode are preserved across rollback-induced query replacement via new queryOptions and currentPermissionMode fields on ClaudeSessionContext.
  • Late SDK messages and assistant frames from a discarded post-rollback stream are ignored via the new isStaleRollbackQuery predicate, preventing stale frames from corrupting session state.
  • ProviderService.rollbackConversation now upserts the updated session binding (including the new resume cursor) into the directory after rollback.
  • Behavioral Change: the first sendTurn after a rollback triggers a query restart rather than continuing on the old stream.

Macroscope summarized d0c6b93.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Pascaltib and effektsvk reacted with thumbs up emoji
All reactions
  • 👍 2 reactions
@maslinedwin
fix(server): point Claude resume cursor at reverted transcript
c6acf97
Revert restored files and the timeline, but Claude still resumed at the
reverted leaf. Recompute lastAssistantUuid from retained turns, pin
resumeSessionAt only for that post-rollback resume, and persist the
updated cursor so the next start does not keep the discarded transcript.
@coderabbitai

coderabbitai Bot commented Aug 16, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 16be542a-a7a2-453e-975e-097920e3f7cf

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
  • X
  • Mastodon
  • Reddit
  • LinkedIn

Comment @coderabbitai help to get the list of available commands.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@maslinedwin maslinedwin mentioned this pull request Aug 16, 2026
[Bug]: Revert restores files and timeline but leaves the reverted turns in the agent's context #6127
Closed
2 tasks done
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 16, 2026
macroscopeapp[bot]
macroscopeapp Bot reviewed Aug 16, 2026
View reviewed changes
Comment thread apps/server/src/provider/Layers/ClaudeAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Aug 16, 2026
View reviewed changes
Comment thread apps/server/src/provider/Layers/ClaudeAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/provider/Layers/ClaudeAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@macroscopeapp

macroscopeapp Bot commented Aug 16, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This bug fix introduces significant new state management logic for Claude rollback handling, including a new query replacement mechanism (~80 lines), multiple new state flags, and changes to event handling across the adapter. The cross-cutting nature of these session lifecycle changes warrants human review despite comprehensive test coverage.

You can customize Macroscope's approvability policy. Learn more.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

maslinedwin added 2 commits August 16, 2026 17:50
@maslinedwin
fix(server): ignore discarded Claude frames after revert
1685e19
A late assistant event from the old query could overwrite the pinned
resume cursor before the replacement query started. Freeze that cursor
until the new query is installed, and always replace the live query
after rollback even when no assistant uuid remains.
@maslinedwin
fix(server): keep Claude model and mode after revert restart
0034972
replaceQueryAfterRollback rebuilt the SDK query from start-session
options, so a mid-session setModel or setPermissionMode was dropped
when sendTurn skipped an unchanged model or omitted interactionMode.
cursor[bot]
cursor Bot reviewed Aug 16, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0034972. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/server/src/provider/Layers/ClaudeAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@maslinedwin
fix(server): keep bypass launch flag when reverting from plan
d0c6b93
Claude rejects setPermissionMode(bypassPermissions) unless the query
was created with allowDangerouslySkipPermissions. Preserve that flag
from the session's base mode after a plan rollback.
@matsvarn matsvarn mentioned this pull request Aug 16, 2026
fix(server): Claude plan mode never shows Implement #7263
Closed
2 of 4 tasks
This was referenced Aug 17, 2026
fix(server): persist Claude's live resume cursor before idle reaps asfires/t3code#39
Merged
fix(server): pin Claude resumeSessionAt only after rollback asfires/t3code#41
Merged
@shivamhwp

shivamhwp commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Note: GPT-6 on behalf of shivam (@shivamhwp).

Partial rollback loses the retained history after session recovery. Complete two turns, save the resume cursor, stop and restart the session with that cursor, then roll back one turn. startSession initializes context.turns to [], so lastRetainedAssistantUuid(context.turns) returns undefined. Rollback clears the resume session and the next query starts with a new sessionId, discarding the first turn as well as the reverted second turn.

The retained checkpoint must survive session teardown or be resolved from durable native history before rollback. An empty in-memory turn list on a recovered session does not mean the requested target is the beginning of the conversation. If the target cannot be resolved, fail before changing the workspace or timeline rather than reporting a successful partial revert with a blank provider conversation.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge

juliusmarminge commented Sep 12, 2026

Copy link
Copy Markdown
Member

Superseded by #11338 (fix: restore provider history and prompts when rewinding), which landed broader cross-provider rewind history restore including Claude. Closing this Claude resume-cursor-only approach as wash leftover hygiene — reopen if anything unique still needs merging.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge closed this Sep 12, 2026
@Zane-0x5a Zane-0x5a mentioned this pull request Sep 25, 2026
[Bug]: Claude rewind fails after a /compact that preserved recent messages, and leaves the forked transcript on disk #13638
Closed
2 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@macroscopeapp macroscopeapp[bot] macroscopeapp[bot] left review comments
@cursor cursor[bot] cursor[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[Bug]: Revert restores files and timeline but leaves the reverted turns in the agent's context

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@maslinedwin @shivamhwp @juliusmarminge
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.