fix(oauth): include identity block in all API calls
Anthropic requires the identity prefix for OAuth tokens on every request, but it was only included when a system prompt was present. Calls without a system prompt (e.g. fact extraction during memory consolidation) got 400 invalid_request_error every time, silently breaking memory consolidation while the session trim still ran. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -381,6 +381,10 @@ class AnthropicOAuthProvider(LLMProvider):
|
||||
{"type": "text", "text": get_claude_code_system_prefix()},
|
||||
{"type": "text", "text": system, "cache_control": {"type": "ephemeral", "ttl": "1h"}},
|
||||
]
|
||||
else:
|
||||
payload["system"] = [
|
||||
{"type": "text", "text": get_claude_code_system_prefix()},
|
||||
]
|
||||
|
||||
if tools:
|
||||
cached_tools = list(tools)
|
||||
|
||||
Reference in New Issue
Block a user