From 8783caf313d6746574850be9b2a989dfe1316fba Mon Sep 17 00:00:00 2001 From: wykk-12138 Date: Thu, 9 Apr 2026 13:58:04 +0800 Subject: [PATCH] fix: buildTextBlock cache_control sjson path issue sjson treats 'cache_control.type' as nested path, creating {ephemeral: {scope: org}} instead of {type: ephemeral, scope: org}. Pass the whole map to sjson.SetBytes as a single value. --- internal/runtime/executor/claude_executor.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/internal/runtime/executor/claude_executor.go b/internal/runtime/executor/claude_executor.go index e3b5b7c6..292335cc 100644 --- a/internal/runtime/executor/claude_executor.go +++ b/internal/runtime/executor/claude_executor.go @@ -1346,10 +1346,8 @@ func checkSystemInstructionsWithSigningMode(payload []byte, strictMode bool, exp func buildTextBlock(text string, cacheControl map[string]string) string { block := []byte(`{"type":"text"}`) block, _ = sjson.SetBytes(block, "text", text) - if cacheControl != nil { - for k, v := range cacheControl { - block, _ = sjson.SetBytes(block, "cache_control."+k, v) - } + if cacheControl != nil && len(cacheControl) > 0 { + block, _ = sjson.SetBytes(block, "cache_control", cacheControl) } return string(block) }