Repository navigation
fix(anthropic): surface Opus 5.5 progress as signed commentary - #7143
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. Comment |
|
✅ Deterministic PR hygiene checks passed. |
# Conflicts: # structure/INDEX.md # structure/transports/byte-accounting.md
|
Maintainer integration into
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3b480cbbc2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| | { type: "text_delta"; text: string; phase?: OcxMessagePhase; | ||
| /** Complete documented Anthropic progress block: text remains signed thinking on replay. */ | ||
| anthropicThinkingSignature?: string } |
There was a problem hiding this comment.
Handle signed progress in the direct Messages encoder
When protocols.rollout.directEncoders is enabled for a Claude Messages request routed to Anthropic, this new event reaches src/protocols/encoders/adapter-events.ts, whose text_delta branch ignores anthropicThinkingSignature and calls writer.text. The client therefore receives a normal text block instead of the signed thinking block produced by the legacy src/claude/outbound.ts path, so a following tool-result request cannot replay the original block unchanged and may be rejected by Anthropic. Teach the direct Messages encoder to restore the signed thinking block and suppress the presentation-only text copy.
AGENTS.md reference: src/AGENTS.md:L19-L19
Useful? React with 👍 / 👎.
| if (thinking && signature) { | ||
| yield { type: "text_delta", text: thinking, phase: "commentary", anthropicThinkingSignature: signature }; |
There was a problem hiding this comment.
Keep progress commentary out of empty-completion content checks
If Opus emits a signed progress update and then incorrectly terminates with done before producing a tool call or final answer, this representation makes src/server/responses/empty-completion-guard.ts:isContentEvent treat the update as successful output because it classifies every nonempty text_delta as content. The empty-completion retry/observer is then bypassed and the user receives a successful turn containing only interim commentary, whereas the same reasoning-only failure without display: "updates" is retried or reported. Exclude anthropicThinkingSignature commentary from that content predicate.
AGENTS.md reference: src/AGENTS.md:L19-L19
Useful? React with 👍 / 👎.
lidge-jun#7143 replays signed assistant turns from originalOrder, so replayed pairs must go through appendPreface like every other preface block. Co-Authored-By: Claude Code <noreply@anthropic.com>
lidge-jun#7143 replays signed assistant turns from originalOrder, so replayed pairs must go through appendPreface like every other preface block. Co-Authored-By: Claude Code <noreply@anthropic.com>
lidge-jun#7143 replays signed assistant turns from originalOrder, so replayed pairs must go through appendPreface like every other preface block. Co-Authored-By: Claude Code <noreply@anthropic.com>
lidge-jun#7143 replays signed assistant turns from originalOrder, so replayed pairs must go through appendPreface like every other preface block. Co-Authored-By: Claude Code <noreply@anthropic.com>
…7881) Native Opus 5.5 on api.anthropic.com always forced display "updates" plus the updates beta. An explicit reasoning.summary of "concise" or "detailed" now selects display "summarized" without the beta, and the selected display drives beta and response classification on every request, including adapter reuse. "auto" (the Codex default), "none" and an omitted summary keep the #7143 updates default. Closes #7728 Co-authored-by: JUN <243035832+lidge-jun@users.noreply.github.com>
Summary
Closes #7108.
Claude Opus 5.5 progress updates can arrive as signed
thinkingblocks. Mapping all of them to Responses reasoning hides acknowledgements and steering answers in Codex App.display: "updates"withthinking-display-updates-2026-08-18for Opus 5.5 onapi.anthropic.com(OAuth and API key). Nonempty thinking text then has a supported progress-update meaning. Other models and compatible gateways retain their existing display behavior; signatures remain opaque.summarized;updatesomits reasoning summaries. Updates surface after their signed block completes.Primary sources checked on 2026-10-15: progress updates and display modes, preserving thinking blocks, and the official SDK thinking block schema. The SDK describes signatures as opaque and requires unmodified blocks in original order. The implementation never examines an internal signature marker.
Verification
Independent review round 1 — 2026-10-15
Reviewed #7108 and the complete base-to-head diff in the separate
review-7143worktree. Original reviewed head:40fbaafad50aec25c29f3e35c02fdee06d0c11b2; validated final head:4741e71e8235ee1b768251d7a181124c8ebb174d. The original triage worktree was not edited. PR target remainsdev, and draft status is unchanged.Two verified Medium findings were fixed and pushed normally:
a98a61664: signed progress bypassed JSON compaction filtering and contaminated SSE checkpoint text. Both bridges now exclude these events from compaction output and checkpoint text. SSE and JSON regression cases each failed before this fix and now pass.4741e71e8: intercepted hosted search/image iterations retained signed progress for replay but discarded visible commentary in buffered mode. Validated updates now reach the client before hosted calls; fetch and run-turn search avoid repeating already streamed updates. Three display regressions fail when only this fix is reverted; all 44 tests across the three focused files pass with it.Independent root-cause verification: reverting only the original PR's
src/diff and runningbun test --isolate --parallel=2 tests/adapters/anthropic/anthropic-progress-updates.test.tsproduced 4 pass, 7 fail; source was then restored. The original 379-test focused command passed before review fixes. Synthetic signatures test fidelity, not live Anthropic signature validation. Anthropic's thinking display, progress updates, and preservation contracts were independently checked online. No user configuration or live inference was used.Final-head local validation:
bun run typecheck— passed.bun test tests/test-layout.test.ts tests/test-layout-tooling.test.ts tests/ci-workflows/file-size-ratchet.test.ts tests/lab/core-lab-boundary.test.ts— 61 pass, 0 fail.bun run structure:check,bun run privacy:scan, andgit diff --check— passed. Existing and added tests remain registered; no new test file was added during review.test:changedwere deliberately not run in this review: the user prohibited both on the shared machine. Broad and cross-platform coverage remains with CI.gh pr checks 7143 --repo lidge-jun/opencodexafter pushing the final head: checks queued/pending, none failed. There is no completed required-CI evidence for this head. No remaining confirmed code findings; verdict needs-more until exact-head required CI succeeds. Draft state preserved.bun test --isolate --parallel=2 tests/adapters/anthropic/anthropic-progress-updates.test.ts tests/adapters/anthropic/anthropic-thinking-signature.test.ts tests/adapters/anthropic/anthropic-reasoning.test.ts tests/adapters/anthropic/anthropic-sonnet-5-5-contract.test.ts tests/adapters/anthropic/anthropic-fast-speed.test.ts tests/adapters/anthropic/anthropic-hardening.test.ts tests/adapters/anthropic/anthropic-compatible-stream.test.ts tests/server/terminal-guard.test.ts tests/advisor/advisor-guard.test.ts tests/images/loop-reasoning-replay.test.ts tests/web-search/web-search-run-turn-loop.test.ts tests/web-search/web-search.test.ts tests/responses/responses-compaction.test.ts tests/claude-integration/claude-outbound.test.ts tests/adapters/bridge-reasoning-replay-batch.test.ts tests/adapters/bridge-raw-reasoning-hidden.test.ts tests/adapters/bridge.test.ts tests/responses/reasoning-envelope.test.ts tests/advisor/advisor-core-boundary.test.tsAuthor validation at the original reviewed head
summarized(2 fail, 2 pass). Synthetic signatures verify transport fidelity, not Anthropic attestation validity; no live inference or local user configuration was used.bun run typecheck— passed.bun test --isolate --parallel=2 tests/adapters/anthropic/anthropic-progress-updates.test.ts tests/adapters/anthropic/anthropic-thinking-signature.test.ts tests/adapters/anthropic/anthropic-reasoning.test.ts tests/adapters/anthropic/anthropic-sonnet-5-5-contract.test.ts tests/adapters/anthropic/anthropic-fast-speed.test.ts tests/adapters/anthropic/anthropic-hardening.test.ts tests/adapters/anthropic/anthropic-compatible-stream.test.ts tests/server/terminal-guard.test.ts tests/advisor/advisor-guard.test.ts tests/images/loop-reasoning-replay.test.ts tests/web-search/web-search-run-turn-loop.test.ts tests/web-search/web-search.test.tsbun test tests/test-layout.test.ts tests/test-layout-tooling.test.ts tests/ci-workflows/file-size-ratchet.test.ts tests/lab/core-lab-boundary.test.ts— 61 pass, 0 fail.bun run structure:check— passed.bun run privacy:scan— passed.cd docs-site && bun install --frozen-lockfile && bun run build— passed, 577 pages and 81,203 internal links checked.bun run test:changed— 31,884 pass, 40 skip, 13 fail, 4 errors, 31,937 tests across 1,419 files. This broad run overlapped final replay edits and is not validation of the final head: three replay failures used the superseded reducer/expectation; those exact cases pass in the final 379-test isolated run above. Remaining failures: three live-audio readiness timeouts, one sibling-home CLI timeout, and six service-home/diagnostic authority assertions. No failing broad run is represented as passing.origin/dev(7640a942b35044c974e534b84d5a8049f4a8ae9a), using the repository's isolated temporary-home environment:bun test --isolate --parallel=4 tests/service/service-ownership-state.test.ts tests/service/service-sqlite-home.test.ts tests/service/service.test.ts tests/service/service-claim.test.ts tests/cli/cli-access-audio-live.test.ts tests/cli/sibling-home-client-sync.test.ts— 337 pass, 2 fail, 1 error. It independently reproduced the service SQLite-home alias failure and sibling-home CLI timeout; audio and the other service cases passed in this smaller sample. The test wrapper already identifies these service fixtures as requiring serial fresh-home lanes; changed mode runs them together.40fbaafad50aec25c29f3e35c02fdee06d0c11b2):bun run test:changed --parallel=2 tests/adapters/anthropic tests/bridge tests/responses tests/server/terminal-guard.test.ts tests/advisor tests/images tests/web-search— 6,023 pass, 1 skip, 0 fail, 6,024 tests across 260 files, exit 0 (108.8 seconds). This validates the affected domains under the resource exception. The skipped case exercises the older-runtime HTTP fallback. This result belongs to the original implementation head; validation for subsequent review commits is recorded separately above.bun run testintentionally not run: parallel triage lanes share one 16-core machine, per the resource exception in AGENTS.md and the lane instruction. Broader Ubuntu coverage is left to CI. macOS/Windows workflows were not dispatched.40fbaafad50aec25c29f3e35c02fdee06d0c11b2is queued, with no completed Ubuntu test evidence yet. This PR remains draft. GOAT rejected child-thread watching because the parent owns this PR; the orchestrator must monitor the queued checks and the scoped local run before review readiness.Checklist