opencode icon indicating copy to clipboard operation
opencode copied to clipboard

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

Open berenddeboer opened this issue 5 months ago • 13 comments

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

berenddeboer avatar Oct 03 '25 03:10 berenddeboer

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] avatar Oct 03 '25 03:10 github-actions[bot]

@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 avatar Oct 03 '25 04:10 rekram1-node

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 avatar Oct 03 '25 05:10 wKich

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 avatar Oct 03 '25 05:10 hashangit

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 avatar Oct 03 '25 13:10 rekram1-node

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

sai-sy avatar Nov 24 '25 21:11 sai-sy

@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 avatar Nov 24 '25 22:11 rekram1-node

@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 avatar Nov 26 '25 11:11 sai-sy

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

shekohex avatar Nov 26 '25 12:11 shekohex

yeah needs to be in providers sorry

rekram1-node avatar Nov 26 '25 15:11 rekram1-node

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 avatar Dec 22 '25 06:12 lifeiscontent

@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 avatar Dec 23 '25 10:12 vitality82

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 avatar Dec 23 '25 10:12 vitality82

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

rekram1-node avatar Jan 16 '26 20:01 rekram1-node