Repository navigation
fix(identity-neutralize): rewrite the claude code subagent emoji bullet — a8 - #281
Merged
Merged
Conversation
…et — a8 Every Claude Code subagent (Agent tool: general-purpose, Explore, ...) is rejected with permission_denied / 400 "blocked by our content policy" while the main session on the same proxy serves fine. - src/handlers/identity-neutralize.js: add (a8) a8-cc-subagent-emoji, which rewrites "For clear communication with the user the assistant MUST avoid using emojis." to the same sentence with "should". Bisected live via /v1/messages replay of a captured subagent request (Claude Code 2.1.310): the sentence alone as the whole system prompt blocks; near-miss variants pass; the full blocked request with only MUST -> should passed 3/3. Unconditional on the main WINDSURFAPI_NEUTRALIZE_CLIENT_ID switch, not in the default-off (cc) block, because a gated rule leaves every default deployment's subagents failing. - test/client-identity-neutralize.test.js: pin the rewrite on the subagent Notes block, idempotence, the live-passing near-miss variants as untouched, and the off-switch. Reverting the rule turns the rewrite test red.
dwgx
added a commit
that referenced
this pull request
Oct 24, 2026
Owner
|
已合并( 我们独立复核了你没跑到的部分,结论一致:
两个我们合完后补的瑕疵,不是否决理由,但值得记一下:
一个流程建议:PR 模板里"mutation 未运行"这一栏,附上受影响的 再次谢谢,这个修复对每个用 Claude Code 子代理的人都是实打实的。 |
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.
改了什么 / What changed
New rule
(a8) a8-cc-subagent-emojiinsrc/handlers/identity-neutralize.js. It rewrites one sentence that every Claude Code subagent system prompt carries:to the same sentence with should.
Before: every Claude Code subagent (Agent tool:
general-purpose,Explore, ...) fails withpermission_denied/ 400Your request was blocked by our content policy, while the main session on the same proxy works. After: subagents work.为什么 / Why
Main session and subagents share the same CLAUDE.md, memory and tool list, so those were ruled out early. The difference is the subagent's built-in system prompt block. Bisected with
DEVIN_CONNECT_WIRE_DUMP=1, decoding the captured request and replaying variants through/v1/messages. Each variant ran 2x and gave the same result both times:For clear communication with the user the assistant MUST avoid using emojis.The assistant MUST avoid using emojis.Avoid using emojis.For clear communication with the user, avoid using emojis.For clear communication with the user the assistant should avoid using emojis.The trigger is the whole sentence, not one word. Rewriting MUST -> should keeps the instruction intact.
Verified myself: the table above, plus a real subagent dispatch through the patched proxy completing normally (Claude Code 2.1.310, model
claude-opus-5-5, DEVIN_CONNECT, single account). Not verified: other Claude Code versions, other models, and how stable this is over time given that Devin's content policy has been observed to be non-deterministic. Every row above reproduced on repetition within one session.Placement: unconditional on the main
WINDSURFAPI_NEUTRALIZE_CLIENT_IDswitch, like a1-a7. I did not put it in the(cc)block becauseccActiveis off by default, so a gated rule would leave default deployments' subagents failing. The regex is anchored on the full sentence (optional comma afteruser), so it should not hit unrelated content. The(cc)block comments now list a8 next to a1-a4.测试 / Testing
Node v26.12.0 (not the 24.x release-gate toolchain).
Revert check: with the
a8rule removed,(a8) rewrites the Claude Code subagent emoji bullet...goes red (pass 41 / fail 1). The idempotence, near-miss and off-switch tests are expected to stay green without the rule, since they assert the absence of over-matching.Not green, and I am not reporting it as green. Every failing file was checked on a clean worktree at
origin/masterb00b3b9(same machine, same Node):b00b3b9So 9 failures reproduce on master, and the other two were flaky under full-suite load (they pass 3/3 in isolation on this branch). Neither touches the neutralizer. These are probably environment-related (Node 26 rather than 24); I have not dug into them.
Mutations:
npm run mutatecould not set up its workspace from my shallow fetch (Failed to traverse parents of commit ...), so the mutation sweep was not run. As a substitute I checked that all 25 anchors in mutation specs targetingidentity-neutralize.jsstill match exactly once on this branch. That is not equivalent to running the sweep.Checklist