Skip to content

⛓️ fix: Preserve Anthropic Server Tool State Across Client Tool Calls - #736

Merged
danny-avila merged 1 commit into
mainfrom
lia/anthropic-server-tool-continuation
Nov 23, 2026
Merged

danny-avila merged 1 commit into
mainfrom
lia/anthropic-server-tool-continuation

Conversation

@lia-by-librechat

Copy link
Copy Markdown
Contributor

Summary

Anthropic dynamic search uses code execution and nested server calls. After a client tool runs, dropping a result or its caller linkage can make the next request fail with HTTP 400. Pending code-execution tool uses also require the same container.

  • Share the native result allowlist across streaming, final normalization, and replay. Preserve payloads, caller linkage, and IDs without sending stream fields.
  • Both streaming request paths use the latest Anthropic container in the current user turn. Injected messages do not reset it, a real user turn does, and explicit options win.
  • The real graph regression uses mocked HTTP SSE for two client-tool rounds, a third model response, and a fresh user turn. Native event replay is also covered.

Fixes #690. Consolidates the designs from #720 (tang-ontheway) and #731/#732 (roman-redl, who also reported #690).

Checks

Scoped Jest, npx tsc --noEmit, touched ESLint and import sorting, npm run build, and circular dependency check.

Retain native results and caller linkage through both stream paths and replay. Scope automatic container reuse to the current user turn.

Design credits: tang-ontheway (#720) and roman-redl (#731, #732; reported #690).
@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Head: 10b40bc49223f3e0015047cf69523b6051165e51. Preserves Anthropic native results and caller linkage through both streaming paths and replay, and scopes container reuse to the current user turn. Includes the four-request graph regression.

@danny-avila

Copy link
Copy Markdown
Collaborator

@codex review the latest head, final review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T14:29:26.867208Z 10b40bc Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 10b40bc492

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lia-by-librechat lia-by-librechat Bot changed the title 🫙 fix: Preserve Anthropic Server Tool Continuation ⛓️ fix: Preserve Anthropic Server Tool State Across Client Tool Calls Nov 23, 2026
@danny-avila
danny-avila merged commit e1ecea8 into main Nov 23, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Anthropic web_search_20260209 (dynamic filtering): code_execution_tool_result is dropped and caller is stripped, so the next request fails with HTTP 400

2 participants