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:
@@ -631,7 +631,7 @@ func compareJSON(t *testing.T, expectedJSON, actualJSON string) {
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// P0-1: Empty Schema Placeholder Tests
|
||||
// Empty Schema Placeholder Tests
|
||||
// ============================================================================
|
||||
|
||||
func TestCleanJSONSchemaForAntigravity_EmptySchemaPlaceholder(t *testing.T) {
|
||||
@@ -732,7 +732,7 @@ func TestCleanJSONSchemaForAntigravity_EmptySchemaWithDescription(t *testing.T)
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// P0-2: Format field handling (ad-hoc patch removal)
|
||||
// Format field handling (ad-hoc patch removal)
|
||||
// ============================================================================
|
||||
|
||||
func TestCleanJSONSchemaForAntigravity_FormatFieldRemoval(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user