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 — fix(session): agent.model and agent.variant config ignored in handleSubtask by naveen9036 · Pull Request #36281 · anomalyco/opencode

Conversation

@naveen9036

@naveen9036 naveen9036 commented Jul 10, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Issue for this PR

Closes #36250

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Fixes two bugs in handleSubtask where agent.model and agent.variant configured in opencode.json are silently ignored when a subagent is spawned.

  1. taskAgent was being fetched after taskModel was already resolved, meaning the agent's configured model was never consulted.
  2. variant was hardcoded to the parent session's variant, ignoring agent.variant.

Fix: Moved the taskAgent fetch before taskModel resolution, added taskAgent.model to the fallback chain, and prioritized taskAgent.variant over the parent session's variant.

How did you verify your code works?

Tested locally with Ollama to ensure the subagent correctly switches to the configured model from opencode.json. Also verified that bun run typecheck passes cleanly with 0 errors.

Screenshots / recordings

N/A (Backend logic fix, no UI changes)

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mariusg0000, samiralibabic, aarjbdea, and 5ki reacted with thumbs up emoji
All reactions
  • 👍 4 reactions
naveen9036 and others added 2 commits July 10, 2026 15:49
@naveen9036
fix(session): respect agent.model and agent.variant in handleSubtask
5fc279d
- Move taskAgent fetch before taskModel resolution so the agent's
  configured model is available when deciding which model to use
- Add taskAgent.model as middle tier in the fallback chain:
  task.model > agent.model > parent session model
- Use taskAgent.variant as preference over parent session variant

Closes anomalyco#21632
Re-fixes anomalyco#21952
@naveen9036
Merge branch 'dev' into fix/subagent-model-variant-override
72dd1f4
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Jul 10, 2026
@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@naveen9036
Merge branch 'dev' into fix/subagent-model-variant-override
671f9d4
@aarjbdea

aarjbdea commented Jul 24, 2026

Copy link
Copy Markdown

This is an issue we have also noticed. I have just tested this locally and it works great!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Jul 24, 2026
📊 AI CLI 工具社区动态日报 2026-07-25 litang9/big_model_radar#260
Open
feat(tui): show model variant in subagent footer #38772
Closed
@thdxr

thdxr commented Oct 10, 2026

Copy link
Copy Markdown
Member

This branch has been upgraded to V2. We're no longer taking PRs for V1. If you think this is still relevant, please port it over and open it for V2.

— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thdxr thdxr closed this Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

bug(session): agent.model and agent.variant config ignored in handleSubtask

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@naveen9036 @aarjbdea @thdxr
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.