fix: implement boot-time patch for Anthropic thinking blocks API signature (#27825)#27965
fix: implement boot-time patch for Anthropic thinking blocks API signature (#27825)#27965ishan8351 wants to merge 2 commits intoopenclaw:mainfrom
Conversation
Greptile SummaryThis PR applies a pnpm patch to bypass Key changes:
The approach is minimal and targeted - only the specific lines causing the issue are modified, and the patch correctly preserves API signature integrity for Anthropic's extended thinking feature. Confidence Score: 4/5
Last reviewed commit: 4c40946 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4c40946441
ℹ️ 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".
4c40946 to
ae2bbea
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ae2bbead6a
ℹ️ 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".
ae2bbea to
05717f9
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 05717f9eb0
ℹ️ 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".
05717f9 to
c51587b
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c51587bf5b
ℹ️ 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".
c51587b to
c5e6a96
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c5e6a961a0
ℹ️ 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".
c5e6a96 to
52d4d21
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 52d4d21f12
ℹ️ 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".
52d4d21 to
23fce86
Compare
|
Regarding upstream @mariozechner/pi-ai Looks like headers are hardcoded to spoof claude-cli. This violates Anthropic's Terms of Service, and could result in permanent OAuth/API bans for users. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3aea5df9be
ℹ️ 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".
…27825) - Add sanitizePayload() with structural traversal - Bypass sanitization for signed thinking blocks - Preserve normal sanitization for other content - Config-driven toggle for flexible deployment - Replace runtime patching with clean code solution Supersedes openclaw#27965
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing due to inactivity. |
Summary
Describe the problem and fix in 2–5 bullets:
Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
List user-visible changes (including defaults/config).
Displays patch applied message on boot when debug mode (OPENCLAW_DEBUG=1) is enabled, and prints a helpful warning if file permissions block the patch.
Security Impact (required)
Repro + Verification
Environment
Steps
1.Enable "Extended Thinking" for a Claude-based assistant.
2.Generate a response that includes a reasoning trace (thinking block).
3.Send a follow-up message to trigger a history replay.
Expected
-The session continues normally as the thinking block is sent back to the API unmodified.
Actual
-The API returns an error or stalls because the thinking block content was mutated by the surrogate sanitizer, breaking the signature.
Human Verification (required)
What you personally verified (not just CI), and how:
Compatibility / Migration
Failure Recovery (if this breaks)
Risks and Mitigations
List only real risks for this PR. Add/remove entries as needed. If none, write
None.-Mitigation: Caught EROFS and EACCES errors in the boot script. It will gracefully skip the patch and log a clear warning rather than crashing the app, leaving the user no worse off than before the PR