gpt-5-codex failure: AI_APICallError: Item 'rs_... of type 'reasoning' was provided without its required following item. #1931

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

Originally created by @berenddeboer on GitHub (Oct 2, 2025).

Originally assigned to: @rekram1-node on GitHub.

Seeing this pretty regularly, happening with both the zen and openai provider (although more with the latter it feels like)

Originally created by @berenddeboer on GitHub (Oct 2, 2025). Originally assigned to: @rekram1-node on GitHub. Seeing this pretty regularly, happening with both the zen and openai provider (although more with the latter it feels like)
yindo closed this issue 2026-02-16 17:33:17 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Oct 2, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #2610: Same exact error message with GPT-5 reasoning models - was a regression that got fixed
  • #2628: Identical error with GPT-5 and reasoning type issues - also resolved

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Oct 2, 2025): This issue might be a duplicate of existing issues. Please check: - #2610: Same exact error message with GPT-5 reasoning models - was a regression that got fixed - #2628: Identical error with GPT-5 and reasoning type issues - also resolved Feel free to ignore if none of these address your specific case.
Author
Owner

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

@berenddeboer this is because you are switching providers midway through a chat, we will need to account for that but just so u know

@rekram1-node commented on GitHub (Oct 3, 2025): @berenddeboer this is because you are switching providers midway through a chat, we will need to account for that but just so u know
Author
Owner

@wKich commented on GitHub (Oct 3, 2025):

Interesting, I had the same issue yesterday, pretty often, when I's using exclusively z.ai GLM4.6, without switching any providers.

@rekram1-node, could you share some info how can I debug that or collect more useful data, to understand what's going on under the hood?

The only useful info I got from --print-logs is this:

{ 
  responseBody: '{"error":{"code":"1210","message":"Invalid API parameter, please check the documentation."}}',
  isRetryable: false,
  data: {
    error: {
      message: 'Invalid API parameter, please check the documentation.',
      code: '1210'
    }
  }
}

If you need anything else, please tell

@wKich commented on GitHub (Oct 3, 2025): Interesting, I had the same issue yesterday, pretty often, when I's using exclusively z.ai GLM4.6, without switching any providers. @rekram1-node, could you share some info how can I debug that or collect more useful data, to understand what's going on under the hood? The only useful info I got from `--print-logs` is this: ``` { responseBody: '{"error":{"code":"1210","message":"Invalid API parameter, please check the documentation."}}', isRetryable: false, data: { error: { message: 'Invalid API parameter, please check the documentation.', code: '1210' } } } ``` If you need anything else, please tell
Author
Owner

@hashangit commented on GitHub (Oct 3, 2025):

Interesting, I had the same issue yesterday, pretty often, when I's using exclusively z.ai GLM4.6, without switching any providers.

@rekram1-node, could you share some info how can I debug that or collect more useful data, to understand what's going on under the hood?

i'm having the same issue since yesterday. Its still present as of commenting. (Happens with zen - Grok Code Fast 1 too)

More context: It usually happens after a couple of user messages (mostly on the 1st or the second follow up)

@hashangit commented on GitHub (Oct 3, 2025): > Interesting, I had the same issue yesterday, pretty often, when I's using exclusively z.ai GLM4.6, without switching any providers. > > [@rekram1-node](https://github.com/rekram1-node), could you share some info how can I debug that or collect more useful data, to understand what's going on under the hood? i'm having the same issue since yesterday. Its still present as of commenting. (Happens with zen - Grok Code Fast 1 too) More context: It usually happens after a couple of user messages (mostly on the 1st or the second follow up)
Author
Owner

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

ahhh okay but those are different errors :) this issue is about:
Item 'rs_... of type 'reasoning' was provided without its required following item.

I can point you in direction of GLM ticket @wKich

@hashangit what error do u see?

@rekram1-node commented on GitHub (Oct 3, 2025): ahhh okay but those are different errors :) this issue is about: Item 'rs_... of type 'reasoning' was provided without its required following item. I can point you in direction of GLM ticket @wKich @hashangit what error do u see?
Author
Owner

@sai-sy commented on GitHub (Nov 24, 2025):

@rekram1-node they seem to have fixed it for https://github.com/vercel/ai/issues/7099 but still presents in opencode

@sai-sy commented on GitHub (Nov 24, 2025): @rekram1-node they seem to have fixed it for https://github.com/vercel/ai/issues/7099 but still presents in opencode
Author
Owner

@rekram1-node commented on GitHub (Nov 24, 2025):

@sai-sy we talked to openai this remains an issue for a lot of people because of how the responses api works.

You can try getting around it by doing this:

 "openai": {
      "models": {
        "gpt-5": {
          "options": {
            "include": ["reasoning.encrypted_content"],
            "store": false,
          },
        },
      },
    },

Just do that for the openai models u use, we previously couldn't do this automaticaly because of some restrictions but I think they updated it for us actually

@rekram1-node commented on GitHub (Nov 24, 2025): @sai-sy we talked to openai this remains an issue for a lot of people because of how the responses api works. You can try getting around it by doing this: ``` "openai": { "models": { "gpt-5": { "options": { "include": ["reasoning.encrypted_content"], "store": false, }, }, }, }, ``` Just do that for the openai models u use, we previously couldn't do this automaticaly because of some restrictions but I think they updated it for us actually
Author
Owner

@sai-sy commented on GitHub (Nov 26, 2025):

@rekram1-node am I meant to preface that key with something because with this config:

{
  "$schema": "https://opencode.ai/config.json",
  "permission": {
    "bash": {
      "rg *": "allow",
      "grep *": "allow",
      "find *": "allow",
      "curl *": "allow"
    }
  },
  "lsp": {
    "clangd": {
    "disabled": true
    }
  },
   "openai": {
      "models": {
        "gpt-5-codex": {
          "options": {
            "include": ["reasoning.encrypted_content"],
            "store": false,
          },
        "gpt-5.1-codex": {
          "options": {
            "include": ["reasoning.encrypted_content"],
            "store": false,
          },
        },
      },
    },
}

I get this error

$ opencode
Error: Config file at /home/sai/.config/opencode/opencode.json is invalid
↳ Unrecognized key: "openai"
@sai-sy commented on GitHub (Nov 26, 2025): @rekram1-node am I meant to preface that key with something because with this config: ```json { "$schema": "https://opencode.ai/config.json", "permission": { "bash": { "rg *": "allow", "grep *": "allow", "find *": "allow", "curl *": "allow" } }, "lsp": { "clangd": { "disabled": true } }, "openai": { "models": { "gpt-5-codex": { "options": { "include": ["reasoning.encrypted_content"], "store": false, }, "gpt-5.1-codex": { "options": { "include": ["reasoning.encrypted_content"], "store": false, }, }, }, }, } ``` I get this error ```bash $ opencode Error: Config file at /home/sai/.config/opencode/opencode.json is invalid ↳ Unrecognized key: "openai" ```
Author
Owner

@shekohex commented on GitHub (Nov 26, 2025):

@sai-sy it should be inside the "provider" key, see: https://opencode.ai/docs/providers/

@shekohex commented on GitHub (Nov 26, 2025): @sai-sy it should be inside the "provider" key, see: https://opencode.ai/docs/providers/
Author
Owner

@rekram1-node commented on GitHub (Nov 26, 2025):

yeah needs to be in providers sorry

@rekram1-node commented on GitHub (Nov 26, 2025): yeah needs to be in providers sorry
Author
Owner

@lifeiscontent commented on GitHub (Dec 22, 2025):

this happens for me when opencode crashes and I try to continue the chat with "please continue" not switching the model.

Item 'rs_...' of type 'reasoning' was provided without its required following item.

@lifeiscontent commented on GitHub (Dec 22, 2025): this happens for me when opencode crashes and I try to continue the chat with "please continue" not switching the model. > Item 'rs_...' of type 'reasoning' was provided without its required following item.
Author
Owner

@vitality82 commented on GitHub (Dec 23, 2025):

@berenddeboer this is because you are switching providers midway through a chat, we will need to account for that but just so u know

New user here, installed first the mac app (as it was the main affordance on the page). Did nothing there, switched to terminal, followed instructions:

  • /connect
  • Choose Zen, copy & paste KEY
  • enable billing
  • choose GPT-5.1 Codex
  • /init
  • add prompt in plan mode
  • start building

Got this problem twice in my very first session 🤷‍♂️
Item with id 'rs_029e6e8f0b72ec9700694a6f32.........' not found.

@vitality82 commented on GitHub (Dec 23, 2025): > [@berenddeboer](https://github.com/berenddeboer) this is because you are switching providers midway through a chat, we will need to account for that but just so u know New user here, installed first the mac app (as it was the main affordance on the page). Did nothing there, switched to terminal, followed instructions: - /connect - Choose Zen, copy & paste KEY - enable billing - choose GPT-5.1 Codex - /init - add prompt in plan mode - start building Got this problem twice in my very first session 🤷‍♂️ Item with id 'rs_029e6e8f0b72ec9700694a6f32.........' not found.
Author
Owner

@vitality82 commented on GitHub (Dec 23, 2025):

Onboarding is really crucial if folks are to migrate from Claude Code to here. FWIW there was also another issue (maybe related?):

# Search for startTopLoadingBar usages $ rg -n "startTopLoadingBar" -n zsh:1: command not found: rg

So I brew installed ripgrep and told it to try again, then it did some work and stumbled upon the item with id 'rs_029e6... not found issue again.

@vitality82 commented on GitHub (Dec 23, 2025): Onboarding is really crucial if folks are to migrate from Claude Code to here. FWIW there was also another issue (maybe related?): `# Search for startTopLoadingBar usages $ rg -n "startTopLoadingBar" -n zsh:1: command not found: rg` So I brew installed ripgrep and told it to try again, then it did some work and stumbled upon the item with id 'rs_029e6... not found issue again.
Author
Owner

@rekram1-node commented on GitHub (Jan 16, 2026):

This should be fixed in the next release (1.1.24) by commit: https://github.com/anomalyco/opencode/commit/40836e96835862e98e042d3fc0869970eaaaedfb

@rekram1-node commented on GitHub (Jan 16, 2026): This should be fixed in the next release (1.1.24) by commit: https://github.com/anomalyco/opencode/commit/40836e96835862e98e042d3fc0869970eaaaedfb
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1931