Repository navigation
Keep TUI replay aligned with the first orchestrator QUERY marker - #341
Merged
Merged
Conversation
replay_user_echo_text used rfind("\n\nQUERY: ") after requiring AGENTS
in the head. Index turns always wrap once (global_status + QUERY +
user text), so a user line that embeds that delimiter replayed as only
the suffix after the last marker. Live echo showed the full line.
Use find so the boundary matches the single orchestrator wrapper, same
class as the compaction preamble strip.
Co-authored-by: Tyler Reckart <tylerreckart@users.noreply.github.com>
Keep both Unreleased changelog entries. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Author
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_f9efd9f5-99d1-41e2-a829-bee7ad9577c3) |
Keep both Unreleased changelog entries. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep both Unreleased changelog entries. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Index turns persist
global_status()(always starts withAGENTS) plus a single\n\nQUERY:wrapper around the raw user line.replay_user_echo_textrequiredAGENTSin the prefix, then usedrfind("\n\nQUERY: ")to recover the echo.Live scrollback shows the full user line. After a conversation switch, a user turn that embeds that same delimiter (for example quoting docs:
compare\n\nQUERY: docs vs the README) replayed as only the suffix after the last marker.Compaction already treats this as a first-marker strip (#335). Replay documented the no-AGENTS case but still took the last marker when the roster was present.
Fix
Use
findso the boundary is the first\n\nQUERY:after the AGENTS roster. Keep the AGENTS guard so a user-only\n\nQUERY:line is not stripped.Tests
unit_transcript_replay_predicates— embedded QUERY after a roster line, and the same case under an[OPEN TODOS]+QUERY: \nmultipart prefix. 6/6 passed locally (+ ASan/UBSan).Independently mergeable against
main(0456350). Code hunks (transcript_replay_predicates.cpp,test_transcript_replay_predicates.cpp) do not overlap #321–#340. CHANGELOG[Unreleased]will need a rebase after whichever sibling merges first.Note
Low Risk
Narrow change to TUI replay string parsing with new unit tests; no auth, persistence, or API behavior changes.
Overview
Fixes TUI transcript replay so user-echo text matches live scrollback when the user's message contains
\n\nQUERY:after the orchestrator strips the master preamble.replay_user_echo_textnow usesfind(first\n\nQUERY:after theAGENTSblock) instead ofrfind, so embedded markers in the real user line are not mistaken for the orchestrator boundary. The existing AGENTS guard is unchanged—user-only messages with that substring are still left intact.Unit tests cover embedded
QUERYafter a roster and under an[OPEN TODOS]multipart prefix; CHANGELOG documents the fix under[Unreleased].Reviewed by Cursor Bugbot for commit 4fe3b04. Bugbot is set up for automated code reviews on this repo. Configure here.