GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||
GeezerVison is showing github.com — feat(task): pass variant to subagent so it inherits parent's thinking level by mugnimaestra · Pull Request #12567 · anomalyco/opencode Conversation
|
| Issue | Title | Relevance |
|---|---|---|
| #7138 | Support default variant configuration per agent | Root feature request for per-agent variant control |
| #10320 | Specify sub-agent variant (thinking lvl) from script for token economy | Directly requests parent→child variant passthrough |
| #8123 | Can't set effort when configuring a sub-agent | User pain point this PR alleviates |
| #6645 | Support for Model Variants in (sub)agents | Original feature request for variant support in subagents |
PR #7156 adds a static variant field to agent config so each agent can declare its own default. This PR complements that by handling the dynamic case: when no agent-level variant is configured, the subagent inherits the parent session's variant at spawn time.
Resolution order (with both PRs merged): user input > agent config (#7156) > parent variant (this PR) > model default
These two PRs are independent and merge cleanly; together they fully close the gap described in the issues above.
packages/opencode/src/tool/task.ts — After resolving the subagent, read the parent user message and compute inherited variant. Pass it to SessionPrompt.prompt().packages/opencode/src/provider/sdk/copilot/chat/openai-compatible-chat-language-model.ts — Fix reasoning_opaque handling: the Copilot API can send multiple reasoning_opaque deltas in a single response (e.g. one with reasoning text, another with tool calls). Previously this threw an InvalidResponseDataError; now it accepts the latest value. This fix is required because with thinking variants active, multi-turn Copilot responses hit this edge case.packages/opencode/test/session/prompt-variant.test.ts — Three new tests covering: explicit variant passthrough, parent→child variant inheritance, and no-inherit when agent has own variant.How it works: SessionPrompt.prompt() already supports a variant parameter that gets stored on the user message and used when building the LLM request. The Task tool just wasn't passing it through. The fix reads the parent message (which task.ts already has access to via msg.info.parentID) and conditionally forwards its variant.
bun test packages/opencode/test/session/prompt-variant.test.ts — all 5 tests pass (2 existing + 3 new)variant: "high" — confirmed subagents now show extended thinking output where they previously didn't
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found one potentially related PR: Related PR found:
The other result (PR #7140 - "Add default variant config per agent") is also in the related issues but seems to be older work on agent variant configuration. Conclusion: No duplicate PRs detected. PR #12567 appears to be the only open PR addressing this specific feature of inheriting parent variant settings in the Task tool. The related PRs are complementary work on variant support rather than duplicates. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Manual test video uploaded: manual-testing-subagent-thinking-2x-original.mp4 This recording shows a session using GitHub Copilot provider with variant: high where the subagent now correctly inherits the parent thinking variant and produces extended thinking output. manual-testing-subagent-thinking-2x-original.mp4 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Cover both paths of the task.ts inheritance logic: - subagent without own variant inherits parent's variant - subagent with own variant skips inheritance Co-authored-by: Cursor <[email protected]>
… multi-turn responses
55de3a1 to
ca74d24
Compare
|
Can the variant be specified in the prompt? not preconfigured. 'ask @SpecialAgent with low variant' |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@Solido my PR originally had that feature initially but after some discussion with maintainers we agreed to take it out and deliver just the MVP first, with that feature to come as a follow up |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Fully understandable, need a split for consolidation. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This would be very nice, thanks for your efforts. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
in fact I would expect by default ALL main agent settings are copied. We are using qwen and suddenly where confronted with temperature at 0.55. We have a bunch of other settings too we need in the subagent automatically... (top_k top_p etc) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
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 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
[FEATURE]:Specify sub-agent variant (thinking lvl) from script for token economy
There was an error while loading. Please reload this page.