Skip to content

chore: merge train 260821 — land #2281 (Claude Code thought-signature replay) - #2328

Merged
lidge-jun merged 7 commits into
devfrom
codex/merge-train-260821
Aug 22, 2026
Merged

chore: merge train 260821 — land #2281 (Claude Code thought-signature replay)#2328
lidge-jun merged 7 commits into
devfrom
codex/merge-train-260821

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Aug 22, 2026

Copy link
Copy Markdown
Owner

Summary

Sixth leg of the merge train: lands #2281 — fix: enable call_id thought-signature replay for Claude Code plus the pre-merge normalization fix.

Review chain:

  • Two independent adversarial reviews (inherited model): both PASS on merged head bc6d6b5
  • Pre-merge blocker resolved by stacked commit bc6d6b5: promptCacheKey normalized via anthropicSessionKeyFromParts before scope assignment (trim + sha256-over-128 parity with the affinity path); overlong-hash and whitespace regression rows shipped — resolves the intake: hygiene-blocked label
  • Security/privacy verified fail-closed: shared Desktop cohort blocked twice; replay cache keys carry full provider/adapter/model/credential identity tuple + serving-identity guard, so no cross-session or cross-account signature leak; stored scope is always the opaque translator hash, never raw user_id

Verification

  • bun test tests/claude-code-thought-signature-scope.test.ts tests/google-signature-history-roundtrip.test.ts — 27/27 pass
  • bun run typecheck / privacy:scan — pass
  • Full suite on lidge at bc6d6b5: 14240 pass / 16 skip / 0 fail across 894 files, exit 0

Checklist

  • Local CI green (full suite executed remotely on lidge at exact head)
  • Branch includes the latest dev commit (train tracks origin/dev)
  • No open Codex/CodeRabbit findings against this head
  • Ready for review

Summary by CodeRabbit

  • Bug Fixes

    • Improved Google response handling for thought signatures in nested response metadata, supporting more reliable tool-call replay and reasoning continuity.
    • Added safer Anthropic session handling for requests with per-session cache keys, including normalization of blank and overly long values.
    • Prevented shared cache cohorts from being used as individual replay sessions.
  • Tests

    • Added regression coverage for Google signature preservation and Anthropic replay-session behavior.

Hsia97 and others added 7 commits August 21, 2026 15:34
Claude Code's Anthropic Messages path never received a reasoning-replay scope because it does not send the Codex parent-thread header. Derive one from the stable per-session prompt_cache_key (metadata.user_id) so Gemini/Antigravity thought signatures are remembered by call_id and survive history replay. Also read nested extra_content.google.thought_signature when parsing Google responses.
Adds regression coverage for the Anthropic Messages reasoning-replay scope and for reading nested extra_content.google.thought_signature from Google response parts.
…picSessionKeyFromParts

Pre-merge blocker (a): the replay-scope assignment stored the raw
prompt_cache_key, diverging from the affinity/session-key path. Normalize via
anthropicSessionKeyFromParts so overlong keys are hashed and trimming matches;
regression rows for the >128-char hash and whitespace-only no-op.
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner August 22, 2026 01:05
@github-actions

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). label Aug 22, 2026
@lidge-jun
lidge-jun merged commit 34b04ad into dev Aug 22, 2026
8 of 9 checks passed
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: fb42c6f2-d82c-49f1-a784-9f38dd648269

📥 Commits

Reviewing files that changed from the base of the PR and between 7d1b2ca and c836ffb.

📒 Files selected for processing (6)
  • devlog/_plan/260821_bug_merge_train/000_triage_matrix.md
  • devlog/_plan/260821_bug_merge_train/065_merge_2281.md
  • src/adapters/google.ts
  • src/server/responses/core.ts
  • tests/claude-code-thought-signature-scope.test.ts
  • tests/google-signature-history-roundtrip.test.ts

📝 Walkthrough

Walkthrough

The change adds nested Google thought-signature handling and derives normalized Anthropic reasoning-replay scopes from eligible prompt cache keys. It adds regression tests and updates merge-train planning and triage records.

Changes

Reasoning replay updates

Layer / File(s) Summary
Google thought-signature extraction
src/adapters/google.ts, tests/google-signature-history-roundtrip.test.ts
Google parsing reads direct and nested thought signatures for streaming and buffered tool calls. The regression test verifies nested signature metadata.
Anthropic replay-scope derivation
src/server/responses/core.ts, tests/claude-code-thought-signature-scope.test.ts
Anthropic requests without parent-thread headers derive replay scope identities from non-shared prompt cache keys. Tests cover shared, missing, oversized, and whitespace-only keys.
Merge-train execution record
devlog/_plan/260821_bug_merge_train/000_triage_matrix.md, devlog/_plan/260821_bug_merge_train/065_merge_2281.md
The plan and triage entry record normalization, validation results, review status, and merged-into-train state.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant AnthropicRequest
  participant handleResponses
  participant anthropicSessionKeyFromParts
  participant OcxParsedRequest
  AnthropicRequest->>handleResponses: Send prompt_cache_key
  handleResponses->>anthropicSessionKeyFromParts: Normalize eligible key
  anthropicSessionKeyFromParts-->>handleResponses: Return normalized key or no key
  handleResponses->>OcxParsedRequest: Set _reasoningReplayScope
Loading

Suggested reviewers: ingwannu, chilung-cgu

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/merge-train-260821

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants