fix(task): preserve command-selected models for command-triggered subtasks#26117
fix(task): preserve command-selected models for command-triggered subtasks#26117gmnstr wants to merge 1 commit intoanomalyco:devfrom
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate FoundPR #18752: "fix: preserve explicit model selection in command subtasks" This appears to be addressing the exact same issue as the current PR #26117. Both PRs aim to preserve command-selected models for command-triggered subtasks and prevent them from losing their model selection when spawning child subagent sessions. Why they're related:
|
|
While reviewing upstream history after opening this, I found that #18752 is already open and overlaps heavily with this PR. Both changes preserve command/subtask model selection through the delegation path and touch the same routing/test files.\n\nThe reason I’m leaving this open for now is that this version tries to keep the fix narrowly scoped to command-triggered subtasks and preserve existing behavior for ordinary/manual subtasks:\n- only forwards the internal delegated model for command-triggered subtasks\n- keeps ordinary/manual task-tool fallback behavior unchanged\n- avoids pre-seeding child session agent/model so switch/history behavior stays aligned with existing prompt-time resolution\n- includes regression coverage for fallback behavior and non-authoritative session metadata\n\nIf maintainers would prefer to converge on #18752 instead of reviewing two overlapping fixes, I’m happy to close this and upstream any useful guardrails/tests there. |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Issue for this PR
Closes #18615
Related to #17870
Type of change
What does this PR do?
This fixes the command/subtask delegation path so a command-selected model is preserved when the task tool spawns a child subagent session.
The bug was that a command-triggered subtask could lose its already-resolved model and fall back to the target subagent model or the parent model instead.
This change keeps the fix narrowly scoped:
Why this works:
How did you verify your code works?
From
packages/opencode:bun test --timeout 30000 test/tool/task.test.tsbun test --timeout 30000 test/session/prompt.test.tsAlso ran:
git diff --checkScreenshots / recordings
N/A — no UI changes.
Checklist