Skip to content

fix(mcp): escape unsafe characters in error in error output - #101

Merged
oritwoen merged 1 commit into
mainfrom
fix/mcp-error-control-characters
Sep 12, 2026
Merged

fix(mcp): escape unsafe characters in error in error output#101
oritwoen merged 1 commit into
mainfrom
fix/mcp-error-control-characters

Conversation

@aeitwoen

Copy link
Copy Markdown
Contributor

errorResult passed newlines, terminal controls, and bidirectional formatting from provider errors or unknown tool names straight into the model's reply. That lets a failed call forge extra lines that look trusted, a nasty boundary to leave open; unsafe code points are now rendered as visible Unicode escapes instead.

@aeitwoen aeitwoen self-assigned this Sep 12, 2026
@coldtea-pr-lens

coldtea-pr-lens Bot commented Sep 12, 2026

Copy link
Copy Markdown

◈ PR Lens

🟢 +0 new · 🟠 ~1 changed · 🔴 -0 removed · 1 flow · 1 file · commit 56addb3


Architecture

Architecture diagram for agntn/forges at 56addb3

1 component touched across 2 lanes.

Open the interactive canvas


Data flow

Data flow diagram for agntn/forges at 56addb3

Escaping unsafe characters in MCP errors

Open the interactive canvas


View

  • Architecture lens
  • Data flow lens
  • Expand every detail

Tip

Add .github/workflows/pr-lens.yml with coldteadotai/pr-lens/packages/action@v0 and your model provider's key as its api-key to run PR Lens from your own CI. Any /chat/completions endpoint works.

🪧 More tips
  • Run npx skills add coldteadotai/pr-lens, then tell your coding agent: "Diagram the change you just made with PR Lens and attach it to the pull request."
  • Run npx @coldtea/pr-lens-cli analyze --base origin/main on a branch, then npx @coldtea/pr-lens-cli render .pr-lens/graph.json. Same lenses, your own model key, before the pull request exists.
  • Untick Architecture lens or Data flow lens under View to hide a diagram, or tick Expand every detail to open every section. The comment redraws in a few seconds.
  • Click the link under each diagram to open it on a canvas you can zoom, pan and step through.
  • The diagrams are links. Click one to open it on the canvas, then press W or click play to walk through the change.
  • Open a diagram on the canvas, then press W or click play to walk through the change one step at a time.
  • The CLI's render reads .github/pr-lens.yml and applies your renames, exclusions and lane pins at draw time.
  • Set github.comment.collapsed: true in .github/pr-lens.yml to fold the comment behind one View architecture and data flow row. Drawing still runs on every push.
  • Push a commit and the comment redraws for the new head. A slow older run never overwrites a newer one.
  • Switch GitHub to dark mode and the diagrams follow. The moving dots are this pull request's data in motion.

Thanks for using PR Lens! It's built by Coldtea, free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

@aeitwoen aeitwoen changed the title Stop MCP errors from forging extra output lines fix(mcp): escape unsafe characters in error in error output Sep 12, 2026
@oritwoen
oritwoen merged commit ab42136 into main Sep 12, 2026
2 checks passed
@oritwoen
oritwoen deleted the fix/mcp-error-control-characters branch September 12, 2026 10:16
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.

2 participants