fix(oauth): include identity block in all API calls
Build Nanobot OAuth / build (push) Successful in 48s
Build Nanobot OAuth / cleanup (push) Successful in 0s

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:
2026-03-22 17:03:01 +01:00
parent 266458528e
commit 3f2684dcfe
+4
View File
@@ -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)