You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every message sent through agentapi to Claude Code produces a visible stray x character in the prompt area. The x comes from a workaround introduced in b732081 almost a year ago, which the commit itself promised to remove "a couple of days after the new version is released."
Source of the bug
lib/httpapi/claude.go, in formatClaudeCodeMessage:
// janky hack: send a random character and then a backspace because otherwise// Claude Code echoes the startSeq back to the terminal.// This basically simulates a user typing and then removing the character.parts=append(parts, st.MessagePartText{Content: \"x\b\", Hidden: true})
The hack was a workaround for a bug in Claude Code 0.2.70 (anthropics/claude-code#803). With current Claude Code versions, the bracketed-paste start sequence is no longer echoed, so the masking x is rendered straight into the prompt area and the \b has nothing to erase — net result is a visible x on every message.
Possibly related to Claude Code 2.1.83 breaks terminal capture #207 ("Claude Code 2.1.83 breaks terminal capture") — both look like consequences of Claude Code's rendering pipeline no longer behaving the way the 0.2.70-era workarounds assumed.
Proposed fix
Remove the parts = append(parts, st.MessagePartText{Content: \"x\b\", Hidden: true}) line. The original Claude Code bug it worked around is long fixed.
Summary
Every message sent through agentapi to Claude Code produces a visible stray
xcharacter in the prompt area. Thexcomes from a workaround introduced in b732081 almost a year ago, which the commit itself promised to remove "a couple of days after the new version is released."Source of the bug
lib/httpapi/claude.go, informatClaudeCodeMessage:The hack was a workaround for a bug in Claude Code 0.2.70 (anthropics/claude-code#803). With current Claude Code versions, the bracketed-paste start sequence is no longer echoed, so the masking
xis rendered straight into the prompt area and the\bhas nothing to erase — net result is a visiblexon every message.Environment
Notes
formatPaste; thex\bline was left in place.Proposed fix
Remove the
parts = append(parts, st.MessagePartText{Content: \"x\b\", Hidden: true})line. The original Claude Code bug it worked around is long fixed.