using agents (without a model in the config) shows: TypeError: undefined is not an object (evaluating 'Q.model') #913

Closed
opened 2026-02-16 17:28:45 -05:00 by yindo · 7 comments
Owner

Originally created by @michabbb on GitHub (Jul 25, 2025).

Originally assigned to: @thdxr on GitHub.

Task[phpstan_error_fixer] Fix PHPStan errors
TypeError: undefined is not an object (evaluating 'Q.model')

see #1306

Originally created by @michabbb on GitHub (Jul 25, 2025). Originally assigned to: @thdxr on GitHub. ```txt Task[phpstan_error_fixer] Fix PHPStan errors TypeError: undefined is not an object (evaluating 'Q.model') ``` see #1306
yindo closed this issue 2026-02-16 17:28:45 -05:00
Author
Owner

@thdxr commented on GitHub (Jul 25, 2025):

can i see your config? im not able to reproduce this

@thdxr commented on GitHub (Jul 25, 2025): can i see your config? im not able to reproduce this
Author
Owner

@michabbb commented on GitHub (Jul 25, 2025):

i don´t have this file: ~/.config/opencode/opencode.json but if have this one: ~/.opencode.json - don´t know if that´s the right one or an old one:

{
  "data": {},
  "agents": {
    "primary": {
      "model": "deepseek-r1-distill-llama-70b",
      "maxTokens": 50000,
      "reasoningEffort": ""
    }
  },
  "tui": {
    "theme": "monokai"
  },
  "shell": {}
}

or did you mean the agent config file ? if yes, see #1306

@michabbb commented on GitHub (Jul 25, 2025): i don´t have this file: `~/.config/opencode/opencode.json` but if have this one: `~/.opencode.json` - don´t know if that´s the right one or an old one: ```json { "data": {}, "agents": { "primary": { "model": "deepseek-r1-distill-llama-70b", "maxTokens": 50000, "reasoningEffort": "" } }, "tui": { "theme": "monokai" }, "shell": {} } ``` or did you mean the agent config file ? if yes, see #1306
Author
Owner

@michabbb commented on GitHub (Jul 30, 2025):

same problem saying "hi" to huggingface/Qwen/Qwen3-235B-A22B-Thinking-2507

Image

maybe because of https://github.com/sst/models.dev/issues/92 ? 🤔

@michabbb commented on GitHub (Jul 30, 2025): same problem saying "hi" to `huggingface/Qwen/Qwen3-235B-A22B-Thinking-2507` <img width="681" height="965" alt="Image" src="https://github.com/user-attachments/assets/59d60f4c-2eaa-4cde-8668-42f86dce86b3" /> maybe because of https://github.com/sst/models.dev/issues/92 ? 🤔
Author
Owner

@alexeypolitov commented on GitHub (Jul 31, 2025):

have related error in 0.3.107

Image
@alexeypolitov commented on GitHub (Jul 31, 2025): have related error in 0.3.107 <img width="1920" height="1080" alt="Image" src="https://github.com/user-attachments/assets/c7b6a92b-6ad0-4c99-9b80-b1908f8ff915" />
Author
Owner

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

related: #1641

@rekram1-node commented on GitHub (Aug 5, 2025): related: #1641
Author
Owner

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

[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

@rekram1-node commented on GitHub (Dec 27, 2025): [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!
Author
Owner

@gempir commented on GitHub (Jan 5, 2026):

Did anyone figure out what this was? I had it happen quite a few times.

I have a config like this.

    "provider": {
        "openrouter": {
            "npm": "@ai-sdk/openai-compatible",
            "options": {
                "baseURL": "https://openrouter.ai/api/v1",
                "apiKey": "{{ opencode__openrouter_api_key }}"
            },
            "models": {
                "openrouter/minimax/minimax-m2.1": {}
            }
        }
    },
    "agent": {
        "default": {
            "mode": "primary",
            "model": "openrouter/minimax/minimax-m2.1",
            "description": "Developer agent for analyzing, implementing, and testing code changes",
            "prompt": "{file:/app/env/default.md}",
ERROR 2026-01-05T11:46:19 +0ms service=default e=undefined is not an object (evaluating 'agent.model') rejection

Is what i see in the logs.

@gempir commented on GitHub (Jan 5, 2026): Did anyone figure out what this was? I had it happen quite a few times. I have a config like this. ``` "provider": { "openrouter": { "npm": "@ai-sdk/openai-compatible", "options": { "baseURL": "https://openrouter.ai/api/v1", "apiKey": "{{ opencode__openrouter_api_key }}" }, "models": { "openrouter/minimax/minimax-m2.1": {} } } }, "agent": { "default": { "mode": "primary", "model": "openrouter/minimax/minimax-m2.1", "description": "Developer agent for analyzing, implementing, and testing code changes", "prompt": "{file:/app/env/default.md}", ``` ``` ERROR 2026-01-05T11:46:19 +0ms service=default e=undefined is not an object (evaluating 'agent.model') rejection ``` Is what i see in the logs.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#913