Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors signature handling by removing AccountIdentity and footprint-based prefixing across multiple transformers, replacing it with a heuristic-based provider detection in shared/signature.go. Feedback identifies a potential regression in ClaudeCodeTransformer where user ID injection is now disabled, a placeholder in a comment, a redundant check in the provider guessing logic, and a request for better documentation of protobuf wire type heuristics.
| } | ||
|
|
||
| reqCopy = injectFakeUserIDStructured(ctx, reqCopy, t.accountIdentity) | ||
| reqCopy = injectFakeUserIDStructured(ctx, reqCopy, "") |
There was a problem hiding this comment.
The accountIdentity field was removed from the ClaudeCodeTransformer struct, and as a result, injectFakeUserIDStructured is now called with an empty string. This likely disables the user ID injection functionality that was previously tied to the channel's identity. If this was intentional as part of the refactor, consider removing the function call entirely to simplify the code. If the functionality is still required, the identity should be retained in the struct.
|
|
||
| // GuessSignatureProvider guesses which AI provider a raw base64 blob belongs to. | ||
| // | ||
| // Heuristics (from xx.md): |
| } | ||
| } | ||
|
|
||
| if isBase64Url && !strings.ContainsAny(s, "+/") { |
There was a problem hiding this comment.
The check !strings.ContainsAny(s, "+/") is redundant because isBase64Url (which is set to the result of isBase64UrlString(s)) already ensures that the string only contains characters valid for base64url encoding, which excludes + and /.
| if isBase64Url && !strings.ContainsAny(s, "+/") { | |
| if isBase64Url { |
| switch bytes[0] { | ||
| case 0x0a, 0x12, 0x1a: | ||
| return true |
There was a problem hiding this comment.
Greptile SummaryThis PR removes the "signature prefix marker" mechanism, which previously embedded a per-channel footprint (derived from
Confidence Score: 4/5Safe to merge with care — the behaviour changes around reasoning item pass-through and Unknown-signature handling are intentional but worth validating in a staging environment. Only P2 findings in this review, but the PR carries significant behaviour changes (reasoning items now pass through into Responses API payloads, all provider-signature round-trips now rely on content-based heuristics rather than per-channel footprints) that warrant careful staging validation. Previous review threads flagged P1 concerns around looksLikeProto classification and ClaudeCode deterministic identity; the new looksLikeProto implementation is substantially more robust (full structural validation), but the overall risk profile of cross-provider signature routing keeps confidence at 4. llm/transformer/shared/signature.go (GuessSignatureProvider heuristics — new trust anchor for all cross-provider routing), llm/transformer/openai/responses/integration_test.go (reasoning item pass-through behaviour change), llm/transformer/gemini/outbound_convert.go (Unknown-signature fallback to ContextEngineeringThoughtSignature) Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[ReasoningSignature blob] --> B{GuessSignatureProvider}
B -->|starts with gAAAA / gAAA| C[ProviderOpenAI]
B -->|starts with EqQ / Eqo / Eqr| D[ProviderAnthropic]
B -->|std base64 AND looksLikeProto| E[ProviderGemini]
B -->|anything else| F[ProviderUnknown]
C -->|DecodeAnthropicSignature| G[nil - rejected]
D -->|DecodeAnthropicSignature| H[raw value - accepted]
E -->|DecodeAnthropicSignature| G
F -->|DecodeAnthropicSignature| H
C -->|DecodeGeminiThoughtSignature| I[nil - rejected]
D -->|DecodeGeminiThoughtSignature| I
E -->|DecodeGeminiThoughtSignature| J[raw value - accepted]
F -->|DecodeGeminiThoughtSignature| I
C -->|DecodeOpenAIEncryptedContent| K[raw value - accepted]
D -->|DecodeOpenAIEncryptedContent| L[nil - rejected]
E -->|DecodeOpenAIEncryptedContent| L
F -->|DecodeOpenAIEncryptedContent| K
Reviews (5): Last reviewed commit: "refactor: remove the signature prefix ma..." | Re-trigger Greptile |
5130c80 to
8fc996f
Compare
No description provided.