fix(ai): preserved anthropic tool-search replay blocks

- Retained tool-search server calls and opaque results in signed assistant history across direct streams, gateways, and custom-endpoint projection.

- Added replay regressions for interleaved thinking and client tool continuations.

Fixes #8559
This commit is contained in:
roboomp
2026-08-14 14:34:27 +00:00
parent ffd53ff92a
commit bee1d44bf9
10 changed files with 265 additions and 22 deletions
+2 -2
View File
@@ -470,8 +470,8 @@ function computeMessageTokens(message: AgentMessage, options?: { excludeEncrypte
if (!options?.excludeEncryptedReasoning) fragments.push(block.data);
} else if (block.type === "anthropicServerTool") {
// Native Anthropic server-tool call/result replayed verbatim on the
// wire (server_tool_use input, web_search_tool_result
// encrypted_content). Opaque provider-replay state the provider still
// wire (server_tool_use input and opaque result content). This opaque
// provider-replay state the provider still
// bills for on same-provider replay; excluded from the compaction
// floor like other encrypted reasoning because its local byte size
// diverges from provider billing.