Generator-backed tool input examples disappear from follow-up requests
@sylvesterkaczmarek arbeitet bereits daran.
Seit 06.10.2026.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 50/100
Rechercherichtung
Start at BaseFunctionTool, where a supplied input_examples iterable is stored as-is, and at the beta_tool/beta_async_tool constructors that pass it through; materialize the iterable once at construction so body serialization can be repeated. The issue already has two open pull requests (#1991, #2002), so check whether they already implement this before starting. Done means the public-client matrix (sync/async, JSON/streaming, generator and list-iterator inputs with list/tuple/empty/omitted controls) passes, with the eight currently failing cases green.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
beta_tool and beta_async_tool accept input_examples as Iterable[dict[str, object]], but BaseFunctionTool retains a supplied iterator directly. The first request consumes it during body serialization. Later requests from the same tool runner still carry that exhausted iterator and send input_examples: [] instead of the configured examples.
examples = ({"city": city} for city in ["Kraków", "London"])
tool = beta_tool(lookup, input_examples=examples)
# In a two-turn tool_runner run, the first request includes both examples;
# the follow-up request sends an empty input_examples list.
This silently changes the tool definition during a conversation and loses the examples intended for subsequent model calls. Lists and tuples do not exhibit the problem.
Materialize the iterable once when constructing the function tool, retaining its values for repeated serialization. Empty iterables and omitted examples should keep their respective empty/omitted behavior.
A public-client matrix reproduces the issue across sync/async and JSON/streaming runners, with generator and list-iterator inputs plus list/tuple/empty/omitted controls. Eight cases fail on unchanged main. The change is separate from #1838, which prevents telemetry from consuming the outer messages/tools iterables, and #1953, which concerns ToolError content.
- Vorherrschende Sprache
- Python
- Sterne
- 4.1k
- Forks
- 915
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus anthropics/anthropic-sdk-python
-
beta_tool validation errors reach the model as "Invalid arguments for function X" with no detailEvtl. vergeben @mangeshraut712 hat das vor 32 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
anthropics/anthropic-sdk-python#2033 · 3 Kommentare ·
-
`AnthropicBedrock` 2.x sends `anthropic_version: 2026-10-21`, which Bedrock rejects for Claude Sonnet 4.5, Opus 4.5 and Opus 4.6Evtl. vergeben @charan-rathore hat das vor 36 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
anthropics/anthropic-sdk-python#2031 · 1 Kommentar ·
-
Three symlink tests in test_agent_toolset.py are missing the needs_symlinks markerEvtl. vergeben @okxint hat das vor 82 Tagen übernommen. Offen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 92/100
anthropics/anthropic-sdk-python#1915 · 3 Kommentare ·
-
Messages.parse (and AsyncMessages.parse) don't take cache_control?Evtl. vergeben @AlphaFDE hat das vor 86 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
anthropics/anthropic-sdk-python#1907 · 2 Kommentare ·
-
Windows: os.fchmod in credential write-back bricks the OAuth refresh tokenEvtl. vergeben @OllieinCanada hat das vor 99 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
anthropics/anthropic-sdk-python#1868 · 1 Kommentar ·
Alle Issues in anthropics/anthropic-sdk-python
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
compiler-explorer/compiler-explorer#9710 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug harness
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
mruangutai/harness#2687 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
modal-labs/modal-client#4158 ·
-
kind/bug needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
kubeflow/sdk#998 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 3 Tagen
-
good first issue
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag