Skip to content

feat: per-call model + reasoning override with list_models discovery#5446

Open
harshav167 wants to merge 4 commits into
code-yeongyu:devfrom
harshav167:feat/per-call-model-override
Open

feat: per-call model + reasoning override with list_models discovery#5446
harshav167 wants to merge 4 commits into
code-yeongyu:devfrom
harshav167:feat/per-call-model-override

Conversation

@harshav167

@harshav167 harshav167 commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Lets the orchestrator pick a model (and reasoning/variant) per delegation — on task (both subagent_type and category), call_omo_agent, and team members — gated to connected/available models, with the configured default and fallback chain preserved when omitted.
  • Adds a list_models tool so the agent can discover connected provider/model ids and the valid reasoning vocabulary before overriding.
  • Fixes team_create inline members to actually accept model / reasoning_effort (the tool schema previously stripped them).

Changes

  • @oh-my-opencode/delegate-core — new pure, dependency-injected helper resolveRequestedModelOverride(): parses provider/model[ variant], lets reasoning_effort override the embedded variant, gates via fuzzyMatchModel, with cold-cache passthrough so the first call isn't blocked.
  • task + call_omo_agent — new optional model / reasoning_effort args; the override replaces the resolved model at top precedence while preserving the agent/category fallbackChain.
  • team-core MemberBaseSchema — optional model / reasoning_effort (schema stays .strict()); and team_create's inline-member tool schema now advertises both fields so the framework no longer strips them.
  • list_models — new always-on tool: connected provider/model ids grouped by provider plus the reasoning vocabulary; pointer seeded into the model arg descriptions. Registered via the standard factory → tool-registry-factoriescreateCoreTools()tools/index.ts path.
  • Docsdocs/reference/features.md (per-call override + list_models) and docs/guide/team-mode.md (per-member override).

Testing

bun run typecheck   # 0 errors (tsgo, all packages)
bun test            # green locally; CI passes on ubuntu/macos/windows
  • delegate-core helper — 8 (parse / gate / variant / reasoning precedence / cold cache)
  • delegate-task tool-boundary integration — 5 (asserts the real session.prompt/launch body carries model, reasoning, gate-reject + no-spawn, default-preserved, category)
  • team member schema — 4; team_create inline-member model — 4; list_models formatting — 5
  • Manual QA on the real OpenCode harness: list_models returns the connected set; task(model="openai/gpt-5.5", reasoning_effort="high") and task(model="xai/grok-composer-2.5-fast") each launch on exactly that model/provider; an invalid id (openai/ghost-999) fails at the gate/provider and the preserved fallback chain recovers it. Plugin load verified in an isolated XDG sandbox (Built tool registry … totalTools 26, teamModeEnabled true, 25→26 = list_models registered).

Related Issues

None — standalone feature. Three design questions for maintainers:

  1. Opt-in gating? On by default (the gate is the safety). Happy to add a delegate_task.allow_runtime_model config flag if you'd prefer it gated, given the caution in docs/guide/agent-model-matching.md.
  2. Cold-cache passthrough in requested-model.ts is the one gate relaxation (first-call safety); stricter behavior is a one-liner.
  3. reasoning_effort accepts any string (normalized downstream per model); could be enum-validated.

…discovery

Let the orchestrator pin a model (and reasoning/variant) per delegation — on
task(subagent_type|category), call_omo_agent, and team members — gated to
connected/available models, with the configured default preserved when omitted.
Adds a list_models tool so the agent can discover connected models and the valid
reasoning vocabulary before overriding.

- delegate-core: resolveRequestedModelOverride() pure helper (parse
  "provider/model[ variant]", gate via fuzzyMatchModel, reasoning_effort
  precedence over embedded variant, cold-cache passthrough)
- task() + call_omo_agent: optional model/reasoning_effort args; override
  replaces the resolved model and preserves the agent/category fallback chain
- team-core: optional model/reasoning_effort on the member spec (strict kept)
- list_models: always-on tool listing connected provider/model ids grouped by
  provider plus the reasoning vocabulary; seeded into the model arg descriptions
- docs: features.md (per-call override + list_models), team-mode.md (per-member)

Tests: delegate-core helper (8), tool-boundary integration (5), team member
schema (4), list_models formatting (5); typecheck clean (tsgo, 0 errors).
@github-actions github-actions Bot added team-core Changes under packages/team-core delegate-core Changes under packages/delegate-core opencode OpenCode edition: packages/omo-opencode labels Jun 20, 2026
The team_create tool's advertised inline-member schema omitted the
model/reasoning_effort fields added to the team-core member spec, so the tool
framework stripped them and agents saw additionalProperties:false. Per-member
model override therefore only worked via a config.json team file or a
JSON-string inline_spec — not the structured inline member object agents
naturally use.

Add model/reasoning_effort to TeamCreateInlineMemberToolSchema. The inline-spec
normalizer already preserves both fields and team-core MemberSchema already
accepts them, so the full structured path (tool args -> normalize -> TeamSpec ->
resolveMember) now applies the gated per-member override.

Test: lifecycle-inline-member-model.test.ts (object form, category variant
string, JSON-string path, default-preserved).
The new always-on list_models tool was missing from the AGENTS.md tool
catalog. Bump "Always on (18)" to (19) and add list_models so the doc
matches the registered tool set.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegate-core Changes under packages/delegate-core opencode OpenCode edition: packages/omo-opencode team-core Changes under packages/team-core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant