SIGN IN SIGN UP

fix(fingerprint): align Haiku betas, identity string, and cache TTL with CC 2.1.112

Live capture on 2026-04-17 against Proxyman (CC 2.1.112, Haiku 4.5, minimal-hi
scenario) surfaced three plugin regressions that extraction-only analysis
missed. All three are evidence-driven from the same capture; fixed together
to keep Phase 1 captures diff-clean.

GAP 1+2: src/betas.ts was hiding claude-code-20250219 and advisor-tool-2026-03-01
behind `!haiku` guards that date from pre-Haiku-4.5 model assumptions. Real CC
2.1.112 sends both on Haiku 4.5 (verified in HAR export: both betas present in
anthropic-beta header on Haiku captures). advanced-tool-use-2025-11-20 stays
Haiku-excluded because it was NOT observed on Haiku in this capture.

GAP 3a: CLAUDE_CODE_IDENTITY_STRING was "You are Claude Code, Anthropic's
official CLI for Claude." — the legacy identity. Real CC 2.1.112 now emits
"You are a Claude agent, built on Anthropic's Claude Agent SDK." at system[1].
The old string moves into KNOWN_IDENTITY_STRINGS so legacy OpenCode configs
that still include it are detected and replaced (not duplicated).

GAP 3c: Identity block cache_control was { type: "ephemeral" }. Capture shows
CC 2.1.112 emits { type: "ephemeral", ttl: "1h" } — the extended-cache-ttl
pattern. Updated to match.

Tests:
- New: tests/unit/betas-haiku.test.ts (4 tests, TDD red\u2192green)
- New: tests/unit/system-prompt/builder-cc-parity.test.ts (6 tests, TDD red\u2192green)
- Updated: 7 existing tests whose assertions encoded the old (incorrect) behavior

Verification:
- 1326/1326 tests pass
- Typecheck clean
- Lint clean (0 warnings, 0 errors)
- Re-ran minimal-hi live capture; anthropic-beta + identity + cache_control
  now byte-match OG CC 2.1.112 (remaining UA mismatch is transient version
  skew from Anthropic releasing v2.1.113 mid-session, not a plugin bug).

Evidence:
- .sisyphus/evidence/phase-1-claim-validation/2026-04-17/SANITY-CHECK-FINDINGS.md
- Pre-fix capture:  .sisyphus/evidence/phase-1-claim-validation/2026-04-17/proxyman-minimal-hi/
- Post-fix capture: .sisyphus/evidence/phase-1-claim-validation/2026-04-17/proxyman-minimal-hi-after-fix/

Not fixed in this commit (deferred to Phase 3):
- GAP 3b: OG sends CC's 26KB runtime system prompt at system[2]. Plugin
  doesn't. Emulating would require overriding OpenCode's system prompt,
  which is an architectural decision not a one-line fix.
- GAPS 5+6: header name casing and order. LOW severity, cosmetic.
V
Vacbo committed
f9fe1430ee7231bb7ebc8853d4be34e352342a72
Parent: 4fe1aab