Skip to content

feat(agent-tools): add model discovery for subagent selection#1644

Merged
wsp1911 merged 3 commits into
GCWing:mainfrom
wsp1911:dev
Jul 20, 2026
Merged

feat(agent-tools): add model discovery for subagent selection#1644
wsp1911 merged 3 commits into
GCWing:mainfrom
wsp1911:dev

Conversation

@wsp1911

@wsp1911 wsp1911 commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add deferred, read-only ListModels for discovering enabled configured models in a compact Markdown table.
  • Generate readable configuration IDs from new model names with deterministic collision and reserved-ID suffixes.
  • Allow 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_id is omitted. Setting model_id to inherit explicitly overrides subagent defaults with the parent session model.

Verification

  • Passed pnpm --dir src/web-ui run test:run src/infrastructure/config/services/modelConfigs.test.ts
  • Passed pnpm run type-check:web
  • Passed cargo test -p bitfun-core --lib inherit
  • Passed cargo test -p bitfun-core --lib fork_subagent_request_allows_requested_model_override
  • Passed pnpm run fmt:rs
  • Passed git diff --check

Reviewer Notes

  • ListModels only returns enabled models and searches only its returned fields: provider name, configuration ID, and model name.
  • primary and fast remain user-configured selector slots; inherit is reserved as an explicit Task control value.
  • An existing configured model whose ID is inherit is intentionally not selectable through Task.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

wsp1911 added 3 commits July 20, 2026 16:07
- 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
wsp1911 marked this pull request as ready for review July 20, 2026 08:23
@wsp1911
wsp1911 merged commit 90a16b5 into GCWing:main Jul 20, 2026
5 checks passed
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.

1 participant