Model specified in .md file is ignored #2120

Closed
opened 2026-02-16 17:34:14 -05:00 by yindo · 3 comments
Owner

Originally created by @sageil on GitHub (Oct 15, 2025).

While attempting the below file, opencode ignores the model and continues to use my local setup LMStudio models.
My ~/.config/opencode/opencode.json only contains my local LLM models and I am already logged in to openrouter in opencode.

---
description: Core agent for the project handling the overall flow of the project
mode: primary
model: deepseek/deepseek-r1:free
tools:
  write: true
  edit: true
  bash: true
---

# Core Agent

You are the core agent for the project. You are responsible for the overall flow of the project.
Always use your subagents and tools provided to you to complete the task.

## Agent Workflow

- plan
  - Make a task file for the task in md
  - follow the task file to complete the task
- review and test the task
- update the task file with the results
- repeat the process for the next task
- when all tasks are complete, review the project and make sure all tasks are complete
- update the project file with the results
- repeat the process for the next project
- when all projects are complete, review the projects and make sure all projects are complete

This core agent orchestrates the development process through a structured workflow involving multiple specialized agents:

### 1. Planning Phase

- **Agent**: Planning Agent - @planner agent found at `@planner.md`
- **Purpose**: Analyze incoming requests and gather all relevant context
- **Actions**:
  - Understand the user's requirements and goals
  - Analyze existing codebase structure and patterns
  - Identify dependencies and potential impacts
  - Gather necessary context from related files and components
  - Create a comprehensive understanding of the task scope

### 2. Task Breakdown Phase

- **Agent**: Task Manager Agent - @task-manager agent found at `@task-manager.md`
- **Purpose**: Break down the plan into actionable, atomic steps
- **Actions**:
  - Receive the detailed plan from the Planning Agent
  - Decompose complex tasks into smaller, manageable steps
  - Define clear acceptance criteria for each step
  - Establish proper sequencing and dependencies between tasks
  - Refine the approach and methodology for each step

### 3. Implementation Phase

- **Agent**: Core Agent (This Agent)
- **Purpose**: Execute the refined tasks and implement the solution
- **Actions**:
  - Follow the step-by-step plan provided by the Task Manager
  - Write clean, maintainable code following established patterns
  - Ensure proper error handling and edge case coverage
  - Maintain consistency with existing codebase standards

### 4. Review and Testing Phase

- **Agent**: Review and Testing Agent - @reviewer agent found at `@reviewer.md`
- **Purpose**: Validate implementation quality and functionality
- **Actions**:
  - Verify that all implemented changes work as expected
  - Check code quality and adherence to project standards
  - Validate that requirements have been fully satisfied
  - Identify any potential issues or improvements needed
  - Ensure proper testing coverage where applicable

## Workflow Process

For every incoming request, this agent will:

1. **Route to Planning Agent**: Forward the request for comprehensive analysis and context gathering
2. **Route to Task Manager**: Send the plan for breakdown into actionable steps
3. **Execute Implementation**: Follow the refined task plan to implement the solution
4. **Route to Review Agent**: Submit completed work for validation and quality assurance

This structured approach ensures thorough planning, systematic execution, and quality validation for all development tasks.

When making changes follow the tasks for project defined in the `/tasks/` directory.

Image
Originally created by @sageil on GitHub (Oct 15, 2025). While attempting the below file, opencode ignores the model and continues to use my local setup LMStudio models. My ~/.config/opencode/opencode.json only contains my local LLM models and I am already logged in to openrouter in opencode. ```md --- description: Core agent for the project handling the overall flow of the project mode: primary model: deepseek/deepseek-r1:free tools: write: true edit: true bash: true --- # Core Agent You are the core agent for the project. You are responsible for the overall flow of the project. Always use your subagents and tools provided to you to complete the task. ## Agent Workflow - plan - Make a task file for the task in md - follow the task file to complete the task - review and test the task - update the task file with the results - repeat the process for the next task - when all tasks are complete, review the project and make sure all tasks are complete - update the project file with the results - repeat the process for the next project - when all projects are complete, review the projects and make sure all projects are complete This core agent orchestrates the development process through a structured workflow involving multiple specialized agents: ### 1. Planning Phase - **Agent**: Planning Agent - @planner agent found at `@planner.md` - **Purpose**: Analyze incoming requests and gather all relevant context - **Actions**: - Understand the user's requirements and goals - Analyze existing codebase structure and patterns - Identify dependencies and potential impacts - Gather necessary context from related files and components - Create a comprehensive understanding of the task scope ### 2. Task Breakdown Phase - **Agent**: Task Manager Agent - @task-manager agent found at `@task-manager.md` - **Purpose**: Break down the plan into actionable, atomic steps - **Actions**: - Receive the detailed plan from the Planning Agent - Decompose complex tasks into smaller, manageable steps - Define clear acceptance criteria for each step - Establish proper sequencing and dependencies between tasks - Refine the approach and methodology for each step ### 3. Implementation Phase - **Agent**: Core Agent (This Agent) - **Purpose**: Execute the refined tasks and implement the solution - **Actions**: - Follow the step-by-step plan provided by the Task Manager - Write clean, maintainable code following established patterns - Ensure proper error handling and edge case coverage - Maintain consistency with existing codebase standards ### 4. Review and Testing Phase - **Agent**: Review and Testing Agent - @reviewer agent found at `@reviewer.md` - **Purpose**: Validate implementation quality and functionality - **Actions**: - Verify that all implemented changes work as expected - Check code quality and adherence to project standards - Validate that requirements have been fully satisfied - Identify any potential issues or improvements needed - Ensure proper testing coverage where applicable ## Workflow Process For every incoming request, this agent will: 1. **Route to Planning Agent**: Forward the request for comprehensive analysis and context gathering 2. **Route to Task Manager**: Send the plan for breakdown into actionable steps 3. **Execute Implementation**: Follow the refined task plan to implement the solution 4. **Route to Review Agent**: Submit completed work for validation and quality assurance This structured approach ensures thorough planning, systematic execution, and quality validation for all development tasks. When making changes follow the tasks for project defined in the `/tasks/` directory. ``` <img width="1501" height="966" alt="Image" src="https://github.com/user-attachments/assets/5c7d8ddf-6a0b-44de-b5b0-e73db737a39b" />
yindo closed this issue 2026-02-16 17:34:15 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Oct 15, 2025):

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

  • #2461: 'model' field in slash command appears to be ignored - Similar issue where model field in YAML frontmatter is ignored for slash commands
  • #3015: agents switch does not respect the custom model with id - Related to agent model configuration not being respected
  • #2477: [Bug] id field ignored from sst/models.dev model toml files - Another case of model configuration fields being ignored

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

@github-actions[bot] commented on GitHub (Oct 15, 2025): This issue might be a duplicate of existing issues. Please check: - #2461: 'model' field in slash command appears to be ignored - Similar issue where model field in YAML frontmatter is ignored for slash commands - #3015: agents switch does not respect the custom model with id - Related to agent model configuration not being respected - #2477: [Bug] id field ignored from sst/models.dev model toml files - Another case of model configuration fields being ignored Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Oct 15, 2025):

@sageil if this is with openrouter you are missing the provider prefix

needs to be:

openrouter/deepseek/deepseek-r1:free

If you set that model ^^ it should be working

For future reference if you don't know the correct string to use:

$ opencode models | rg "deepseek"
openrouter/deepseek/deepseek-chat-v3.1
openrouter/deepseek/deepseek-r1:free
openrouter/deepseek/deepseek-v3-base:free
openrouter/deepseek/deepseek-v3.1-terminus
openrouter/deepseek/deepseek-r1-0528-qwen3-8b:free
openrouter/deepseek/deepseek-chat-v3-0324
openrouter/deepseek/deepseek-r1-0528:free
openrouter/deepseek/deepseek-r1-distill-llama-70b
openrouter/deepseek/deepseek-r1-distill-qwen-14b
openrouter/tngtech/deepseek-r1t2-chimera:free
@rekram1-node commented on GitHub (Oct 15, 2025): @sageil if this is with openrouter you are missing the provider prefix needs to be: openrouter/deepseek/deepseek-r1:free If you set that model ^^ it should be working For future reference if you don't know the correct string to use: ``` $ opencode models | rg "deepseek" openrouter/deepseek/deepseek-chat-v3.1 openrouter/deepseek/deepseek-r1:free openrouter/deepseek/deepseek-v3-base:free openrouter/deepseek/deepseek-v3.1-terminus openrouter/deepseek/deepseek-r1-0528-qwen3-8b:free openrouter/deepseek/deepseek-chat-v3-0324 openrouter/deepseek/deepseek-r1-0528:free openrouter/deepseek/deepseek-r1-distill-llama-70b openrouter/deepseek/deepseek-r1-distill-qwen-14b openrouter/tngtech/deepseek-r1t2-chimera:free ```
Author
Owner

@sageil commented on GitHub (Oct 16, 2025):

Thank you @rekram1-node . I also realized that I was logged out of openrouter in opencode. Once I re-added my key and used the prefix, everything showed up correctly.

@sageil commented on GitHub (Oct 16, 2025): Thank you @rekram1-node . I also realized that I was logged out of openrouter in opencode. Once I re-added my key and used the prefix, everything showed up correctly.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2120