t3code icon indicating copy to clipboard operation
t3code copied to clipboard

[Bug]: rollback ("edit from here") silently hidden in non-git workspaces, conversation-only rewind blocked too

Open eliottscherrer opened this issue 1 month ago • 10 comments

Before submitting

  • [x] I searched existing issues and did not find a duplicate.
  • [x] I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. open a thread whose workspace is not a git repo (scratch project)
  2. hover one of your own past messages in the timeline
  3. only "Copy message" shows up, no "edit from here" button, nothing explaining why

same driver (pi), same account, in a git-backed workspace (project repo or t3 worktree) the button shows up on hover and rollback works. so it's workspace dependent, not driver dependent

Expected behavior

rollback should work, at least conversation-only ("revert and keep changes", restoreFiles: false) which doesn't need a file checkpoint in the first place. or at least tell me why it's unavailable instead of silently hiding the button

Actual behavior

no rollback at all in non-git workspaces:

  • CheckpointCaptureServiceV2 (apps/server/src/orchestration-v2/CheckpointService.ts:381, also :342) stores checkpoints with status: "missing" when isGitCheckpointable(cwd) is false
  • the client only maps ready checkpoints into the per-message revertTurnCount that gates the "edit from here" button (deriveRevertTurnCountByUserMessageId, apps/web/src/session-logic.ts:1045)
  • server rollback resolution also hard-requires a ready checkpoint -> "Rollback target run ordinal N is unavailable for thread X"

so in a scratch (non-git) workspace the whole rollback feature is dropped, including "revert and keep changes" which is conversation-only and doesn't need any file checkpoint

also: the only "Roll back" button for checkpoint items (apps/web/src/components/chat/V2ItemInspector.tsx:376, gated on status === "ready") renders from timeline rows' projectedItem, but the timeline entry builder skips checkpoint items entirely (apps/web/src/session-logic.ts:631), so that button is unreachable from the timeline

Impact

Minor bug or occasional failure

Version or commit

0.0.46-nightly.20261008.2813

Environment

macOS 27.0 arm64, t3 code nightly desktop app, provider pi (pi 1.1.0)

Logs or stack traces

no stack traces, it's fully silent. evidence from ~/.t3/userdata/statev2.sqlite: threads in ~/.t3/scratch/* have all their checkpoint rows status="missing", threads in git worktrees have status="ready" (30 pi threads with 121 ready checkpoints, all git-backed)

source refs (main @ a4c9494b): CheckpointService.ts:381 + :342, session-logic.ts:1045 + :631, V2ItemInspector.tsx:376

Screenshots, recordings, or supporting files

No response

Workaround

none in-app. running the conversation in a git-backed project (or git init-ing the workspace folder) makes checkpoints "ready" and the button shows up for subsequent turns. conversation-only rewind really shouldn't need a git repo at all tho?

eliottscherrer avatar Oct 08 '26 11:10 eliottscherrer

The silent hiding is two separate gates: the conversation rewind target comes from the server (typeof revertTurnCount === "number" in apps/web/src/components/chat/MessagesTimeline.tsx), while file restore is separately gated on a worktree and refused when the directory is shared with another thread or session (docs/user/composer.md, "Edit an earlier prompt").

So a non-git workspace loses the conversation-only rewind as well, even though that part needs no file restore. If the workspace gate is deliberate, a disabled control with a tooltip would at least explain the omission instead of showing only "Copy message".

kushaldotdev avatar Oct 09 '26 18:10 kushaldotdev

4. The silent hiding is two separate gates: the conversation rewind target comes from the server (typeof revertTurnCount === "number" in apps/web/src/components/chat/MessagesTimeline.tsx), while file restore is separately gated on a worktree and refused when the directory is shared with another thread or session (docs/user/composer.md, "Edit an earlier prompt"). So a non-git workspace loses the conversation-only rewind as well, even though that part needs no file restore. If the workspace gate is deliberate, a disabled control with a tooltip would at least explain the omission instead of showing only "Copy message".

yeah that's exactly what i explain in my issue, i don't really understand your comment? it's basically just rephrasing what i say in my issue and it really seems to be AI generated

eliottscherrer avatar Oct 10 '26 22:10 eliottscherrer

yeah that's exactly what i explain in my issue, i don't really understand your comment? it's basically just rephrasing what i say in my issue and it really seems to be AI generated

Fair, and sorry — that comment was AI-written and it just restated what you already wrote in the issue. That was on me, not useful.

One thing I still can't tell from the report: in the non-git folder, does "Edit from here" come back if you git init that same folder while T3 is open, or only after reopening the thread? That would say whether the workspace check happens when the card is drawn or once per thread, which changes where the fix goes.

kushaldotdev avatar Oct 11 '26 06:10 kushaldotdev

Checked main a12d6ed942 on Linux with vp run dev and an isolated copy of stopped thread data. Hovering the user message in a non-git scratch thread showed Copy message and Copy prompt link, with no Edit from here. A git-backed thread using the same Claude provider showed Edit from here. This confirms the reported UI difference in existing threads, but does not verify Pi conversation rollback itself.

Fresh-thread and server rollback verification could not finish: the VM stalled, the client lost its server connection, and server logs recorded event-loop stalls up to 105 seconds. No fix has been published. Can you confirm whether this still happens on a current nightly with Pi, and whether it affects both completed and interrupted turns?

juliusmarminge avatar Oct 22 '26 01:10 juliusmarminge

Rechecked the Linux web dev app at a12d6ed942 with isolated stopped-thread data: hovering the user message in a non-Git scratch thread exposes Copy message and Copy prompt link, but no Edit from here. This is already covered by the open fix #18379, which includes conversation-only rollback, disabled file restoration for missing snapshots, regression tests, and live web/Codex evidence. Linked it here; no duplicate PR was opened. Pi and Electron were not verified in this run. Removed needs more info because the existing report and fix identify the failure.

juliusmarminge avatar Oct 22 '26 01:10 juliusmarminge

I really enjoy using T3 code and prioritize it in any scenario. The "edit from here" feature only works in the repository, which significantly affects usability.

rogeryk avatar Nov 03 '26 16:11 rogeryk

Still affected on T3 Code Desktop/local server 0.1.8-nightly.20261104.4165 (8b44f42b14c8), Linux x64 / KDE Plasma, using Codex.

I want to edit any earlier prompt and continue in the same thread. Having to fork for small corrections adds unnecessary friction. I initially thought T3 did not support editing sent prompts at all.

Read-only inspection of this non-Git scratch thread found five checkpoints, all with status: "missing". The installed source still has the gates described here: CheckpointService.ts records missing checkpoints for non-Git workspaces, deriveRevertTurnCountByUserMessageId in session-logic.ts accepts only ready checkpoints, and TimelineUserMessageRow.tsx omits “Edit from here” when no target exists. The Codex adapter advertises rollback support.

This adds current Linux desktop/Codex evidence to the existing report. No UI automation, rewind operation, or isolated reproduction was performed; the checkpoint state and installed source were inspected directly.

Conversation-only editing should be available without initializing Git or creating another thread. I see #18379 is still open and unmerged; that is the behavior I am requesting.

Drafted with Codex (gpt-6.1-sol) in T3 Code on my behalf.

vibhor1102 avatar Nov 04 '26 12:11 vibhor1102

Also affected on T3 Code Desktop and local server 0.1.8-nightly.20261104.4179 (9e855385), macOS arm64.

I replayed the "Edit from here" rules read-only against my local database, covering threads with activity since Nov 1. This models deriveRevertTurnCountByUserMessageId and deriveAvailableRevertTurnCounts, so it's an approximation and not a check of the rendered UI.

Workspace Pencil shown Pencil hidden
Non-git scratch (22 threads) 0 40
Git repo or worktree 331 4

Every prompt in a scratch thread loses the action, because its checkpoints are all missing. All 22 scratch threads were in that state. I didn't trace the 4 hidden prompts in git workspaces, which may have a different cause.

This comes up often for me because I use scratch threads for work that happens elsewhere, for example when the agent works on another machine over SSH. Those threads have no local repo, but rewinding the conversation and resending a prompt would still be useful in them.

The gates are still there at 9e855385: CheckpointService.ts:371 stores missing when the workspace isn't a git repo, session-logic.ts:1057 only offers the action after a ready checkpoint, and CheckpointRollbackService.ts:155 rejects anything else. The 10 commits on main since then don't touch session-logic.ts, ChatView.logic.ts, CheckpointService.ts or CheckpointRollbackService.ts.

#18379 looks stalled. It has conflicts with main, carries pr:gate-failed, and its last commit was on Oct 19. The maintainer takeover note on that PR said no merge was planned. Is it still the intended fix, or should someone rebuild conversation-only rewind on current main?

Investigated and drafted with Claude Code (Claude Opus 5.5) through T3 Code triage.

ProJedi1234 avatar Nov 04 '26 21:11 ProJedi1234

ran into this in a scratch thread and honestly thought t3 just didn't have editing at all. opencode has /undo and claude code lets you rewind to any earlier prompt and restore only the conversation; not being able to do that here outside of a git repo is pretty annoying. no files even need to be touched for it

aarock1234 avatar Nov 05 '26 09:11 aarock1234

Still happening on 0.1.8 (desktop app and local server, macOS arm64, Codex).

The most common reason to edit a past message is to resend it with different wording. That's a conversation-only change, with no files to restore, but in a non-git workspace the "Edit from here" button doesn't appear at all, not even on the latest message. Nothing explains why it's missing, so it reads as if editing doesn't exist.

The server already supports this. With restoreFiles: false, rollback skips the file restore and the workspace isolation check (CheckpointRollbackService.ts:237, Orchestrator.ts:12438), and telemetry tracks it as conversation_only. The only problem is that the rewind target has to be a file checkpoint, and non-git workspaces never get one. If the target could be identified by run instead, or by a conversation-only marker, editing would work everywhere and file restore would remain a git-only option.

Investigated with t3 triage by Claude Code (Claude Opus 5.5).

joshrad-dev avatar Nov 11 '26 04:11 joshrad-dev