fix(claude): remove invalid cache_control scope from static system block
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -1313,7 +1313,7 @@ func checkSystemInstructionsWithSigningMode(payload []byte, strictMode bool, exp
|
|||||||
claudeCodeToneAndStyle,
|
claudeCodeToneAndStyle,
|
||||||
claudeCodeOutputEfficiency,
|
claudeCodeOutputEfficiency,
|
||||||
}, "\n\n")
|
}, "\n\n")
|
||||||
staticBlock := buildTextBlock(staticPrompt, map[string]string{"scope": "global"})
|
staticBlock := buildTextBlock(staticPrompt, nil)
|
||||||
|
|
||||||
systemResult := "[" + billingBlock + "," + agentBlock + "," + staticBlock + "]"
|
systemResult := "[" + billingBlock + "," + agentBlock + "," + staticBlock + "]"
|
||||||
payload, _ = sjson.SetRawBytes(payload, "system", []byte(systemResult))
|
payload, _ = sjson.SetRawBytes(payload, "system", []byte(systemResult))
|
||||||
@@ -1452,9 +1452,6 @@ func buildTextBlock(text string, cacheControl map[string]string) string {
|
|||||||
// Build cache_control JSON manually to avoid sjson map marshaling issues.
|
// Build cache_control JSON manually to avoid sjson map marshaling issues.
|
||||||
// sjson.SetBytes with map[string]string may not produce expected structure.
|
// sjson.SetBytes with map[string]string may not produce expected structure.
|
||||||
cc := `{"type":"ephemeral"`
|
cc := `{"type":"ephemeral"`
|
||||||
if s, ok := cacheControl["scope"]; ok {
|
|
||||||
cc += fmt.Sprintf(`,"scope":"%s"`, s)
|
|
||||||
}
|
|
||||||
if t, ok := cacheControl["ttl"]; ok {
|
if t, ok := cacheControl["ttl"]; ok {
|
||||||
cc += fmt.Sprintf(`,"ttl":"%s"`, t)
|
cc += fmt.Sprintf(`,"ttl":"%s"`, t)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user