Skip to content

fix(anthropic): surface Opus 5.5 progress as signed commentary - #7143

Merged
lidge-jun merged 4 commits into
devfrom
fix/7108-anthropic-narration
Oct 15, 2026
Merged

lidge-jun merged 4 commits into
devfrom
fix/7108-anthropic-narration

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

Summary

Closes #7108.

Claude Opus 5.5 progress updates can arrive as signed thinking blocks. Mapping all of them to Responses reasoning hides acknowledgements and steering answers in Codex App.

  • Request Anthropic's documented display: "updates" with thinking-display-updates-2026-08-18 for Opus 5.5 on api.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.
  • Emit visible assistant commentary alongside an empty-summary replay carrier. Preserve original thinking text, signatures, empty/redacted blocks and source order, including blocks between tool calls. Remove only the adjacent exact commentary copy on replay, including clients that omit message IDs. Preserve signed progress in internal search/image/advisor and guarded continuations too.
  • Document the display tradeoff and replay contract. Anthropic explicitly says progress updates and reasoning are indistinguishable under summarized; updates omits 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-7143 worktree. Original reviewed head: 40fbaafad50aec25c29f3e35c02fdee06d0c11b2; validated final head: 4741e71e8235ee1b768251d7a181124c8ebb174d. The original triage worktree was not edited. PR target remains dev, 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 running bun test --isolate --parallel=2 tests/adapters/anthropic/anthropic-progress-updates.test.ts produced 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.
  • Focused command below — 690 pass, 0 fail, 19 files.
  • 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, and git diff --check — passed. Existing and added tests remain registered; no new test file was added during review.
  • Reviewed the existing docs-site update and translated provider pages for contradictions; review fixes update the owning structure contract. No docs-site files were changed during this round; the author's docs build evidence below is unchanged.
  • Full suite and test:changed were 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/opencodex after 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.ts

Author validation at the original reviewed head

  • Regression demonstrated before implementation: the new SSE/JSON cases failed because the adapter requested 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.
  • Focused regression and compatibility command below — 379 pass, 0 fail across 12 files.
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
  • 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 — 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.
  • Baseline diagnostic at untouched 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.
  • Original implementation-head scoped changed-graph validation (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.
  • Full bun run test intentionally 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.
  • Exact-head CI for 40fbaafad50aec25c29f3e35c02fdee06d0c11b2 is 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

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults. Existing auth placement is unchanged, OAuth beta merging is covered, and the new display beta is limited to Anthropic's own endpoint.

@coderabbitai

coderabbitai Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Oct 15, 2026
# Conflicts:
#	structure/INDEX.md
#	structure/transports/byte-accounting.md
@lidge-jun

Copy link
Copy Markdown
Owner Author

Maintainer integration into dev (MAINTAINERS.md dev maintainer-integration policy; batch integration authorized by @lidge-jun on 2026-10-15).

  • Head: 3b480cbbc2c567801841546a5b653c7a3351eecd (tree eb5452d83ef90c4685000bb1ff067d96e246a5cf) = this branch merged with origin/dev 9d4c82a17e.
  • Exact-head evidence: GitHub-hosted Actions for this account have not been assigning runners since 2026-10-15 13:30 UTC, so by owner decision the evidence is a full bun run test (Bun 1.4.3 test runner, root and GUI dependencies installed, GUI built) of this exact tree on a maintainer host (macOS arm64): exit 1, 9 min, 4 failing test(s), each also failing in the same host's baseline run of dev 60bf4c7 (environment-only): a secondary ensure parent preserves shared Grok, Codex and Claude agent bytes, connected Desktop uses hub IDs across a cold restart (stored profile=false), live audio readiness and bounded closure > native open and non-readiness events cannot cla, update stops the running proxy before replacing files > npm launcher restarts the stopped .
  • Local gates on the same tree: bun run typecheck, file-size ratchet, test-layout and structure:check.
  • Hosted CI checks for this head may still be queued; they are not claimed as evidence.

@lidge-jun
lidge-jun marked this pull request as ready for review October 15, 2026 18:25
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner October 15, 2026 18:25
@lidge-jun
lidge-jun merged commit 2cd4029 into dev Oct 15, 2026
3 of 4 checks passed
@lidge-jun
lidge-jun deleted the fix/7108-anthropic-narration branch October 15, 2026 18:25
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T18:29:10.680307Z 3b480cb Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/types/request.ts
Comment on lines +404 to +406
| { type: "text_delta"; text: string; phase?: OcxMessagePhase;
/** Complete documented Anthropic progress block: text remains signed thinking on replay. */
anthropicThinkingSignature?: string }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +24 to +25
if (thinking && signature) {
yield { type: "text_delta", text: thinking, phase: "commentary", anthropicThinkingSignature: signature };

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

vadymhimself added a commit to vadymhimself/opencodex that referenced this pull request Oct 15, 2026
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>
vadymhimself added a commit to vadymhimself/opencodex that referenced this pull request Oct 15, 2026
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>
vadymhimself added a commit to vadymhimself/opencodex that referenced this pull request Oct 16, 2026
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>
vadymhimself added a commit to vadymhimself/opencodex that referenced this pull request Oct 16, 2026
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 added a commit that referenced this pull request Oct 29, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant