Skip to content

fix(print): escape markup in echoed stdin prompts#2546

Open
lihailong00 wants to merge 1 commit into
MoonshotAI:mainfrom
lihailong00:codex/issue-1291-rich-stdin
Open

fix(print): escape markup in echoed stdin prompts#2546
lihailong00 wants to merge 1 commit into
MoonshotAI:mainfrom
lihailong00:codex/issue-1291-rich-stdin

Conversation

@lihailong00

@lihailong00 lihailong00 commented Jul 23, 2026

Copy link
Copy Markdown

Summary

  • render stdin prompts literally instead of interpreting user text as Rich markup
  • keep the prompt passed to the model byte-for-byte unchanged
  • cover normal and markup-like stdin input

Reproduction and verification

Before the fix, the issue example containing [/login] deterministically raised rich.errors.MarkupError. After the fix:

  • uv run pytest tests/ui_and_conv/test_print_exit_code.py -q — 25 passed
  • targeted Ruff and Pyright — passed

Closes #1291


Open in Devin Review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invalid Markdown Formatting In Stdin Prompt Crashes Kimi

1 participant