After the issue with models.json, I randomly get the issue in the screnshot #3748

Open
opened 2026-02-16 17:41:20 -05:00 by yindo · 8 comments
Owner

Originally created by @ramarivera on GitHub (Dec 22, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

Image (I cannot copy paste the text, hence the screenshot)

OpenCode version

latest

Steps to reproduce

Not sure, it happens randomly, on some directories.
I can fix it for "one turn" for that directory by removing cache or models.json

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Originally created by @ramarivera on GitHub (Dec 22, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description <img width="1486" height="526" alt="Image" src="https://github.com/user-attachments/assets/2979225d-f33e-447c-8f60-a4e0990eda71" /> (I cannot copy paste the text, hence the screenshot) ### OpenCode version latest ### Steps to reproduce Not sure, it happens randomly, on some directories. I can fix it for "one turn" for that directory by removing cache or models.json ### Screenshot and/or share link _No response_ ### Operating System _No response_ ### Terminal _No response_
yindo added the bug label 2026-02-16 17:41:20 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 22, 2025):

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

  • #5858: TypeError: undefined is not an object crash on start after v1.0.180 update
  • #5859: "UnknownError" on startup

Both issues report the exact same error: TypeError: undefined is not an object (evaluating 'Provider2.sort(Object.values(item.models))[0].id') which appears to be related to models.json issues and cache corruption.

You mentioned you can fix it temporarily by removing cache or models.json - this aligns with the root cause being cached/corrupted model configuration data.

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

@github-actions[bot] commented on GitHub (Dec 22, 2025): This issue might be a duplicate of existing issues. Please check: - #5858: TypeError: undefined is not an object crash on start after v1.0.180 update - #5859: "UnknownError" on startup Both issues report the exact same error: `TypeError: undefined is not an object (evaluating 'Provider2.sort(Object.values(item.models))[0].id')` which appears to be related to models.json issues and cache corruption. You mentioned you can fix it temporarily by removing cache or models.json - this aligns with the root cause being cached/corrupted model configuration data. Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Dec 22, 2025):

hm this looks like huggingfae specific isssue weird… can u reliably reproduce?

@rekram1-node commented on GitHub (Dec 22, 2025): hm this looks like huggingfae specific isssue weird… can u reliably reproduce?
Author
Owner

@rekram1-node commented on GitHub (Dec 22, 2025):

does this happen w a particular model?

@rekram1-node commented on GitHub (Dec 22, 2025): does this happen w a particular model?
Author
Owner

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

So, not reliably no, and so far only with opus 4.5

@ramarivera commented on GitHub (Dec 22, 2025): So, not reliably no, and so far only with opus 4.5
Author
Owner

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

but about huggingface, I am almost sure I am not using any model from them 🤔

@ramarivera commented on GitHub (Dec 22, 2025): but about huggingface, I am almost sure I am not using any model from them 🤔
Author
Owner

@rekram1-node commented on GitHub (Dec 22, 2025):

Oh ig it's just a package from hugging face that i guess the ai sdk imports and uses.

I haven't heard other reports of this issue... very strange

@rekram1-node commented on GitHub (Dec 22, 2025): Oh ig it's just a package from hugging face that i guess the ai sdk imports and uses. I haven't heard other reports of this issue... very strange
Author
Owner

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

So, it keeps happening more and more now, it usually happens on the second message.
Clearing the opencode cache helps for one conversation and then it happens again :(

Is there some logs or info I could gather to improve debugging or traceability?

@ramarivera commented on GitHub (Dec 23, 2025): So, it keeps happening more and more now, it usually happens on the second message. Clearing the opencode cache helps for one conversation and then it happens again :( Is there some logs or info I could gather to improve debugging or traceability?
Author
Owner

@rekram1-node commented on GitHub (Dec 23, 2025):

do you have any custom config? can you share the session this happened in?

Seen no other reports of this so I think it is something specific to you

What provider are u usng

@rekram1-node commented on GitHub (Dec 23, 2025): do you have any custom config? can you share the session this happened in? Seen no other reports of this so I think it is something specific to you What provider are u usng
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3748