Skip to content

fix(httpapi): drop x\b workaround for fixed Claude Code 0.2.70 paste-echo bug#224

Merged
35C4n0r merged 1 commit into
coder:mainfrom
mzihlmann:remove-janky-x-hack
May 25, 2026
Merged

fix(httpapi): drop x\b workaround for fixed Claude Code 0.2.70 paste-echo bug#224
35C4n0r merged 1 commit into
coder:mainfrom
mzihlmann:remove-janky-x-hack

Conversation

@mzihlmann
Copy link
Copy Markdown
Contributor

Fixes #223.

The x\b workaround added in b732081 to mask Claude Code 0.2.70's bracketed-paste echo bug now produces a visible stray x at the end of every prompt with current Claude Code (2.1.x). The original commit message promised removal "a couple of days after the new version is released" — almost a year on, the hack is still here and is now actively breaking input (e.g. slash-command argument parsing receives /cmd argx instead of /cmd arg).

The companion removeDuplicateClaude_0_2_70_Output function from the original commit is already gone from the codebase, so this reverts only the lib/httpapi/claude.go portion.

Verified locally against Claude Code 2.1.143: prompts render cleanly without the trailing x, and slash-command arguments parse correctly.

The `x\b` workaround for the Claude Code 0.2.70 bracketed-paste echo
bug now produces a visible stray `x` at the end of every prompt with
current Claude Code.

reverts: b732081
@matifali matifali requested a review from 35C4n0r May 25, 2026 15:47
@github-actions
Copy link
Copy Markdown

✅ Preview binaries are ready!

To test with modules: agentapi_version = "agentapi_224" or download from: https://github.com/coder/agentapi/releases/tag/agentapi_224

Copy link
Copy Markdown
Collaborator

@35C4n0r 35C4n0r left a comment

Choose a reason for hiding this comment

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

I can't seem to reproduce the bug mentioned in the PR description, but the hack is also no longer needed.
LGTM!

@35C4n0r 35C4n0r changed the title Revert "hack around a bug in claude code 0.2.70" fix(httpapi): drop x\b workaround for fixed Claude Code 0.2.70 paste-echo bug May 25, 2026
@35C4n0r 35C4n0r merged commit 35e8f05 into coder:main May 25, 2026
3 checks passed
@mzihlmann
Copy link
Copy Markdown
Contributor Author

claude was able to handle the stray x as a typo most of the time, but it became obvious when the prompt ended with something that reasonably could contain an x, an image name in my case: alpine:3.23x. When pushed claude said that every prompt had a stray x appended to it.

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.

Stray "x" appears at the end of every prompt (leftover Claude Code 0.2.70 workaround)

2 participants