Skip to content

fix(cli): preserve default subagent model and reasoning - #13606

Merged
marius-kilocode merged 1 commit into
mainfrom
fix-subagent-model-reasoning-defaults
Aug 31, 2026
Merged

fix(cli): preserve default subagent model and reasoning#13606
marius-kilocode merged 1 commit into
mainfrom
fix-subagent-model-reasoning-defaults

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

What Problem This Solves

With experimental Task model selection enabled, providers that require every advertised field have no null value for leaving model, provider, and reasoning unchanged. The tool instructions also encourage autonomous model choices based on complexity, cost, and latency, which can replace the intended defaults with an unsuitable or older model.

Why This Change Was Made

Keep the normal delegation path unchanged unless an override is explicitly requested. Accept omitted or null selectors as no override, and tell the agent to use catalog lookup only for requested overrides rather than guessing model names. Existing default precedence, resume behavior, and validation of real overrides remain unchanged. This corrects the optional-selection behavior introduced in #13557.

User Impact

Subagents retain their normal model and reasoning settings without requiring the caller to name either. Explicit model selection and reasoning-only overrides still work. The experiment remains opt-in.

Evidence

  • Reproduced null-argument rejection and the non-nullable advertised schema before the fix.
  • 177 focused tests pass across Task model resolution, parameter schemas, config overlays, and existing Task behavior. The 146-test selection/schema/config set also passes on the pinned Bun 1.3.14.
  • CLI typecheck and lint pass; lint reports existing warnings only. No shared upstream source changes are needed.
  • A fresh isolated backend with a local fake provider completed omitted-selector, all-null, and reasoning-only override flows. Verified child state, Task results, outgoing HTTP requests, SSE completion, and preservation of parent reasoning.
  • No VS Code UI or real-model instruction-following test was performed.

Manual check: enable Task model selection, delegate without an override, then request only a reasoning change. Confirm the child keeps its normal model and only the requested reasoning changes.

@kilo-code-bot

kilo-code-bot Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (4 files)
  • .changeset/fix-subagent-selection-defaults.md
  • packages/opencode/src/kilocode/tool/task.ts
  • packages/opencode/test/kilocode/tool-task-model.test.ts
  • packages/opencode/test/tool/__snapshots__/parameters.test.ts.snap

Reviewed by grok-4.6 · Input: 128.6K · Output: 9.6K · Cached: 310.4K

Review guidance: REVIEW.md from base branch main

@WebReflection WebReflection left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder when/if TS will stop this madness:

{ field?: type | null }

and introduce something like:

{ field??: type }

which allows both undefined and null as type, following the TC39 Nullish coalescing operator (??) standard https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing

@marius-kilocode
marius-kilocode merged commit 2abc085 into main Aug 31, 2026
32 checks passed
@marius-kilocode
marius-kilocode deleted the fix-subagent-model-reasoning-defaults branch August 31, 2026 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants