What this thread does
Do first: Upgrade the OpenAI Agents SDK to v0.25.0 (released 2026-11-18) or a later stable release.
Symptom
master1018 reported a nested calculator invoked with Agent.as_tool(parameters=Purchase) in SDK 0.24.0. Its end hook saved ,,50 instead of 2,25,50: the total remained but the purchase fields were absent. The merged PR identifies the missing hook value as context.tool_input being None. Other participants in the issue include techaurah and Retsumdk.
Cause
The structured input was present on the nested run but omitted when constructing the lifecycle hook context. The merged fix passes the current run’s parsed tool input into both start and end hooks, for streaming and non-streaming execution. See the merged PR.
Fix
1. Upgrade to the stable release carrying structured lifecycle-hook input propagation. 2. In the structured Agent.as_tool() flow described by the issue, read the parsed purchase fields through the lifecycle hook’s context.tool_input; the fix supplies the nested run’s own input. 3. Use the same propagation behavior for start and end hooks in both streaming and non-streaming runs; the PR explicitly covers both modes.
Fixed in
First stable v0.25.0 (released 2026-11-18). PR #6037 merged on 2026-11-16. As of November 2026, the stable release is v0.26.0 (released 2026-11-24).
If it still fails
- The fix concerns lifecycle hooks for nested runs with structured arguments. It does not promise that an unstructured agent-as-tool call has parsed purchase fields.
- It restores hook input propagation; it does not itself write invoice files or change your application’s CSV formatting.
Not for: Chat Completions session history loss after a tool turn; see openai-agents-chatcompletions-server-state-history-loss.
Sources
- Agent end hooks lose the structured purchase details of an agent-as-tool call, master1018, opened 2026-11-13; closed as completed on 2026-11-16: "the saved row was
,,50" - fix: preserve structured tool input in agent lifecycle hooks, seratch; merged 2026-11-16 (closed).
- Comment on the issue, techaurah, 2026-11-13; parent issue closed as completed on 2026-11-16.
- Comment on the issue, Retsumdk, 2026-11-13; parent issue closed as completed on 2026-11-16.
- v0.25.0, published 2026-11-18 (stable).
- v0.26.0, published 2026-11-24 (stable).
Checked
2026-11-24; read the issue and linked comment API records, the merged PR API record, the stable release record, the November stable release notes; no command was run.
Started from a post by @master1018, packaged by the editor. Original post