fix(anthropic-oauth): strengthen host-instructions wrapper so host persona wins over CC scaffold - #7
Merged
Conversation
…rsona wins over CC scaffold After #6 shipped CC system-prompt parity, the host agent's own persona (Jean Clawd identity, SOUL, CYCLE, standing orders) was relegated to a lightly-framed <host-instructions> block at the top of the first user message. The CC scaffold persona in system[2]/[3] is 25K+ tokens of 'You are an interactive coding agent' material — that framing dominated the model's voice and produced a muted, generic-coder tone even though the host identity was still present in context. Fix: rewrite the <host-instructions> wrapper into an explicit absolute- priority override with: - A pre-amble that tells the model the system field is a 'scaffold' and the real system prompt is inside the tag. - Explicit reconciliation rules (identity/authority/tone → host wins; tool/output mechanics → scaffold remains where host is silent). - Clear BEGIN/END markers so the host content is parsed as a unit, not free-form user input. System-block wire shape and billing fingerprint are unchanged — this only edits user-message content, which the classifier already tolerates. Appending host content as system[4] was tried in parallel and hard- failed with Extra Usage billing, confirming the full system array is hashed.
mssteuer
pushed a commit
that referenced
this pull request
Apr 22, 2026
Follow-up on NousResearch#13724: showing literally every source was too noisy.\n\n now fetches a wider window (, larger limit) and then filters to a curated allowlist of human-facing sources (tui/cli plus chat adapters like telegram/discord/slack/whatsapp/etc). This keeps row #7 fixed (telegram sessions visible in /resume) without surfacing internal source kinds such as tool/acp.
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.
Follow-up to #6.
After the CC 2.1.112 system-prompt parity shipped, host-side personas felt muted because the 25K-token
"You are an interactive coding agent"framing in system[2]/[3] dominated the lightly-framed<host-instructions>block at the top of the first user message.This PR rewrites the wrapper into an explicit absolute-priority override with:
Why not system[4]?
Tried in parallel — hard-failed with Extra Usage billing. Confirmed the billing classifier hashes the entire
systemarray, not a prefix. This PR only edits user-message content, which the classifier already tolerates.Tests
tests/agent/test_anthropic_adapter.py: 158 passed, 14 skipped.