Generate input echoes from sideband events#138
Draft
t-kalinowski wants to merge 5 commits into
Draft
Conversation
Remove output-based echo suppression and render input echoes only from consumed-input sideband events. Preserve captured output bytes even when they look like prompts or echoed input.
Skip generated input echoes when they would lead a reply, and merge adjacent generated echoes when they are retained after real output for attribution.
Review finding: - [P1] Normalize the Python help banner instead of snapshotting it — /Users/tomasz/.codex/worktrees/183c/mcp-repl/tests/snapshots/python_help_snapshots__python_help_contract@transcript.snap:22-22 | With this literal banner in the snapshot, `cargo test --test python_help_snapshots` fails on Python versions whose pydoc banner says `enter "q" or "quit"` (e.g. Python 3.12.13) instead of including `exit`. The previous `<PYTHON HELP BANNER>` placeholder avoided this version-specific text, so the normalizer/snapshot should keep collapsing the banner even with the new `<<< >>>` prefix. Response: - Updated the Python help snapshot normalizer to recognize transcript help banners that start with `<<< >>> Welcome...`. - Added a regression test for the short `enter "q" or "quit"` banner form. - Updated the transcript snapshot to use `<PYTHON HELP BANNER>` again.
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
This PR removes output-inspection echo handling and makes consumed-input sideband events the only source of generated input echo text. The point is to stop treating prompt-shaped stdout/stderr as something to infer or suppress, while still preserving transcript context in overflow surfaces that need it.
Normal MCP replies now hide generated input echoes. Files-mode bundle transcripts and pager overflow pages keep generated echoes from the resolved timeline, so transcript-style surfaces still show consumed input without inspecting captured output.
User-facing changes
replreplies no longer include generated input echoes; prompt-shaped stdout/stderr is preserved only when it was real output.transcript.txt, even when the inline MCP preview omits them.Internal changes
src/resolved_output.rsas the shared renderer for raw bytes, sideband events, text spans, images, and generated input echoes.ContentVisibilityso generated echoes can be transcript-only without being serialized into normal MCP replies.Notes
input()andreadline()normal-reply echo presentation remains follow-up scope; overflow transcript surfaces preserve generated input echo.Diff composition
Measured against
main, this PR is1505insertions and4114deletions across66files.src/:+901/-2774(65.4%of churn)src/:+191/-1121(23.3%of churn)tests/:+252/-144(7.0%of churn)+49/-53(1.8%of churn)+112/-22(2.4%of churn)Largest files:
src/output_timeline.rs:+0/-1262src/reply_presentation.rs:+26/-637src/pending_output_tape.rs:+131/-509src/resolved_output.rs:+455/-0src/server/tests.rs:+0/-343