Skip to content

fix(anthropic-oauth): strengthen host-instructions wrapper so host persona wins over CC scaffold - #7

Merged
mssteuer merged 1 commit into
mainfrom
fix/oauth-harder-host-instructions-wrapper
Apr 17, 2026
Merged

fix(anthropic-oauth): strengthen host-instructions wrapper so host persona wins over CC scaffold#7
mssteuer merged 1 commit into
mainfrom
fix/oauth-harder-host-instructions-wrapper

Conversation

@mssteuer

Copy link
Copy Markdown
Owner

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:

  • 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 host content is parsed as a unit.

Why not system[4]?

Tried in parallel — hard-failed with Extra Usage billing. Confirmed the billing classifier hashes the entire system array, 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.

…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
mssteuer merged this pull request into main Apr 17, 2026
3 of 5 checks passed
@mssteuer
mssteuer deleted the fix/oauth-harder-host-instructions-wrapper branch April 17, 2026 06:22
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.
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.

1 participant