GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [Bug] Subagent spawned via Task tool uses global config model instead of inheriting parent session's active model · Issue #17870 · anomalyco/opencode

[Bug] Subagent spawned via Task tool uses global config model instead of inheriting parent session's active model #17870

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
[Bug] Subagent spawned via Task tool uses global config model instead of inheriting parent session's active model#17870
Copy link
Assignees
rekram1-node

Description

@gexdigital
gexdigital
opened on Mar 17, 2026
Issue body actions

Description

When a primary agent running a non-default model (e.g. selected interactively or different from opencode.json) spawns a subagent via the Task tool, the subagent ignores the parent's active session model and falls back to the global "model" defined in opencode.json.

The docs state:

"If you don't specify a model, subagents will use the model of the primary agent that invoked the subagent."

This does not happen in practice when the session model differs from the global config.

Expected behavior: Subagent inherits the active model of the parent session that invoked it.

Actual behavior: Subagent uses the global config default (opencode.json "model" field), ignoring the parent's active session model.

Related issues:

  • [FEATURE]: Dynamic model selection for subagents via Task tool #6651 — feature request for dynamic model selection via Task tool
    • feat: add model parameter to Task tool for dynamic subagent model selection #14961 — PR adding explicit model param to Task tool (workaround, not a fix for auto-inheritance)

Plugins

No response

OpenCode version

v1.2.27

Steps to reproduce

  1. Set "model": "azure/gpt-4o" in opencode.json (global default)
    1. Start an opencode session and switch to anthropic/claude-sonnet-4-6 interactively via the model picker
    1. Primary agent (running claude-sonnet-4-6) invokes a subagent via the Task tool — no explicit model param passed
    1. Observe: subagent runs on azure/gpt-4o (global default) instead of anthropic/claude-sonnet-4-6 (parent's active model)

Screenshot and/or share link

No response

Operating System

Linux (Ubuntu 24.04)

Terminal

opencode TUI

Activity

  1. gexdigital
    added
    bugSomething isn't working
    on Mar 17, 2026
  2. github-actions
    assigned
    rekram1-node
    on Mar 17, 2026
  3. github-actions
    added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 17, 2026
  4. github-actions commented on Mar 17, 2026

    @github-actions
    github-actionsBot
    on Mar 17, 2026 – with GitHub Actions
    Contributor
    More actions

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

    • Subtask commands do not inherit model #6928: Subtask commands do not inherit model — reports the same behavior where subagents don't inherit the parent session's active model
    • The selected model is not taken into account #7211: The selected model is not taken into account — related issue about model selection not being respected
  5. rjmorales13
    added 2 commits that reference this issue on Mar 23, 2026

    feat(plugin): add chat.model hook for dynamic model routing for token…

    f7b1cf8

    feat: add chat.model hook with reference token-optimizer plugin

    8c23eea
  6. thdxr
    removed
    bugSomething isn't working
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  7. github-actions commented on Jul 7, 2026

    @github-actions
    github-actionsBot
    on Jul 7, 2026 – with GitHub Actions
    Contributor
    More actions

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  8. github-actions
    closed this as not plannedon Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @rekram1-node
    rekram1-node

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

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.