AI_APICallError with GPT-5-codex in Zero Data Retention organizations #1952

Closed
opened 2026-02-16 17:33:24 -05:00 by yindo · 14 comments
Owner

Originally created by @khoi on GitHub (Oct 4, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

Encountering an error when using GPT-5-codex in organizations with Zero Data Retention enabled.

Error Message

AI_APICallError: Item with id 'rs_06bf86e5bcb244a50168e1327555a481968c0242e88626fe66' not found. Items are not persisted for Zero Data Retention organizations. Remove this item from your input and try again.

Environment

  • Model: GPT-5-codex
  • Organization setting: Zero Data Retention enabled
Originally created by @khoi on GitHub (Oct 4, 2025). Originally assigned to: @rekram1-node on GitHub. ## Description Encountering an error when using GPT-5-codex in organizations with Zero Data Retention enabled. ## Error Message ``` AI_APICallError: Item with id 'rs_06bf86e5bcb244a50168e1327555a481968c0242e88626fe66' not found. Items are not persisted for Zero Data Retention organizations. Remove this item from your input and try again. ``` ## Environment - Model: GPT-5-codex - Organization setting: Zero Data Retention enabled
yindo closed this issue 2026-02-16 17:33:24 -05:00
Author
Owner

@rekram1-node commented on GitHub (Oct 4, 2025):

@khoi are you setting any reasoning effort settings for codex in your opencode.json?

@rekram1-node commented on GitHub (Oct 4, 2025): @khoi are you setting any reasoning effort settings for codex in your opencode.json?
Author
Owner

@capdevc commented on GitHub (Oct 4, 2025):

@rekram1-node

I'm having the same with a ZDR account.

What works for me is adding an explicit "store" = false

  "provider": {
    "openai": {
      "models": {
        "gpt-5-codex": {
          "options": {
            "store": false,
            "reasoningEffort": "high",
            "textVerbosity": "medium",
            "reasoningSummary": "auto",
            "include": ["reasoning.encrypted_content"]
          }
        }
    },

It now works whether I add the "reasoning.encrypted_content" inclusion or not.

My only guess, something in the reasoning summary handling is conditioned on "store" being there even though ZDR accounts treat all requests as store = false?

@capdevc commented on GitHub (Oct 4, 2025): @rekram1-node I'm having the same with a ZDR account. What works for me is adding an explicit "store" = false ``` "provider": { "openai": { "models": { "gpt-5-codex": { "options": { "store": false, "reasoningEffort": "high", "textVerbosity": "medium", "reasoningSummary": "auto", "include": ["reasoning.encrypted_content"] } } }, ``` It now works whether I add the "reasoning.encrypted_content" inclusion or not. My only guess, something in the reasoning summary handling is conditioned on "store" being there even though ZDR accounts treat all requests as store = false?
Author
Owner

@rekram1-node commented on GitHub (Oct 4, 2025):

OO good to know, yeah I think if you say store=false openai doesn't try to read the messages via id w/ responses api maybe?

@rekram1-node commented on GitHub (Oct 4, 2025): OO good to know, yeah I think if you say `store=false` openai doesn't try to read the messages via id w/ responses api maybe?
Author
Owner

@rekram1-node commented on GitHub (Oct 4, 2025):

I will document this somewhere

@rekram1-node commented on GitHub (Oct 4, 2025): I will document this somewhere
Author
Owner

@rekram1-node commented on GitHub (Oct 4, 2025):

@capdevc does it work if you specify the option at top level? Allowing u to not have to specify it for each reasoning model? ex:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "openai": {
      "options": {
        "store": false
      },
      "models": {
        "gpt-5-codex": {
          "options": {
            "reasoningEffort": "high",
            "textVerbosity": "medium",
            "reasoningSummary": "auto",
            "include": ["reasoning.encrypted_content"]
          }
        }
      }
    }
  }
}
@rekram1-node commented on GitHub (Oct 4, 2025): @capdevc does it work if you specify the option at top level? Allowing u to not have to specify it for each reasoning model? ex: ``` { "$schema": "https://opencode.ai/config.json", "provider": { "openai": { "options": { "store": false }, "models": { "gpt-5-codex": { "options": { "reasoningEffort": "high", "textVerbosity": "medium", "reasoningSummary": "auto", "include": ["reasoning.encrypted_content"] } } } } } } ```
Author
Owner

@capdevc commented on GitHub (Oct 4, 2025):

@rekram1-node

No, sadly setting it at the provider did not work.

  "provider": {
    "openai": {
      "options": {
        "store": false
      },
      "models": {
        "gpt-5-codex": {
          "options": {
            "reasoningEffort": "high",
            "textVerbosity": "medium",
            "reasoningSummary": "auto",
            "include": ["reasoning.encrypted_content"]
          }
        },
...

And the problem reappears

@capdevc commented on GitHub (Oct 4, 2025): @rekram1-node No, sadly setting it at the provider did not work. ``` "provider": { "openai": { "options": { "store": false }, "models": { "gpt-5-codex": { "options": { "reasoningEffort": "high", "textVerbosity": "medium", "reasoningSummary": "auto", "include": ["reasoning.encrypted_content"] } }, ... ``` And the problem reappears
Author
Owner

@rekram1-node commented on GitHub (Oct 4, 2025):

ah got it

@rekram1-node commented on GitHub (Oct 4, 2025): ah got it
Author
Owner

@capdevc commented on GitHub (Oct 4, 2025):

I think the ZDR issue has to do with "previous_response_id" handling... in a ZDR account this isn't enough since the reasoning tokens aren't stored at OpenAI, requiring you to receive the "encrypted_content" encrypted reasoning tokens and pass them back in if you want to keep the reasoning history in the model's context.

My guess is that somewhere the decision is being made on whether to pass along that encrypted reasoning content in the next message only if store is false instead of always attaching it. Maybe something upstream in the vercel ai package? I'm afraid I'm not super familiar with js/ts and the ecosystem.

apologies if you already know this, but: https://platform.openai.com/docs/guides/reasoning#keeping-reasoning-items-in-context

@capdevc commented on GitHub (Oct 4, 2025): I think the ZDR issue has to do with "previous_response_id" handling... in a ZDR account this isn't enough since the reasoning tokens aren't stored at OpenAI, requiring you to receive the "encrypted_content" encrypted reasoning tokens and pass them back in if you want to keep the reasoning history in the model's context. My guess is that somewhere the decision is being made on whether to pass along that encrypted reasoning content in the next message only if store is false instead of always attaching it. Maybe something upstream in the vercel ai package? I'm afraid I'm not super familiar with js/ts and the ecosystem. apologies if you already know this, but: https://platform.openai.com/docs/guides/reasoning#keeping-reasoning-items-in-context
Author
Owner

@rekram1-node commented on GitHub (Oct 4, 2025):

i think you are right on the money yeah that is what I figured didnt know about store false option but yeah that makes sense ofc

ill document it

@rekram1-node commented on GitHub (Oct 4, 2025): i think you are right on the money yeah that is what I figured didnt know about store false option but yeah that makes sense ofc ill document it
Author
Owner

@khoi commented on GitHub (Oct 4, 2025):

Using @capdevc config works.

@khoi commented on GitHub (Oct 4, 2025): Using @capdevc config works.
Author
Owner

@rekram1-node commented on GitHub (Oct 4, 2025):

Do you have to set store to false for non reasoning models too? Like gpt-4.1?

@rekram1-node commented on GitHub (Oct 4, 2025): Do you have to set store to false for non reasoning models too? Like gpt-4.1?
Author
Owner

@capdevc commented on GitHub (Oct 5, 2025):

@rekram1-node

I just tried it and gpt-4.1 works out of the box, I have nothing set in my config for it, so no need for store = false

@capdevc commented on GitHub (Oct 5, 2025): @rekram1-node I just tried it and gpt-4.1 works out of the box, I have nothing set in my config for it, so no need for store = false
Author
Owner

@rekram1-node commented on GitHub (Oct 5, 2025):

ty!

@rekram1-node commented on GitHub (Oct 5, 2025): ty!
Author
Owner

@thebongy commented on GitHub (Jan 8, 2026):

Could we add a feature to configure this on the provider level? This would prevent the need for re-configuring for every model on open ai. Made a small PR to possibly support this (https://github.com/anomalyco/opencode/pull/7315)

@thebongy commented on GitHub (Jan 8, 2026): Could we add a feature to configure this on the provider level? This would prevent the need for re-configuring for every model on open ai. Made a small PR to possibly support this (https://github.com/anomalyco/opencode/pull/7315)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1952