mirror of
https://github.com/router-for-me/CLIProxyAPIPlus.git
synced 2026-04-12 09:14:15 +00:00
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,
|
||||
claudeCodeOutputEfficiency,
|
||||
}, "\n\n")
|
||||
staticBlock := buildTextBlock(staticPrompt, map[string]string{"scope": "global"})
|
||||
staticBlock := buildTextBlock(staticPrompt, nil)
|
||||
|
||||
systemResult := "[" + billingBlock + "," + agentBlock + "," + staticBlock + "]"
|
||||
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.
|
||||
// sjson.SetBytes with map[string]string may not produce expected structure.
|
||||
cc := `{"type":"ephemeral"`
|
||||
if s, ok := cacheControl["scope"]; ok {
|
||||
cc += fmt.Sprintf(`,"scope":"%s"`, s)
|
||||
}
|
||||
if t, ok := cacheControl["ttl"]; ok {
|
||||
cc += fmt.Sprintf(`,"ttl":"%s"`, t)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user