Skip to content

Replay hidden signed thinking metadata - #4307

Merged
kwakayama merged 9 commits into
mainfrom
codex/issue-522-implementation
Aug 29, 2026
Merged

kwakayama merged 9 commits into
mainfrom
codex/issue-522-implementation

Conversation

@veryfront-code-agent

@veryfront-code-agent veryfront-code-agent Bot commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This is a narrow follow-up for https://github.com/veryfront/veryfront-issue-inbox/issues/522.

Anthropic raw assistant metadata now forces exact replay for hidden signed thinking and redacted-thinking blocks. This preserves provider block ordering and signatures without exposing opaque blocks as displayed transcript text.

Scope

  • Detect raw thinking and redacted_thinking blocks while planning Anthropic raw assistant replay.
  • Add a regression for a resumed historical assistant turn whose displayed content is only text but whose raw metadata contains an empty thinking block with a valid signature.

Verification

  • deno task test:file extensions/ext-llm-anthropic/src/anthropic-request-builder.test.ts
  • deno fmt --check extensions/ext-llm-anthropic/src/anthropic-request-builder.ts extensions/ext-llm-anthropic/src/anthropic-request-builder.test.ts

This change is additive to stage 1. It does not enable provider replay checkpoint emission and does not claim API append/load support.

This stage-one follow-up makes Anthropic raw assistant metadata authoritative for historical signed thinking replay. The request builder now marks assistant turns with raw thinking or redacted thinking blocks for exact replay, preserving provider block ordering and signatures without requiring those opaque blocks to appear as displayed transcript text.

Confidence: high
Scope-risk: narrow
Tested: deno task test:file extensions/ext-llm-anthropic/src/anthropic-request-builder.test.ts; deno fmt --check extensions/ext-llm-anthropic/src/anthropic-request-builder.ts extensions/ext-llm-anthropic/src/anthropic-request-builder.test.ts
Not-tested: full repository suite before CI
@github-actions

Copy link
Copy Markdown

📦 Client bundle boundary

Entrypoint Modules Source size Server leaks
src/index.client.ts 288 2231 KiB ✅ 0

A server module in a client graph aborts hydration in the browser. New leaks fail CI; known leaks are tracked in scripts/lint/client-bundle-baseline.json to burn down.

@codecov

codecov Bot commented Aug 29, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.38843% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ext-llm-anthropic/src/anthropic-request-builder.ts 93.38% 4 Missing and 4 partials ⚠️

📢 Thoughts on this report? Let us know!

This stage-one follow-up makes Anthropic raw assistant metadata authoritative for historical signed thinking replay. The request builder now marks assistant turns with raw thinking or redacted thinking blocks for exact replay, preserving provider block ordering and signatures without requiring those opaque blocks to appear as displayed transcript text.

Confidence: high
Scope-risk: narrow
Tested: deno task test:file extensions/ext-llm-anthropic/src/anthropic-request-builder.test.ts; deno fmt --check extensions/ext-llm-anthropic/src/anthropic-request-builder.ts extensions/ext-llm-anthropic/src/anthropic-request-builder.test.ts
Not-tested: full repository suite before CI
@kojiwakayama
kojiwakayama marked this pull request as ready for review August 29, 2026 20:29
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 29, 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 🔄 Running since 2026-08-29T21:47:03.385816Z 6d2f27c New commits
ℹ️ 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.

@greptile-apps

greptile-apps Bot commented Aug 29, 2026 •

Copy link
Copy Markdown

Greptile Summary

This follow-up preserves hidden Anthropic thinking metadata during resumed assistant replay while retaining canonical visible content.

  • Detects signed thinking and redacted_thinking blocks when planning raw assistant replay.
  • Separates exact, thinking-only, and validation-only replay paths.
  • Adds regressions for hidden thinking, pause boundaries, and compacted provider history.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
extensions/ext-llm-anthropic/src/anthropic-request-builder.ts Adds replay planning and reconstruction paths that preserve hidden signed-thinking blocks while emitting canonical assistant content.
extensions/ext-llm-anthropic/src/anthropic-request-builder.test.ts Adds coverage for resumed hidden thinking, pause-turn boundaries, and split compacted provider history.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Historical assistant message] --> B{Raw Anthropic metadata?}
  B -- No --> C[Emit canonical content]
  B -- Yes --> D[Plan replay indices]
  D --> E{Replay mode}
  E -- Exact --> F[Validate and replay raw messages]
  E -- Thinking only --> G[Validate raw history]
  G --> H[Preserve thinking blocks]
  H --> I[Insert canonical visible content]
  E -- Validation only --> J[Validate provider tool state]
  F --> K[Anthropic request messages]
  I --> K
  J --> C
  C --> K
Loading

Reviews (8): Last reviewed commit: "refactor(anthropic): deduplicate thinkin..." | Re-trigger Greptile

@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: e33f38f7de

ℹ️ 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 extensions/ext-llm-anthropic/src/anthropic-request-builder.ts Outdated
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@github-actions

Copy link
Copy Markdown

@codex review

@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: 0d7fa92c23

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread extensions/ext-llm-anthropic/src/anthropic-request-builder.ts Outdated
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@github-actions

Copy link
Copy Markdown

@codex review

@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: a29f15fe1f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread extensions/ext-llm-anthropic/src/anthropic-request-builder.ts Outdated
Comment thread extensions/ext-llm-anthropic/src/anthropic-request-builder.ts Outdated
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@github-actions

Copy link
Copy Markdown

@codex review

@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: 9e4d6f986e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread extensions/ext-llm-anthropic/src/anthropic-request-builder.ts Outdated
@kojiwakayama

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@github-actions

Copy link
Copy Markdown

@codex review

@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: 1898e2f925

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread extensions/ext-llm-anthropic/src/anthropic-request-builder.ts Outdated
Comment thread extensions/ext-llm-anthropic/src/anthropic-request-builder.ts Outdated
@kojiwakayama

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@github-actions

Copy link
Copy Markdown

@codex review

@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: 6fc6a03301

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread extensions/ext-llm-anthropic/src/anthropic-request-builder.ts Outdated
@kojiwakayama

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@github-actions

Copy link
Copy Markdown

@codex review

@kwakayama
kwakayama force-pushed the codex/issue-522-implementation branch from 481e285 to 6d2f27c Compare August 29, 2026 21:46
@github-actions

Copy link
Copy Markdown

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 6d2f27c7df

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@sonarqubecloud

Copy link
Copy Markdown

@kwakayama
kwakayama added this pull request to the merge queue Aug 29, 2026
Merged via the queue into main with commit 1b6f89f Aug 29, 2026
58 checks passed
@kwakayama
kwakayama deleted the codex/issue-522-implementation branch August 29, 2026 22:15
kwakayama pushed a commit that referenced this pull request Aug 29, 2026
Resolves the anthropic-request-builder.test.ts overlap with #4307: both the
branch's checkpoint-shaped byte-exact replay test and main's hidden-thinking
canonical-content tests are kept.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants