fix(server): countermand Claude's native userEmail section - #130
Merged
tusharbhardwaj-bk merged 1 commit intoAug 21, 2026
Merged
Conversation
The appended T3 identity block named the right sender, but Claude Code's own `# userEmail` context section still arrived per-turn with the shared, rotating subscription account's address and won — two contradictory identity claims coexisted and the model followed the later one, so a live session answered "who am I" with the rotated account holder. The CLI has no switch to suppress that section, so both branches of the appended block now name it explicitly and tell the model to ignore it for user attribution. No adapter wiring changed. TEC-1048 Model: claude-opus-5. Harness: T3 Code (Claude Code).
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: unavailable · PR result: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
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.
Closes TEC-1048
Problem
The earlier userEmail fix appends a "T3 Code session identity" block to Claude's system prompt with the resolved T3 message sender. That deployed and works, but it is not enough on its own.
Claude Code's CLI still generates its own
# userEmailcontext section per turn, from the active rotated profile'soauthAccount.emailAddress. On 2026-08-21 a live bkt3-dev session asked "who am I" and got the rotated account holder's name, even though the appended block correctly carriedtushar.bhardwaj@beknown.work.Root cause: two contradictory identity claims coexist. Our block never named the native section as the thing to disregard, and the native one arrives later in context. There is no CLI switch to suppress it (v2.1.238 emits it unconditionally outside the unix-socket path), and its value flaps with profile rotation.
Fix
Both branches of
claudeSessionIdentitySystemPrompt— resolved sender and unknown sender — now name the native section explicitly and countermand it:Contained to the fork-owned identity module, its test, and the customizations doc. No
ClaudeAdapter.tswiring changed.Verification
vp test run apps/server/src/provider/claudeSessionIdentity.expbkt3.test.ts— 3 passed. Both branches now assert the exact block including the countermand line.vp linton both changed TS files — clean.node scripts/check-fork-markers.ts— passed.Scoped runs only, per the dev-server compute policy; CI owns the full suite.
Model: claude-opus-5. Harness: T3 Code (Claude Code).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.