Skip to content

feat: allow experimental task model selection - #13557

Merged
marius-kilocode merged 2 commits into
mainfrom
enable-configurable-subagent-model-selection
Aug 31, 2026
Merged

feat: allow experimental task model selection#13557
marius-kilocode merged 2 commits into
mainfrom
enable-configurable-subagent-model-selection

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Internal Task subagents cannot select a model, provider, or reasoning effort for an individual task. An orchestrator must use the configured subagent defaults or switch to Agent Manager sessions, even when an internal subagent is the correct workflow.

Why This Change Was Made

Add the opt-in experimental.task_model_selection config flag and expose it in Kilo's Experimental settings. It uses the existing Save/Discard and backend config refresh path, rather than a startup-only environment variable. Saving the setting refreshes cached Task schemas without restarting the backend.

Task and Agent Manager share model lookup, provider preference, ambiguity handling, and variant validation. Invalid explicit selections fail before creating a child session instead of silently falling back to another model.

User Impact

  • The experiment is off by default. Existing subagent defaults and flag-off behavior remain unchanged.
  • After enabling Task Subagent Model Selection and clicking Save, Task accepts model, provider, and variant overrides. An orchestrator can use agent_manager_models to discover valid choices.
  • Model discovery works from the VS Code sidebar as well as Agent Manager. Internal subagents do not require opening Agent Manager or creating worktrees. Other CLI clients receive the discovery tool when the experiment is enabled.
  • Resumed tasks retain their last model and reasoning variant unless overridden. A model override does not inherit the parent's reasoning effort.
  • Background completion preserves the parent's latest model and reasoning selection rather than applying the child's overrides to the parent.

Evidence

  • 200 focused tests passed, including model/provider/variant validation, foreground and background paths, resume behavior, draft/discard/save behavior, and refreshing cached tool schemas across two workspaces on one server.
  • Workspace typechecks, extension compilation, lint, and affected ownership guards passed. Root lint excluded ignored nested development worktrees and reported existing warnings.
  • Isolated VS Code verification covered Save/Discard, live enable/disable on the same backend process, and persistence after a fresh launch.
  • A sidebar run started three internal tasks, one background and two foreground, against a local test endpoint using the Gateway SDK. Captured requests selected three distinct models with low, medium, and high reasoning, and the saved child session metadata matched. This verifies local routing and serialization, not whether a live upstream provider honors a reasoning setting.
  • The cloud-hosted config editor schema mirror is maintained in the separate cloud repository and is not included in this PR.

Task Subagent Model Selection enabled in Kilo Experimental settings

@kilo-code-bot

kilo-code-bot Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (39 files)
  • .changeset/task-model-selection.md
  • packages/core/src/v1/config/config.ts
  • packages/kilo-vscode/tests/unit/task-model-selection.test.ts
  • packages/kilo-vscode/webview-ui/src/components/settings/ExperimentalTab.tsx
  • packages/kilo-vscode/webview-ui/src/i18n/ar.ts
  • packages/kilo-vscode/webview-ui/src/i18n/br.ts
  • packages/kilo-vscode/webview-ui/src/i18n/bs.ts
  • packages/kilo-vscode/webview-ui/src/i18n/da.ts
  • packages/kilo-vscode/webview-ui/src/i18n/de.ts
  • packages/kilo-vscode/webview-ui/src/i18n/en.ts
  • packages/kilo-vscode/webview-ui/src/i18n/es.ts
  • packages/kilo-vscode/webview-ui/src/i18n/fa.ts
  • packages/kilo-vscode/webview-ui/src/i18n/fr.ts
  • packages/kilo-vscode/webview-ui/src/i18n/it.ts
  • packages/kilo-vscode/webview-ui/src/i18n/ja.ts
  • packages/kilo-vscode/webview-ui/src/i18n/ko.ts
  • packages/kilo-vscode/webview-ui/src/i18n/nl.ts
  • packages/kilo-vscode/webview-ui/src/i18n/no.ts
  • packages/kilo-vscode/webview-ui/src/i18n/pl.ts
  • packages/kilo-vscode/webview-ui/src/i18n/ru.ts
  • packages/kilo-vscode/webview-ui/src/i18n/th.ts
  • packages/kilo-vscode/webview-ui/src/i18n/tr.ts
  • packages/kilo-vscode/webview-ui/src/i18n/uk.ts
  • packages/kilo-vscode/webview-ui/src/i18n/zh.ts
  • packages/kilo-vscode/webview-ui/src/i18n/zht.ts
  • packages/kilo-vscode/webview-ui/src/types/messages/config.ts
  • packages/opencode/src/kilocode/tool/agent-manager-models.ts
  • packages/opencode/src/kilocode/tool/agent-manager.ts
  • packages/opencode/src/kilocode/tool/model-selection.ts
  • packages/opencode/src/kilocode/tool/registry.ts
  • packages/opencode/src/kilocode/tool/task.ts
  • packages/opencode/src/tool/task.ts
  • packages/opencode/test/kilocode/agent-manager-models-tool.test.ts
  • packages/opencode/test/kilocode/server/config-overlay.test.ts
  • packages/opencode/test/kilocode/tool-registry-indexing.test.ts
  • packages/opencode/test/kilocode/tool-task-model.test.ts
  • packages/opencode/test/tool/__snapshots__/parameters.test.ts.snap
  • packages/sdk/js/src/v2/gen/types.gen.ts
  • packages/sdk/openapi.json

Reviewed by grok-4.6 · Input: 466.8K · Output: 37K · Cached: 1.9M

Review guidance: REVIEW.md from base branch main

@marius-kilocode
marius-kilocode merged commit f4b7c41 into main Aug 31, 2026
34 checks passed
@marius-kilocode
marius-kilocode deleted the enable-configurable-subagent-model-selection branch August 31, 2026 08:00
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