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(opencode): apply agent variant when no explicit model is configured by 21pounder · Pull Request #24962 · anomalyco/opencode

Conversation

@21pounder

@21pounder 21pounder commented Apr 29, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #21632

Type of change

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

What does this PR do?

In packages/opencode/src/session/prompt.ts:902, the same variable is computed as:

const same = ag.model && model.providerID === ag.model.providerID && model.modelID === ag.model.modelID

When a subagent has no explicit model configured, ag.model is undefined, so same is false. This gates off the ag.variant branch, causing the configured variant to be silently dropped at runtime.

Fix: treat a missing ag.model as "same model" (inherited), so the variant is applied:

const same = !ag.model || (model.providerID === ag.model.providerID && model.modelID === ag.model.modelID)

How did you verify your code works?

Added a temporary debug log at line 908 to trace variant resolution, then ran the subagent before and after the fix.

Before fix: agVariant=high is present but variant is missing (undefined).
After fix: variant=high is correctly resolved.

Screenshots / recordings

Subagent running (configured with variant: "high", no model):

屏幕截图 2026-04-29 220444

Before fix — agVariant=high but variant missing:

屏幕截图 2026-04-29 221003

After fix — variant=high correctly resolved:

屏幕截图 2026-04-29 221109

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.

ezralazuardy and subnix reacted with hooray emoji 0serna and allmazz reacted with heart emoji
All reactions
  • 🎉 2 reactions
  • ❤️ 2 reactions
@21pounder
fix(session): apply agent variant when no explicit model is configured
4c59e2c
@github-actions github-actions Bot added contributor needs:compliance This means the issue will auto-close after 2 hours. labels Apr 29, 2026
@github-actions

github-actions Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found several related PRs that address variant inheritance and agent configuration:

Potentially Related PRs:

  1. fix(opencode): Subtasks and task calls don’t inherit selected thinking level #20742 - fix(opencode): Subtasks and task calls don't inherit selected thinking level

    • Directly related: addresses variant/thinking level inheritance for subagents, which is the same core issue
  2. feat(task): pass variant to subagent so it inherits parent's thinking level #12567 - feat(task): pass variant to subagent so it inherits parent's thinking level

    • Related: implements variant inheritance for subagents from parent agents
  3. fix(acp): sync model and variant when activating session modes #18663 - fix(acp): sync model and variant when activating session modes

    • Related: addresses syncing model and variant configuration
  4. fix(acp): session/set_mode now activates agent's configured model #18621 - fix(acp): session/set_mode now activates agent's configured model

    • Related: handles agent model configuration activation

These PRs all touch on similar areas of agent variant/model configuration and inheritance, particularly for subagents. PR #20742 appears most closely related as it specifically addresses thinking level (variant) inheritance for subtasks.

All reactions

Sorry, something went wrong.

Uh oh!

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

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Apr 29, 2026
@github-actions

github-actions Bot commented Apr 29, 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.

@21pounder
Merge branch 'dev' into fix/subagent-variant-inheritance
b9eee0c
@github-actions github-actions Bot mentioned this pull request Apr 30, 2026
📊 AI CLI 工具社区动态日报 2026-04-30 borq168/radar-forge#79
Open
21pounder added 2 commits April 30, 2026 16:59
@21pounder
Merge branch 'dev' into fix/subagent-variant-inheritance
684bc15
@21pounder
Merge branch 'dev' into fix/subagent-variant-inheritance
d039ef2
@github-actions github-actions Bot mentioned this pull request May 24, 2026
fix(opencode): preserve subagent model variants #29066
Closed
3 of 6 tasks
@21pounder
Merge branch 'dev' into fix/subagent-variant-inheritance
94ae34e
@rekram1-node

rekram1-node commented Jun 5, 2026

Copy link
Copy Markdown
Member

PR has no file changes

All reactions

Sorry, something went wrong.

Uh oh!

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

@rekram1-node rekram1-node closed this Jun 5, 2026
@21pounder
21pounder deleted the fix/subagent-variant-inheritance branch June 5, 2026 13:15
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

contributor

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

subagent model variants are parsed but not applied at runtime in v1.4.0

Uh oh!

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

2 participants

@21pounder @rekram1-node
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.