Skip to content

fix: Allows reasoning to be reused in responses API.#2480

Closed
zackleman wants to merge 4 commits into
anomalyco:devfrom
zackleman:add-passback-reasoning
Closed

fix: Allows reasoning to be reused in responses API.#2480
zackleman wants to merge 4 commits into
anomalyco:devfrom
zackleman:add-passback-reasoning

Conversation

@zackleman

@zackleman zackleman commented Sep 7, 2025

Copy link
Copy Markdown

Allows openAI reasoning chains to be passed back to the responses API. Uses the itemId if store:true and encrypted content if set to false and include: ["reasoning.encrypted_content"] is used.

Expect an error like:

AI_APICallError: Item with id 'rs_68be1138d72081a18f8e81b24c59fcba00cd1de26313e896' not found. Items are not persisted when `store` is
set to false. Try again with `store` set to true, or remove this item from your input.

if store is false and encrypted content is not passed.

Had to debug this issue in the process. Adding ItemIds solved this.
vercel/ai#7099 (comment)

Motivated by:
https://x.com/prashantmital/status/1963801245115904232

[@prashantmital](https://x.com/prashantmital)

[Sep 4](https://x.com/prashantmital/status/1963801245115904232)
myth #3: model intelligence is the same regardless of whether you use completions or responses

wrong again.

responses was built for thinking models that call tools within their chain-of-thought (CoT). responses allows persisting the CoT between model invocations when calling tools agentically -- the result is a more intelligent model, and much higher cache utilization; we saw cache rates jump from 40-80% on some workloads.

this one is perhaps the most egregious. developers don't realize how much performance they are leaving on the table. i get it, its hard because you use LiteLLM or some custom harness you built around chat completions or whatever, but prioritizing the switch is crucial if you want GPT-5 to be maximally performant in your agents.

here's our cookbook on function calling with responses:

@zackleman
zackleman marked this pull request as ready for review September 7, 2025 23:15
@zackleman zackleman changed the title Allows openAI reasoning chains to be passed to API. fix: Allows openAI reasoning chains to be passed to API. Sep 7, 2025
@zackleman zackleman changed the title fix: Allows openAI reasoning chains to be passed to API. fix: Allows reasoning to be reused in responses API. Sep 7, 2025
@zackleman

zackleman commented Sep 8, 2025

Copy link
Copy Markdown
Author

Ideally need more clarity if this provides further benefit or if the AI SDK's "within turn" logic is sufficient for improved tool use. Also consider stripping out the summaries as they are unused when sent back to the API.

@github-actions

github-actions Bot commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR.

@github-actions github-actions Bot closed this Feb 2, 2026
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.

1 participant