Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/claude-routed-cache-investigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ The confirmed defect was shared monitoring state: both the watcher and durable a

### Current review status

Exact snapshot v5 (`/Users/vadym/.claude/jobs/8b6d8320/tmp/current-attempt3-v5.diff`, SHA-256 `471e0c5d964cb0a66a72cf18e98fd458e1b06e5a007d8dec15a846fd41750822`) is superseded. Its accounting reviewer withdrew the only proposed finding after tracing the canonical usage contract and confirming that no durable discriminator exists for ambiguous historical `cachedInputTokens` rows. Canonical-first decomposition remains correct; legacy read-plus-write recovery is used only when canonical interpretation is impossible because read plus write exceeds inclusive input.
Exact snapshot v5 (`~/.claude/jobs/8b6d8320/tmp/current-attempt3-v5.diff`, SHA-256 `471e0c5d964cb0a66a72cf18e98fd458e1b06e5a007d8dec15a846fd41750822`) is superseded. Its accounting reviewer withdrew the only proposed finding after tracing the canonical usage contract and confirming that no durable discriminator exists for ambiguous historical `cachedInputTokens` rows. Canonical-first decomposition remains correct; legacy read-plus-write recovery is used only when canonical interpretation is impossible because read plus write exceeds inclusive input.

Its transport review found three blocking defects, now fixed locally:

Expand All @@ -125,7 +125,7 @@ Its transport review found three blocking defects, now fixed locally:

Failing-first regressions proved all three defects: adaptive replay to Opus 4.6 returned 400, a final HTTP 200 root-error SSE was reshaped to 529, and malformed UTF-8 was relayed with HTTP 200. After repair, all three regressions passed; the expanded focused run passed 355 tests with 14,196 assertions and 0 failures. The changed suite and complete repository suite also passed.

Exact snapshot v6 (`/Users/vadym/.claude/jobs/8b6d8320/tmp/current-attempt3-v6.diff`, SHA-256 `beb657c7a65cd8e4d4bca4e9eb97b04fbbf8fb9c9995facb8549dbb1d08f136e`) is also superseded. It was generated twice, byte-compared, and measured 621,316 bytes across 76 cumulative files. Independent review confirmed six further defects:
Exact snapshot v6 (`~/.claude/jobs/8b6d8320/tmp/current-attempt3-v6.diff`, SHA-256 `beb657c7a65cd8e4d4bca4e9eb97b04fbbf8fb9c9995facb8549dbb1d08f136e`) is also superseded. It was generated twice, byte-compared, and measured 621,316 bytes across 76 cumulative files. Independent review confirmed six further defects:

1. Cache alerts recognized only provider names, so a custom-named provider using `adapter: "anthropic"` escaped Anthropic cache policy.
2. Strict canonical SSE inspection validated terminal shape but direct relay still forwarded raw chunks before validation, allowing malformed JSON, non-object JSON, `[DONE]`, or invalid UTF-8 to escape.
Expand Down Expand Up @@ -233,7 +233,7 @@ Current evidence isolates the dominant historical root boundary to old combo too

## Astra v2.43.0 semantic transplant

The complete pre-upgrade tree is recoverable from rescue branch `rescue/pre-astra-v2430-20260906-5dba90e`, commit `8a071b8a01090ac258dc76400d16c31805e101e5`, and annotated tag `rescue/pre-astra-v2430-20260906`. The verified full-history bundle is `/Users/vadym/.opencodex/deploy-artifacts/opencodex-pre-astra-v2430-8a071b8a0.bundle`, 113,239,204 bytes, SHA-256 `5ba8a704ab750e6aa98d5920059710ff8fe3ef20d479fff985360185a193da30`. A disposable restore reproduced rescue tree `272bc3c28c75e820d6bb546646a8b3ea685b9328` and this investigation document before migration began.
The complete pre-upgrade tree is recoverable from rescue branch `rescue/pre-astra-v2430-20260906-5dba90e`, commit `8a071b8a01090ac258dc76400d16c31805e101e5`, and annotated tag `rescue/pre-astra-v2430-20260906`. The verified full-history bundle is `~/.opencodex/deploy-artifacts/opencodex-pre-astra-v2430-8a071b8a0.bundle`, 113,239,204 bytes, SHA-256 `5ba8a704ab750e6aa98d5920059710ff8fe3ef20d479fff985360185a193da30`. A disposable restore reproduced rescue tree `272bc3c28c75e820d6bb546646a8b3ea685b9328` and this investigation document before migration began.

Migration branch `upgrade/astra-v2.43.0` starts directly from official annotated tag `v2.43.0`, peeled commit `06ec553630fa2ee51a96b5cbf694089021249194`, package `@bitkyc08/opencodex@2.43.0`. Local behavior is being transplanted semantically rather than by merging or broadly cherry-picking the rescue branch. Rejected reconstruction commits `8fa37f3cf`, `a9fc4f49d`, `08973660f`, `3d9f5dca9`, and `b98731f66` are not replayed. Upstream remains authoritative for Astra model catalog and generated provider data, model discovery, context limits, reasoning support, prices, package metadata, and lockfiles.

Expand Down Expand Up @@ -271,7 +271,7 @@ The transplant also preserves strict canonical Anthropic source replay, exact co
- 2026-09-01: All six v6 findings received failing-first regressions: six backend tests and one GUI contract failed before repair. Shared v7 fixes pass the repaired seven-file focused run with 267 tests, 13,667 assertions, and 0 failures.
- 2026-09-01: Final v7 offline gates passed: `git diff --check`, pinned-Bun typecheck, privacy scan, Oxlint, React Doctor against audited baseline `870a2adb6eaccc9da9ea9832a596e1b2650ab1ea`, 1,118 GUI tests with 10,122 assertions, and GUI production build. The changed suite passed 13,709 tests, skipped 9, and failed 0 across 770 files. The first complete suite hit one unrelated parallel macOS/Bun `SQLITE_IOERR_VNODE` in `server-images.test.ts`; its isolated 63-test rerun passed, then the clean complete rerun passed 16,585 tests, skipped 12, and failed 0 across the 994-file parallel lane and all six serial lanes. Stable v7 snapshot and two clean same-hash reviews remain required. Fresh 24-send real comparison remains unused and blocked on those reviews. No gateway, live inference, Mini change, `claude-wa` change, commit, push, PR, or merge occurred.
- 2026-09-02: Exact v7 snapshot was generated twice and byte-stable at SHA-256 `b55d9ae73878ea5098effd4bac16ce44e0001b9b5ce28e9484d4e84ef1ea2975`. Its transport review reported twelve candidate defects, so the hash is superseded pending independent verification and repair. Adapter-owned web-search and image retries were confirmed to pace under the previous response-header deadline: both failing-first regressions returned 504 instead of dispatching the retry. The shared sibling fix now clears that timer before deliberate pacing, starts a fresh response-header deadline afterward, and replaces the adapter's stale signal for the retry fetch. The repaired two-file suite passes 94 tests with 313 assertions and 0 failures.
- 2026-09-02: Native Responses key-pool and generic OAuth failover, rotated-account 401 ownership, terminal continuation OAuth rotation, and sidecar recovery labeling were all confirmed by failing-first regressions. Preserved outputs are `/Users/vadym/.claude/jobs/8b6d8320/tmp/v8-native-key-pool-failing-first.output`, `/Users/vadym/.claude/jobs/8b6d8320/tmp/v8-oauth-native-failing-first.output`, `/Users/vadym/.claude/jobs/8b6d8320/tmp/v8-oauth-terminal-failing-first.output`, and `/Users/vadym/.claude/jobs/8b6d8320/tmp/v8-oauth-sidecar-failing-first.output`.
- 2026-09-02: Native Responses key-pool and generic OAuth failover, rotated-account 401 ownership, terminal continuation OAuth rotation, and sidecar recovery labeling were all confirmed by failing-first regressions. Preserved outputs are `~/.claude/jobs/8b6d8320/tmp/v8-native-key-pool-failing-first.output`, `~/.claude/jobs/8b6d8320/tmp/v8-oauth-native-failing-first.output`, `~/.claude/jobs/8b6d8320/tmp/v8-oauth-terminal-failing-first.output`, and `~/.claude/jobs/8b6d8320/tmp/v8-oauth-sidecar-failing-first.output`.
- 2026-09-02: Remaining confirmed v7 defects received shared root fixes for malformed Anthropic JSON success envelopes, typed pacing overload propagation, bounded strict SSE frame inspection, raw incomplete-frame body accounting, and geometric nonstream buffering. The compression-header proposal remained rejected because the physical header sanitizer already removes stale entity/transport headers.
- 2026-09-02: Post-repair focused transport/OAuth group passed 402 tests with 14,249 assertions and 0 failures across 13 files. The generic OAuth suite, kept separate because it installs a process-global module mock, passed 25 tests with 74 assertions and 0 failures. Final repository gates, a new byte-stable exact snapshot, and two clean same-hash reviews remain required. No gateway, inference, Mini process, `claude-wa`, commit, push, PR, merge, or deployment was touched.
- 2026-09-02: Fresh read-only host audits found both gateways stopped and no new routing traffic. The latest laptop strict controls remain healthy at 99.96% and 99.91% cache-read share with one send and no recovery; native controls remain `anthropic-native` with zero translated attempts. Mini has no newer evidence than its August 30 pre-fix AgentRadar sample, which remains a confirmed historical regression at 25.00% warmed cache-read share, all 179 post-warm calls above 100,000 raw input tokens, 12 large writes, and 6 extra sends. No current Mini quota consumer was active; two laptop agents showed no new OpenCodex ledger activity.
Expand Down
Loading
Loading