Skip to content

fix(server): select an available provider for delegated tasks - #11870

Open
saphid wants to merge 1 commit into
pingdotgg:t3code/codex-turn-mappingfrom
saphid:work/ov2-20260913-08
Open

saphid wants to merge 1 commit into
pingdotgg:t3code/codex-turn-mappingfrom
saphid:work/ov2-20260913-08

Conversation

@saphid

@saphid saphid commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Summary

A driver-only delegation target (target.driverKind without providerInstanceId) could fail on an unavailable inherited provider instance even when another instance of that driver was healthy: resolveTarget preferred the parent's instance whenever it was registered and orchestration-capable, and the constraint check then rejected it.

The fix requires the inherited candidate to pass the same providerConstraints availability check as any other candidate before it can win; otherwise the first constraint-free instance of the requested driver is selected. When no healthy candidate exists, resolution falls through to the parent instance id so the constraint check reports why the inherited instance cannot serve. Explicit providerInstanceId selection is unchanged and stays strict — an unavailable explicit target fails instead of silently rerouting.

Adapted from @kiiwee's earlier proposal in #11154 (closed unmerged) onto the live adapter-registry capability lookup from #11578. Credit to kiiwee for identifying the defect and the original fix shape.

Test plan

  • Focused regression: vp test run apps/server/src/mcp/OrchestratorMcpService.test.ts — the new table-driven test proves healthy inheritance (parent model selection including options preserved verbatim), unavailable parent + healthy peer fallback, no-available-peer rejection, explicit-unavailable rejection without rerouting, and explicit healthy selection. The fallback case failed before the fix (Provider codex cannot run a child task: Provider instance is disabled.).
  • vp test run apps/server/src/mcp/ — all 170 MCP tests pass, including the cross-provider delegation integration test.
  • Targeted vp lint, vp fmt --check, and tsc --noEmit clean for the changed scope.

Independent cross-provider review: attempted codex exec -m gpt-6-astra -c model_reasoning_effort="xhigh" --sandbox read-only on the frozen diff; the reviewer account was at its usage limit (reported retry Sep 19), so the review was skipped — disclosed, not substituted.

Targets Orchestrator V2 in #2829.

Engineering: SWE-2 Max through the Devin/T3 harness.
Coordination: T3 thread 3aa91588-f393-4df8-9d47-c8c769d27899, campaign saphid/t3code-personal#298.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Sep 15, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — The PR is a focused, well-tested fix to delegated-task provider resolution, but it changes the implicit provider-selection behavior when no instance is specified. That default behavior change warrants human review.

You can add or adjust custom eligibility rules. Learn more.

@juliusmarminge
juliusmarminge force-pushed the t3code/codex-turn-mapping branch from a5ebe9a to a62d7ad Compare September 15, 2026 17:25
A driver-only delegation target could fail on an unavailable inherited
provider instance even when another instance of that driver was healthy.
Prefer the inherited instance only when it passes the availability checks,
then fall back to a healthy peer. Explicit instance selection remains
strict.

Adapted from the proposal in pingdotgg#11154 onto the
adapter-registry capability lookup.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@saphid
saphid force-pushed the work/ov2-20260913-08 branch from b7e28ab to 792db8c Compare September 15, 2026 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant