feat(agent-tools): add model discovery for subagent selection#1644
Merged
Conversation
- Add a read-only deferred ListModels tool for enabled BitFun model configurations. - Support fuzzy model lookup and exact primary/fast default-selector resolution. - Return provider_bane, model_id, and model_name in a compact Markdown table without exposing sensitive configuration fields. - Register ListModels in the product tool plan, runtime materialization, deferred and readonly registry contracts. - Expose ListModels to Task-capable built-in modes and default custom modes. - Add ListModels to the Agents Scene delegation group and cover tool grouping, model lookup, registry, and default-mode contracts.
- derive new model configuration IDs from the model name instead of timestamps - avoid existing and reserved selector IDs with deterministic numeric suffixes - cover collision and reserved-ID allocation behavior
- interpret model_id=inherit as an explicit parent-session model override - apply the override to fresh, forked, and resumed subagent sessions - document model selection, configured model discovery, and model-slot semantics - cover inheritance parsing and subagent model-resolution paths
wsp1911
marked this pull request as ready for review
July 20, 2026 08:23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
ListModelsfor discovering enabled configured models in a compact Markdown table.Task(model_id: "inherit")to explicitly force the parent session model for fresh, forked, and resumed subagents.Fixes #
Type and Areas
Type:
Feature
Areas:
Rust core, agent runtime/tool contracts, Web UI model configuration, Agents Scene
Motivation / Impact
Agents can now discover valid configured model IDs before delegating work, without exposing sensitive provider configuration.
New model configurations receive stable, meaningful IDs instead of timestamp-based IDs. Existing IDs remain unchanged.
Task calls retain their existing default model-selection behavior when
model_idis omitted. Settingmodel_idtoinheritexplicitly overrides subagent defaults with the parent session model.Verification
pnpm --dir src/web-ui run test:run src/infrastructure/config/services/modelConfigs.test.tspnpm run type-check:webcargo test -p bitfun-core --lib inheritcargo test -p bitfun-core --lib fork_subagent_request_allows_requested_model_overridepnpm run fmt:rsgit diff --checkReviewer Notes
ListModelsonly returns enabled models and searches only its returned fields: provider name, configuration ID, and model name.primaryandfastremain user-configured selector slots;inheritis reserved as an explicit Task control value.inheritis intentionally not selectable through Task.Checklist