mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-03 04:50:52 +08:00
fix: Normalize Bash tool args and add signature caching support
Normalize Bash tool arguments by converting a "command" key into "cmd" using JSON-aware parsing, avoiding brittle string replacements that could corrupt values. Apply this conversion in both streaming and non-streaming response paths so bash-style tool calls are emitted with the expected "cmd" field. Add support for accumulating thinking text and carrying session identifiers to enable signature caching/restore for unsigned thinking blocks, improving handling of thinking-state continuity across requests/responses. Also perform small cleanups: import logging, tidy comments and test descriptions. These changes make tool-argument handling more robust and enable reliable signature restoration for thinking blocks.
This commit is contained in:
@@ -330,7 +330,7 @@ func TestConvertClaudeRequestToAntigravity_GenerationConfig(t *testing.T) {
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// P2-A: Trailing Unsigned Thinking Block Removal
|
||||
// Trailing Unsigned Thinking Block Removal
|
||||
// ============================================================================
|
||||
|
||||
func TestConvertClaudeRequestToAntigravity_TrailingUnsignedThinking_Removed(t *testing.T) {
|
||||
@@ -435,7 +435,7 @@ func TestConvertClaudeRequestToAntigravity_MiddleUnsignedThinking_SentinelApplie
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// P2-B: Tool + Thinking System Hint Injection
|
||||
// Tool + Thinking System Hint Injection
|
||||
// ============================================================================
|
||||
|
||||
func TestConvertClaudeRequestToAntigravity_ToolAndThinking_HintInjected(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user