You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Switching between ChatGPT Codex to OpenAI API results in errors #7699
I have a ton of old sessions where I used OpenAI API models. When I switched over to ChatGPT Codex, any additional prompts sent in those sessions results in errors such as:
Item with id 'rs_08967cad41a1d1fc0069599e28be1881909a42ea84f1ab24cd' 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.
Additionally, going in the opposite direction (a session with ChatGPT messages --> OpenAI API) results in errors such as these:
Item with id 'rs_03cdea15e4352413016962aeb58374819da5149be98b1a7b1e' not found.
...under the hood I know exactly where this error is coming from. But I'm sure you all might even be aware of it already. Just thought I would point it out.
I think it is caused by the messages following the first one continues to carry the references, and that ChatGPT plus side and OpenAI api side doesn't share the it's reference data. So i think we might just omit those references when using third party OpenAI compatible apis
@rekram1-node I forgot to mention a more detailed use case centered around this issue. First of all, this bug doesn't really apply to subagent delegations because they are operationally new sessions being spawned each time a subagent is delegated. So, you can safely switch your subagent models mid-session; unless one day OpenCode introduces multi-turn, reusable subagent sessions which I can't imagine why.
My issue comes specifically from the primary session (my Orchestrator) switching models' mid-session.
I did play around with a third-party ChatGPT OAuth plugin before this release and ran into a similar issue except I was able to switch to a ChatGPT model and continue in older sessions that had been started with an API model. The issue I ran into there was that going back to an API model resulted in errors and had to write a script to remove those records from the internal memory storage in order to once again load up that session and continue using an API model.
Question, are you guys going to support both API and OAuth loaded at the same time within OpenCode? Or is it only either or... Right now, you can't use both at the same time since the OAuth and API values are living under the same key name in auth.json. Same thing goes for Anthropic OAuth vs API. You have to choose one or the other. Not a big deal, I'm just curious. Most of the time I use the API models because I do a lot of heavy, non-commercial AI work and hit the limits quite often with the pay-per-month subscription. I'm at that cusp where it's least expensive for me to pay for API usage vs having a higher-level monthly subscription that gives you the higher limits. But I think I'd rather have a pay-per-month subscription for my "normal" month to month usage and retain the ability to flip over to the API when I hit a limit during those months of heavy project work. Yeah, I could just simply flip my auth.json around and reload the session, but it's kind of annoying. I'm working on a "pre-flight" workflow that checks a request before sending it to see if it would blow any limits, if it looks like it will, I send that request to a different provider and let the other one "cool off" for a bit before flipping back to it. I would LOVE to be able to fold in this workflow to primarily use the OAuth subs and fall back to an API path until the limits have cleared.
Activity
github-actions commentedon Jan 10, 2026
This issue might be a duplicate of existing issues. Please check:
GPT 5.1 Codexvia OpenAI fails on the 2nd request #4445: UsingGPT 5.1 Codexvia OpenAI fails on the 2nd request - reports the exact same error 'Item with id rs_... not found. Items are not persisted when store is set to false'Feel free to ignore if none of these address your specific case.
rekram1-node commentedon Jan 11, 2026
Yeah im aware of this ill fix
evannotfound commentedon Jan 11, 2026
I think it is caused by the messages following the first one continues to carry the references, and that ChatGPT plus side and OpenAI api side doesn't share the it's reference data. So i think we might just omit those references when using third party OpenAI compatible apis
Dyaxler commentedon Jan 11, 2026
@rekram1-node I forgot to mention a more detailed use case centered around this issue. First of all, this bug doesn't really apply to subagent delegations because they are operationally new sessions being spawned each time a subagent is delegated. So, you can safely switch your subagent models mid-session; unless one day OpenCode introduces multi-turn, reusable subagent sessions which I can't imagine why.
My issue comes specifically from the primary session (my Orchestrator) switching models' mid-session.
I did play around with a third-party ChatGPT OAuth plugin before this release and ran into a similar issue except I was able to switch to a ChatGPT model and continue in older sessions that had been started with an API model. The issue I ran into there was that going back to an API model resulted in errors and had to write a script to remove those records from the internal memory storage in order to once again load up that session and continue using an API model.
Question, are you guys going to support both API and OAuth loaded at the same time within OpenCode? Or is it only either or... Right now, you can't use both at the same time since the OAuth and API values are living under the same key name in
auth.json. Same thing goes for Anthropic OAuth vs API. You have to choose one or the other. Not a big deal, I'm just curious. Most of the time I use the API models because I do a lot of heavy, non-commercial AI work and hit the limits quite often with the pay-per-month subscription. I'm at that cusp where it's least expensive for me to pay for API usage vs having a higher-level monthly subscription that gives you the higher limits. But I think I'd rather have a pay-per-month subscription for my "normal" month to month usage and retain the ability to flip over to the API when I hit a limit during those months of heavy project work. Yeah, I could just simply flip myauth.jsonaround and reload the session, but it's kind of annoying. I'm working on a "pre-flight" workflow that checks a request before sending it to see if it would blow any limits, if it looks like it will, I send that request to a different provider and let the other one "cool off" for a bit before flipping back to it. I would LOVE to be able to fold in this workflow to primarily use the OAuth subs and fall back to an API path until the limits have cleared.rekram1-node commentedon Jan 16, 2026
This should be fixed in the next release (1.1.24) by commit: 40836e9