Skip to content

fix(kiro): align thinking signature with bytecat shape#27

Merged
acking-you merged 3 commits into
masterfrom
fix/kiro-bytecat-signature-alignment
Jun 4, 2026
Merged

fix(kiro): align thinking signature with bytecat shape#27
acking-you merged 3 commits into
masterfrom
fix/kiro-bytecat-signature-alignment

Conversation

@acking-you
Copy link
Copy Markdown
Owner

Summary

Align Kiro's Anthropic thinking signature shape with the Bytecat-observed response format while keeping a single canonical signature path.

Root cause

The previous synthetic thinking signature used an older Claude-shaped envelope with header kind 12, no header field 8, and a minimum body padding of 619 bytes. This made short thinking signatures much larger than the Bytecat samples and left identity synthetic thinking visibly different from Bytecat-like responses.

What changed

  • Update the single canonical thinking signature envelope to use header kind 14, include an 8-byte header field 8, and use short/long Bytecat-like body lengths while still binding the signature bytes to the full thinking text.
  • Keep protected validation on the same signature generation path so tampering with thinking/model/key/secret/signature is still rejected.
  • Replace model-only synthetic identity thinking with a short natural task-understanding sentence.
  • Add regression coverage that long upstream reasoning chunks are still passed through unchanged; only the signature body length is capped.
  • Update provider tests to expect the new short signature length for non-streaming thinking content.

Tests

  • CARGO_TARGET_DIR=/mnt/wsl/data4tb/static-flow-data/cargo-target/static_flow cargo test -p llm-access-kiro --jobs 4
  • CARGO_TARGET_DIR=/mnt/wsl/data4tb/static-flow-data/cargo-target/static_flow cargo test -p llm-access --jobs 4
  • CARGO_TARGET_DIR=/mnt/wsl/data4tb/static-flow-data/cargo-target/static_flow cargo clippy -p llm-access-kiro -p llm-access --jobs 4 -- -D warnings
  • git diff --check

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors and enhances the Anthropic model identity resolution and thinking-signature synthesis. It introduces structured response identities (ResponseIdentityKind and ResponseModelIdentity) to handle multi-identity and platform conflict probes in both Chinese and English, alongside updating synthetic signature generation to match recent Anthropic field layouts. Feedback on the changes highlights opportunities to prevent potential panics by using safe string slicing (.get()) instead of direct indexing, and to ensure case-insensitive matching in Chinese conflict probes by performing substring checks on the lowercase content representation.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread crates/llm-access-kiro/src/anthropic/converter/identity.rs
Comment thread crates/llm-access-kiro/src/anthropic/converter/identity.rs
Comment thread crates/llm-access-kiro/src/anthropic/converter/identity.rs
@acking-you
Copy link
Copy Markdown
Owner Author

@codex review

Copy link
Copy Markdown

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

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: 1dd465f4e5

ℹ️ 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 crates/llm-access-kiro/src/anthropic/converter/mod.rs Outdated
Comment thread crates/llm-access-kiro/src/anthropic/converter/identity.rs Outdated
Comment thread crates/llm-access-kiro/src/anthropic/converter/mod.rs Outdated
@acking-you acking-you merged commit 174f6d1 into master Jun 4, 2026
3 checks passed
Copy link
Copy Markdown

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

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: 8f48b62c92

ℹ️ 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 crates/llm-access-kiro/src/anthropic/converter/identity.rs
Comment thread crates/llm-access-kiro/src/anthropic/stream/signature.rs
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.

1 participant