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): preserve subagent model variants by sdip15fa · Pull Request #29066 · anomalyco/opencode

Conversation

@sdip15fa

@sdip15fa sdip15fa commented May 24, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Issue for this PR

Closes #29067

Type of change

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

What does this PR do?

Preserves the selected model variant/thinking level when a same-model subagent is created without its own configured variant.

The fix passes the parent assistant variant into the child prompt only when the child uses the same provider/model and has no configured variant. It also lets inherited-model agents apply their configured variant when the provider supports it, and prevents explicit different subtask models from copying the parent variant.

How did you verify your code works?

  • CI=true bun test test/tool/task.test.ts
  • CI=true bun test test/session/prompt.test.ts
  • CI=true bun typecheck
  • pre-push: bun turbo typecheck

Screenshots / recordings

Not applicable; backend prompt/session state fix for a TUI-observed bug.

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.

subnix reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@sdip15fa
fix(opencode): preserve subagent model variants
69f8da6
Copilot AI review requested due to automatic review settings May 24, 2026 05:06
@github-actions github-actions Bot added the needs:issue label May 24, 2026
@github-actions

github-actions Bot commented May 24, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

All reactions

Sorry, something went wrong.

Uh oh!

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

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label May 24, 2026
@github-actions

github-actions Bot commented May 24, 2026

Copy link
Copy Markdown
Contributor

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

I found several related PRs that address similar concerns about model variants and subagent inheritance:

Potential Related PRs

  1. PR 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

    • Directly related: addresses passing model variants from parent agents to subagents
  2. PR fix(opencode): apply agent variant when no explicit model is configured #24962 - fix(opencode): apply agent variant when no explicit model is configured

    • Related: handles agent variant application in similar scenarios
  3. PR feat: add agent default variant handling in TUI and desktop #7156 - feat: add agent default variant handling in TUI and desktop

    • Related: covers agent variant handling broadly
  4. PR feat(agent): implement model tier selection with variant support for subagents #11377 - feat(agent): implement model tier selection with variant support for subagents

    • Related: implements variant support for subagents

These PRs appear to address the same or overlapping concerns about preserving and inheriting model variants for subagents. PR #12567 seems most directly related as it also deals with passing variants from parent to subagent prompts.

All reactions

Sorry, something went wrong.

Uh oh!

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

Copilot AI reviewed May 24, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR adds and verifies variant inheritance behavior across parent/child agent prompts, ensuring variants are only propagated when the child uses the same model (and no explicit child variant/model is configured).

Changes:

  • Extend test seeding to support setting an assistant variant/model and add new TaskTool variant inheritance tests.
  • Update TaskTool to inherit the parent assistant variant for same-model subagents when the subagent has no configured variant.
  • Update SessionPrompt variant application logic and add tests for agent-variant application and variant non-propagation on explicit model overrides.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
packages/opencode/test/tool/task.test.ts Adds seed options and new TaskTool tests covering variant inheritance and persistence.
packages/opencode/test/session/prompt.test.ts Adds SessionPrompt tests for applying agent variant to inherited models and avoiding variant propagation across explicit model changes.
packages/opencode/src/tool/task.ts Implements parent-variant inheritance for same-model subagent execution when no child variant is configured.
packages/opencode/src/session/prompt.ts Restricts variant propagation to same-model scenarios and broadens when agent variant can apply to inherited/default models.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread packages/opencode/src/session/prompt.ts
)
const model = input.model ?? ag.model ?? (yield* currentModel(input.sessionID))
const same = ag.model && model.providerID === ag.model.providerID && model.modelID === ag.model.modelID
const same = !ag.model || (model.providerID === ag.model.providerID && model.modelID === ag.model.modelID)
Comment thread packages/opencode/test/tool/task.test.ts
Comment on lines +57 to +60
const seed = Effect.fn("TaskToolTest.seed")(function* (
title = "Pinned",
opts?: { assistantVariant?: string; assistantModel?: typeof ref },
) {
@github-actions github-actions Bot removed needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels May 24, 2026
@github-actions

github-actions Bot commented May 24, 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.

@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

All reactions

Sorry, something went wrong.

Uh oh!

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

@github-actions github-actions Bot closed this Jun 24, 2026
@github-actions github-actions Bot added the automated-pr-cleanup label Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments

Uh oh!

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

Assignees

No one assigned

Labels

automated-pr-cleanup

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

TUI drops model variant after entering subagent

Uh oh!

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

2 participants

@sdip15fa
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.