Repository navigation
fix(cli): print user and server text as-is instead of as Rich markup - #2520
Merged
Pangjiping merged 1 commit intoNov 2, 2026
Merged
Conversation
OutputFormatter interpolated messages, panel lines, success-panel values, spinner text, panel content and table cells into Rich markup. Text that looks like a tag was swallowed or broke rendering: `osb file write '/tmp/notes[draft].txt'` printed `Written: /tmp/notes.txt`, an error about `/data/[old]/x` lost the `[old]`, and a `[/]` in a path raised MarkupError after the command had already succeeded. Escape that text in the formatter, and render panel content and table cells as Text. handle_errors passed its own `[dim]` markup to error_panel, which no-color output printed literally; it now passes plain text.
acodercat
requested review from
Pangjiping,
hittyt,
jwx0925 and
ninan-nn
as code owners
October 31, 2026 08:46
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
OutputFormatterbuilds Rich markup strings around the text it prints:f" [bold {style}]{icon} {msg}[/]"for messages, and the same for error-panel lines, success-panel values and spinner text. Panel content and plain table cells are passed asstr, which Rich also parses as markup. So any path, file name, log line or server error that contains something like a tag is rendered wrong.On current main:
osb file write sb1 '/tmp/notes[draft].txt' -c xwrites the file and then printsWritten: /tmp/notes.txt. Thefile rmtable drops[draft]the same way.[/]in the path, the file is written, then printing raisesMarkupErrorand the command exits 1, so a successful write is reported as a failure.file not found: /data/[old]/x.txtis shown as/data//x.txt.osb command logsoutput with brackets is mangled inside its panel.There is one more, related problem.
handle_errorspasses its own[dim]Type: ...[/]markup toerror_panel, and with--no-colorthat markup is printed literally:ERROR [RuntimeError]: boom [dim]Type: RuntimeError[/].Summary
OutputFormattertreats every text it is given as plain text:rich.markup.escapebefore they go into the formatter's own styling.Text. Status, ID and dim cells already were.handle_errorspasses plain text (<message>\n\nType: <qualname>) instead of markup. The type line loses its dim style, but it now shows correctly with and without color.Testing
Not run (explain why)
Unit tests
Integration tests
e2e / manual verification
New
TestTextIsNotMarkupintests/test_output.py: messages, error panel, success panel, panel and table cells must print/tmp/notes[draft]/a[/]bunchanged. All five tests fail on current main.New
TestHandleErrorsintests/test_utils.py, with and without color: an unexpected error must print its message unchanged and no[dim]. Both cases fail on current main.The full CLI suite passes (337 passed).
ruffis clean, andpyrightreports no new errors in the changed files.Breaking Changes
Checklist