fix(cli): folded paste content was invisible to the model#5347
Open
liugh-dev wants to merge 1 commit into
Open
fix(cli): folded paste content was invisible to the model#5347liugh-dev wants to merge 1 commit into
liugh-dev wants to merge 1 commit into
Conversation
A folded multi-line paste ([Pasted text #N · M lines]) was never seen by the model — only the placeholder label was. The CLI passed the folded label (the un-expanded `line`) as the controller's `raw` value. The Memory v5 compiler (enabled by default) takes `raw` as the source_event of its execution contract, and that contract replaces the whole user turn — so the model's only view of the paste became the label, with the actual content lost. The Desktop path already passes the expanded text as `raw`; only the CLI passed the label. Pass the expanded content (sentLine / msg.display) as `raw` in both the non-refs and @-refs submit paths, matching Desktop. `raw` still excludes resolved @-reference payloads (per the existing TestRunCompilesMemorySourceFromUnexpandedContext intent) — it now carries the expanded paste block but not inline file contents. Add TestPasteFoldExpandOnSubmit, which asserts the memory-compiler source_event holds the expanded paste (it fails before the fix: source_event is only "[Pasted text esengine#1 · 11 lines]"). Co-Authored-By: Claude <noreply@anthropic.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.
Summary
A folded multi-line paste ([Pasted text #N · M lines]) was never seen by the model — only the placeholder label was. The CLI passed the folded label (the un-expanded
line) as the controller'srawvalue. The Memory v5 compiler (enabled by default) takesrawas the source_event of its execution contract, and that contract replaces the whole user turn — so the model's only view of the paste became the label, with the actual content lost.Verification
Copy multi-line text and paste into the input erea, then ask the agent how many lines it can see. If it can't see any pasted text, the bug exists.
Cache impact
Cache-impact: TODO
Cache-guard: TODO
System-prompt-review: N/A
For cache-sensitive changes, fill these lines before requesting review:
Cache-impact:none,low,medium, orhigh, plus the reason.Cache-guard: the focused guard test/command added or run, or why an existing guard covers the change.System-prompt-review: required reviewer/approval note when provider-visible system prompt, memory prefix, output style, or skill index behavior changes.