WARE-88: fix(signature): strip foreign Claude compat blobs - #227
Open
warelik wants to merge 2 commits into
Open
Conversation
PreserveEmptyThinkingBlocks forwarded opaque signatures as Claude. Compat now asks DecideSignatureCompatibilityForModel; client _cliproxy_replay_provenance is stripped first. gemini-cli keeps thoughtSignature without rerouting visible text into thinking.
3 tasks
Compat restore keeps omitted thinking blocks. Cache-born EgI= is not a Claude envelope; sanitizer must empty it, not forward it.
warelik
added a commit
to warelik/CLIProxyAPIPlus
that referenced
this pull request
Aug 24, 2026
Cache-restored Claude signatures must pass Detect/Decide on the outbound body. Stops the sanitizer bypass on the native compat path; matches Plus kaitranntt#227.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Narrow signature-boundary kernel cut from
kaitranntt/CLIProxyAPIPlus:main(f5570ed6). Supersedes the stacked integration PR #209 (181 commits / 131 files).PreserveEmptyThinkingBlocksused to keep thinking-block shape by forwarding the raw signature, including foreigngemini#, Grok-like E/R opaque blobs, shortEgI=, and client-supplied_cliproxy_replay_provenance. Compat mode now asksDecideSignatureCompatibilityForModel(the only authority). On incompatibility the block stays andsignature=""; a valid Claude signature is preserved.Client
_cliproxy_replay_provenanceis stripped before the compatibility check so an untrusted marker cannot skip validation.gemini-cli
ConvertGeminiCLIResponseToClaude(issue #199 point 3) no longer dropsthoughtSignature. Routing stays on thethoughtflag: visible text with a signature is still text, not a thinking block. Sanitizer, not the translator, decides what Anthropic may see on fallback. This unblocks merging #190.Files
internal/signature/claude_messages_sanitize.gointernal/signature/claude_messages_sanitize_compat_test.gointernal/translator/gemini-cli/claude/gemini-cli_claude_response.gointernal/translator/gemini-cli/claude/gemini-cli_claude_response_test.go4 files, +319 / −13, 1 commit on
warelik/WARE-88-signature-sanitize.Not in this PR (already owned elsewhere)
selector.go— #5150 follow-ups, #4881WithCompattranslatorencrypted_content— fix(translator): sanitize foreign encrypted_content in WithCompat paths #224encrypted_content— fix(translator): drop invalid reasoning signatures in interactions→Responses #225empty_completion“lone signature ≠ content”Test plan
go test ./internal/signature/ ./internal/translator/gemini-cli/claude/gemini#, mislabeledclaude#, nested prefix, unknown vendor, whitespace-paddedEgI=, Grok-like E/R, opaque blob, client provenance strip, valid Claude signature preservedthought:true; visible text with signature staystext_deltago build -o cli-proxy-api ./cmd/serverStock counterpart
Sanitizer kernel is the Plus slice of router-for-me/CLIProxyAPI#5150 (
internal/signature/**only; no cache/executor in this PR). Translator tail is Plus-only (stock CI rejects standaloneinternal/translator/**).Retention
Behavior already lives in
warelik/CLIProxyAPIPlusbranchwarelik/mission-integration. Ancestor commits:79c61df6271c393373bda3d43c5Closing #209 as superseded; do not merge the stack.