Skip to content

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

Closed

Description

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

see #1306

Activity

  1. thdxr commented on Jul 25, 2025

    @thdxr
    Member

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

  2. self-assigned this
    on Jul 25, 2025
  3. michabbb commented on Jul 25, 2025

    @michabbb
    Author

    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

  4. michabbb commented on Jul 30, 2025

    @michabbb
    Author

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

    Image

    maybe because of anomalyco/models.dev#92 ? 🤔

  5. alexeypolitov commented on Aug 1, 2025

    @alexeypolitov

    have related error in 0.3.107

    Image
  6. rekram1-node commented on Aug 6, 2025

    @rekram1-node
    Contributor

    related: #1641

  7. rekram1-node commented on Dec 28, 2025

    @rekram1-node
    Contributor

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

  8. gempir commented on Jan 5, 2026

    @gempir

    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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions