You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(server): delegate_task model refusals name slugs to retry with - #31905
When delegate_task is given a model slug the provider does not advertise, it refuses with Model codemie/gpt-6.1-terra is not advertised by provider codex.. The message names no valid slug, so an agent that built the slug from prose has to call orchestrator_capabilities before it can retry. To reproduce, call delegate_task with target: {providerInstanceId: "codex", model: "codemie/gpt-6.1-terra"}.
Change
The model_unavailable refusal in OrchestratorMcpService target resolution now ends with a hint built from provider.models, the same set delegate_task accepts:
When advertised slugs share the requested slug's last / segment (case-insensitive), it adds Did you mean <slug>?. For example, codex/gpt-6.1-sol suggests gpt-6.1-sol.
Otherwise it lists up to LISTED_MODEL_LIMIT (8) advertised slugs, current models first. If any are left out, it adds and N more; orchestrator_capabilities with search finds them.
The error code and the start of the message are unchanged. create_threads uses the same target resolver, so its refusal gets the same hint. No contract, option or persisted state changes.
vp test run apps/server/src/mcp/OrchestratorMcpService.test.ts: 61/61 pass.
an unadvertised model refusal names the advertised slugs to retry with fails on main: expected 'Model is not advertised by provider …' to include 'gpt-6.1-terra', with the requested slug removed before the check. It passes with the fix.
an unadvertised model with no close match lists a capped set of current slugs covers the capped fallback list. Legacy models come last and the rest are counted as "N more".
vp run check:changed: format, lint, knip, typecheck and tests all pass.
Runtime transcript. Each side ran its own server (t3 serve) on a fresh, empty home, with a scratch git project added. t3 thread start --provider claudeAgent --wait drove a real agent turn that called the delegate_task MCP tool with three targets and copied each error verbatim:
Model codemie/gpt-6.1-terra is not advertised by provider codex.
Model codemie/gpt-6.1-terra is not advertised by provider codex. Advertised models: gpt-6.1-sol, gpt-6-astra, gpt-6-luna, gpt-6-sol, gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, gpt-5.5.
{driverKind: "codex", model: "codex/gpt-6.1-sol"}
Model codex/gpt-6.1-sol is not advertised by provider codex.
Model codex/gpt-6.1-sol is not advertised by provider codex. Did you mean gpt-6.1-sol?
Model opus-5.5 is not advertised by provider claudeAgent.
Model opus-5.5 is not advertised by provider claudeAgent. Advertised models: claude-opus-5-5, claude-sonnet-5-5, claude-fable-5-1, claude-haiku-5-5, claude-fable-5, claude-opus-5, claude-opus-4-8, claude-opus-4-7 and 5 more; orchestrator_capabilities with search finds them.
All three calls returned code: "model_unavailable" on both sides. This catalog has no gpt-6.1-terra, so the first row falls back to the list.
Server-only change with no visible surface, so there are no captures.
Not checked: the hint does not apply the user's hidden-model and model-order preferences. It lists from the same raw catalog that delegate_task validates against.
AI-assisted; verified with the tests and tools listed above.
…try slug
delegate_task refuses a model the provider does not advertise with only
"Model <slug> is not advertised by provider <instance>.", so the agent must
call orchestrator_capabilities again before retrying. This test asks for a
namespaced slug whose last segment the provider advertises and expects the
refusal to name that advertised slug.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…try with
delegate_task refused an unadvertised model with only "Model X is not
advertised by provider Y.", so an agent that built a slug from prose had to
call orchestrator_capabilities again before it could retry.
The refusal now names advertised slugs whose last `/` segment matches the
requested slug (case-insensitive). With no such match it lists up to
LISTED_MODEL_LIMIT advertised slugs, current ones first, and says how many
more there are and that orchestrator_capabilities with search finds them.
Fixes#31890
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Macroscope's review found this PR approvable — Model-unavailable errors now suggest advertised model slugs to help callers retry. Existing validation and model-selection behavior remain unchanged, limiting the change to diagnostic guidance.
You can add or adjust custom eligibility rules. Learn more.
No actionable comments were generated in the recent review.
Walkthrough
When delegation requests an unadvertised model, the refusal now includes matching advertised slugs or a capped list of advertised models with guidance to search capabilities. Tests cover matching and fallback suggestions.
Changes: Delegation model hints
Layer / File(s)
Summary
Generate and attach model hints apps/server/src/mcp/OrchestratorMcpService.ts, apps/server/src/mcp/OrchestratorMcpService.test.ts, apps/server/src/mcp/toolkits/project/handlers.test.ts
The service suggests up to eight models whose final slug segment matches the request, ignoring case. If no models match, it prioritizes non-legacy models, lists up to eight, reports the omitted count, and points to capabilities search. Tests cover both suggestion paths and check for the updated refusal message.
Delegation refusals for unadvertised models now suggest valid model slugs to retry with. The change is low-risk and affects only message text, so it is ready to merge.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: delegate_task model refusals now name advertised slugs so the caller can retry. It uses a conventional commit prefix and fits the changeset, which adds an advertisedMo…
Description check
The description follows the template structure: Problem, Change, Scope, and Verification sections are all present. The Problem and Change sections are clear and specific. Scope links issue #31890 and …
Linked Issues check
[#31890] The only directly linked issue is active, so its coding requirement applies: a model_unavailable refusal for an unadvertised slug should list advertised models or close matches, so the agen…
Out of Scope Changes check
The whole-PR service diff contains only advertisedModelsHint and its single call site in requireAdvertisedModel. Both support [#31890]. The shared resolver also covers create_threads, as the PR …
Full details: Title check
Explanation
The title names the main change: delegate_task model refusals now name advertised slugs so the caller can retry. It uses a conventional commit prefix and fits the changeset, which adds an advertisedModelsHint to the model_unavailable refusal in OrchestratorMcpService. The phrasing is slightly awkward ("name slugs to retry with"), but it is specific and related to the change.
Full details: Description check
Explanation
The description follows the template structure: Problem, Change, Scope, and Verification sections are all present. The Problem and Change sections are clear and specific. Scope links issue #31890 and explains the automated triage. Verification gives focused test results, a before/after runtime table, and notes what was not checked, which meets the template's requirement beyond 'tests pass'. The template's opening comment about conventional commit titles is satisfied by the title. The template asks for the model and harness that did the work when an agent was used; the description states it is AI-assisted and names Claude Code, so this is covered. The description is mostly complete.
Full details: Linked Issues check
Explanation
[#31890] The only directly linked issue is active, so its coding requirement applies: a model_unavailable refusal for an unadvertised slug should list advertised models or close matches, so the agent can retry without calling orchestrator_capabilities. The whole-PR diff (merge base e1458f2 to head 7281cc2) shows requireAdvertisedModel in apps/server/src/mcp/OrchestratorMcpService.ts now appends advertisedModelsHint(provider.models, model) to the unchanged model_unavailable message. The helper suggests Did you mean <slugs>? when advertised slugs share the requested slug's last / segment, compared case-insensitively. Otherwise it lists up to LISTED_MODEL_LIMIT slugs, legacy models last, and reports the remainder as and N more; orchestrator_capabilities with search finds them. The error code and opening text are unchanged. The PR summary states that a test file covers both the close-match suggestion and the capped fallback list. I did not open the test file, so the test result rests on the PR summary and author report. The runtime transcripts in the PR description show the intended message on the reproduction case.
Full details: Out of Scope Changes check
Explanation
The whole-PR service diff contains only advertisedModelsHint and its single call site in requireAdvertisedModel. Both support [#31890]. The shared resolver also covers create_threads, as the PR description states. The tests in OrchestratorMcpService.test.ts and the adjusted assertion in toolkits/project/handlers.test.ts (per the raw summary) verify this behavior. The adjusted assertion relaxes an exact-match check to a substring check on the unchanged not advertised text, which follows from the new hint suffix. No unrelated change is evident in the reviewed diff. One edge case is not covered by the linked issue: when a provider advertises zero models, the fallback text becomes Advertised models: .. This is a wording defect, not an out-of-scope change.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Files skipped from review as they are similar to previous changes: 1
apps/server/src/mcp/OrchestratorMcpService.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.
Two tests duplicate large setup blocks.
Both tests build almost identical layer stacks. They also repeat the same delegateTask call shape. The testing rules say: "Extend before you add." Fold the setup into a small local helper that takes the model list and the requested model. This also avoids a third copy when another case is added.
The new tests do exercise real behavior. The second test asserts the full message and covers the cap and the omitted count. No change is required for coverage.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Ran both commits as real Linux dev servers with fresh isolated databases and identical synthetic ACP catalogs (sample-1 through sample-10). During an active thread, called orchestrator_capabilities, then delegate_task with extra/sample-3, then unrelated-invalid.
Videos replay captured RPC output with extended event holds for readability; they are not UI screen recordings. Both use a 1440×900 dark presentation and identify their environment and commit.
AI-assisted; verified with the tests and tools listed above.
Not shown:
Case-insensitive suffix matching, multiple matching suffixes, and legacy-model ordering were not separately exercised; evidence covers the two requested scenarios.
Capabilities search and a successful delegation retry were not exercised; captures establish the refusal content and bounded retry guidance.
main moved the advertised-model check into the shared requireAdvertisedModel,
so the retry hint now lives there and covers delegate_task, create_threads
and t3_thread_launch alike.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ran the same scenario against fresh real servers and web clients, using a replay agent with ten advertised models. The agent called delegate_task with extra/multi-turn, then unrelated-invalid-model, and displayed the server's verbatim responses. Captures use Chromium, 1280×800, light theme, after message synchronization completed.
The shared refusal helper's create_threads and t3_thread_launch entry points were not exercised; this proof covers the reported delegate_task reproduction.
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
bugfixFix PR opened by an issue lead; enters the PR looppr:needs-juliusNeeds Julius: route gate, unverifiable surface, or blockedsize:S10-29 changed lines (additions + deletions).vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
1 participant
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.
Problem
When
delegate_taskis given a model slug the provider does not advertise, it refuses withModel codemie/gpt-6.1-terra is not advertised by provider codex.. The message names no valid slug, so an agent that built the slug from prose has to callorchestrator_capabilitiesbefore it can retry. To reproduce, calldelegate_taskwithtarget: {providerInstanceId: "codex", model: "codemie/gpt-6.1-terra"}.Change
The
model_unavailablerefusal inOrchestratorMcpServicetarget resolution now ends with a hint built fromprovider.models, the same setdelegate_taskaccepts:/segment (case-insensitive), it addsDid you mean <slug>?. For example,codex/gpt-6.1-solsuggestsgpt-6.1-sol.LISTED_MODEL_LIMIT(8) advertised slugs, current models first. If any are left out, it addsand N more; orchestrator_capabilities with search finds them.The error code and the start of the message are unchanged.
create_threadsuses the same target resolver, so its refusal gets the same hint. No contract, option or persisted state changes.Scope and approval
Fixes #31890
Triaged via the automated issue flow.
Verification
vp test run apps/server/src/mcp/OrchestratorMcpService.test.ts: 61/61 pass.an unadvertised model refusal names the advertised slugs to retry withfails on main:expected 'Model is not advertised by provider …' to include 'gpt-6.1-terra', with the requested slug removed before the check. It passes with the fix.an unadvertised model with no close match lists a capped set of current slugscovers the capped fallback list. Legacy models come last and the rest are counted as "N more".vp run check:changed: format, lint, knip, typecheck and tests all pass.Runtime transcript. Each side ran its own server (
t3 serve) on a fresh, empty home, with a scratch git project added.t3 thread start --provider claudeAgent --waitdrove a real agent turn that called thedelegate_taskMCP tool with three targets and copied each error verbatim:{providerInstanceId: "codex", model: "codemie/gpt-6.1-terra"}Model codemie/gpt-6.1-terra is not advertised by provider codex.Model codemie/gpt-6.1-terra is not advertised by provider codex. Advertised models: gpt-6.1-sol, gpt-6-astra, gpt-6-luna, gpt-6-sol, gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, gpt-5.5.{driverKind: "codex", model: "codex/gpt-6.1-sol"}Model codex/gpt-6.1-sol is not advertised by provider codex.Model codex/gpt-6.1-sol is not advertised by provider codex. Did you mean gpt-6.1-sol?{providerInstanceId: "claudeAgent", model: "opus-5.5"}Model opus-5.5 is not advertised by provider claudeAgent.Model opus-5.5 is not advertised by provider claudeAgent. Advertised models: claude-opus-5-5, claude-sonnet-5-5, claude-fable-5-1, claude-haiku-5-5, claude-fable-5, claude-opus-5, claude-opus-4-8, claude-opus-4-7 and 5 more; orchestrator_capabilities with search finds them.All three calls returned
code: "model_unavailable"on both sides. This catalog has nogpt-6.1-terra, so the first row falls back to the list.Server-only change with no visible surface, so there are no captures.
Not checked: the hint does not apply the user's hidden-model and model-order preferences. It lists from the same raw catalog that
delegate_taskvalidates against.AI-assisted; verified with the tests and tools listed above.
🤖 Generated with Claude Code