Skip to content

feat(agentic): support configurable subagent models - #1599

Merged
wsp1911 merged 1 commit into
GCWing:mainfrom
wsp1911:dev
Jul 17, 2026
Merged

feat(agentic): support configurable subagent models#1599
wsp1911 merged 1 commit into
GCWing:mainfrom
wsp1911:dev

Conversation

@wsp1911

@wsp1911 wsp1911 commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Consolidate mode and subagent selectors under ai.agent_model_defaults, including legacy configuration normalization and invalid-model reconciliation.
  • Resolve custom, built-in, inherited, and fallback subagent model selections when creating or restoring sessions.
  • Add default and per-subagent model controls across the CLI, desktop/server APIs, and Web UI.
  • Preserve explicit custom-agent Markdown model overrides; propagate model config IDs and effective provider model names through events, history, and token usage.
  • Remove stale remote-workspace policy entries for retired get_agent_models and set_agent_model commands.

Type and Areas

Type: Feature

Areas: Agent runtime, Rust core, config, desktop/Tauri, server RPC, CLI, Web UI, i18n, session and token-usage contracts

Motivation / Impact

Users can set a default model for subagents and override individual built-in or custom subagents. Inherited selections use the parent session model, while explicit custom-agent model declarations remain portable and take precedence.

The model identity recorded for execution, session history, and token usage now distinguishes the configured BitFun model from the effective provider model. Existing legacy agent-model settings are normalized into the new configuration shape.

Verification

git diff --check HEAD^ HEAD
cargo fmt --check

pnpm run type-check:web
pnpm --dir src/web-ui run test:run src/infrastructure/config/services/ConfigManager.test.ts src/flow_chat/services/flow-chat-manager/SessionModule.test.ts src/flow_chat/store/FlowChatStore.test.ts
pnpm run i18n:audit

cargo test -p bitfun-core --lib normal_sessions_keep_the_mode_default_snapshotted_at_creation -- --exact
cargo test -p bitfun-core --lib subagent_model_resolution_prioritizes_explicit_fixed_and_inherited_values -- --exact
cargo test -p bitfun-agent-runtime --test custom_subagent_contracts custom_subagent_model_presence_distinguishes_default_from_fast_override -- --exact
cargo test -p bitfun-services-core --test token_usage_contracts token_usage_record_preserves_model_identity_and_cached_availability_default -- --exact
cargo test -p bitfun-desktop every_registered_command_declares_a_remote_workspace_policy -- --exact

cargo check --workspace

Reviewer Notes

  • This is intentionally cross-surface: model selection must remain consistent across persisted config, session creation, agent delegation, desktop/server/CLI boundaries, and Web UI state.
  • Review model precedence together with the model_config_id / effective_model_name event and persistence contract changes.
  • The remote-workspace policy cleanup keeps the command-policy registry synchronized with the post-refactor desktop command list.

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 and locales are updated.

@wsp1911
wsp1911 marked this pull request as ready for review July 17, 2026 13:54
- consolidate mode and subagent model defaults under ai.agent_model_defaults, with legacy migration and invalid-model reconciliation
- resolve explicit, built-in, inherited, and fallback subagent selectors when creating or restoring child sessions
- expose default and per-subagent model selection across the CLI, desktop/server APIs, and Web UI while preserving explicit custom-agent front matter
- carry model configuration and effective provider model identities through execution events, chat history, and token usage, and prevent stale config reads from overwriting updates
@wsp1911
wsp1911 merged commit 4d73585 into GCWing:main Jul 17, 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