bug: built-in sub-agents intermittently use a different default model instead of inheriting the session model (flaky 404 on single-model custom/BYOK providers)
Summary
On a custom/BYOK single-model provider (e.g. Azure AI Foundry), a built-in sub-agent (general-purpose, explore, task) dispatched without an explicit model uses a built-in default model (observed: gpt-5.4) instead of inheriting the session model. That model isn't deployed on the custom endpoint, so the sub-agent's first model call fails with HTTP 404 DeploymentNotFound and the sub-agent aborts. This is intermittent — it only happens when the parent omits model on dispatch (which is non-deterministic), so it can pass and fail across otherwise identical runs. It contradicts the documented protocol, which says the child model field "When omitted, inherits the outer agent's model."
⚠️ Frequency / reproducibility (please read before triaging)
This is a flaky / non-deterministic bug, not a hard failure:
- It fires only when the parent agent omits
modelon the sub-agent dispatch. A soft prompt guardrail normally makes the parent pass the model, so many runs succeed. - In a single run we observed one phase pass and another fail: one phase dispatched the general-purpose sub-agent with the model (succeeded), while another dispatched the same sub-agent without it (→ default model → 404).
- ➡️ A single passing repro does not disprove it. Use a task substantial enough to fan out several sub-agent dispatches, and repeat, to hit the omit-
modelpath.
Affected SDK language(s) / versions
- The behavior originates in the shared Copilot CLI runtime, so all language SDKs are affected (Node/TS, Python, Go, .NET, Java, Rust) when used with a custom provider + sub-agents.
- Observed with
@github/copilot-sdk1.0.5 driving Copilot CLI runtime@github/copilot1.0.68 (also present in latest).
Environment
- OS: Windows 11 (also reproduced in Linux/Windows CI containers) — appears OS-independent.
- Runtime: Node.js 22.x.
- Provider: single-model custom/BYOK provider (Azure OpenAI / Foundry), Entra/keyless auth; only the configured model is deployed on the endpoint.
Steps to reproduce
- Configure a session with a custom
providerwhose only deployment is<your-model>, and set the sessionmodelto it. - Prompt the agent to dispatch a
general-purposesub-agent for independent work — ideally something substantial enough that it fans out several sub-agents. - Watch the sub-agent model calls. Repeat / use a non-trivial task — the failure surfaces only on dispatches where the parent omits
model(see Frequency above).
Minimal sample (Node):
import { CopilotClient, approveAll } from "@github/copilot-sdk";
const client = new CopilotClient();
await client.start();
const session = await client.createSession({
model: "your-deployment", // the ONLY model deployed on the provider
provider: { baseUrl: "https://<resource>.openai.azure.com/openai/v1/" /* + auth */ },
onPermissionRequest: approveAll,
});
// The parent MAY dispatch the sub-agent without an explicit `model` — that's the failing path.
await session.sendAndWait({
prompt: "Dispatch a general-purpose sub-agent to research something independently, then report back.",
});
Expected behavior
The sub-agent inherits the session/parent model (your-deployment) when no model is specified — matching the documented "inherits the outer agent's model" contract, and matching how custom agents already behave (CustomAgentConfig.model: "falling back to the parent session model if unavailable").
Actual behavior
The sub-agent requests a different default model (observed gpt-5.4) → HTTP 404 DeploymentNotFound at the provider → sub-agent fails. Invisible on first-party GitHub Copilot, where gpt-5.4 exists — another reason it's easy to miss.
Relevant logs (redacted)
o Sub-agent started General Purpose Agent
! Model call failed gpt-5.4 · HTTP 404
{"type":"invalid_request_error","code":"DeploymentNotFound",
"message":"The API deployment for this resource does not exist..."}
x Sub-agent failed General Purpose Agent
[error] Resource not found on provider at https://<resource>.openai.azure.com/openai/v1/ (HTTP 404)
Notes
- Evidence for the default: the bundled runtime's changelog states "General-purpose subagents use GPT-5.4 or GPT-5.5 when available." (I did not inspect the model-selection source directly — the runtime is compiled — so this describes observed behavior, not the internal mechanism.)
- Consumer-side workarounds do not resolve it: the
updateSubagentSettingsRPC is accepted but appears to be ignored for programmatic session config, andexcludedBuiltinAgentsonly shifts dispatch to another built-in with the same fallback. - Suggested direction: for built-in sub-agents, default the model to the session/parent model (as the protocol documents) instead of a separate default — at least when the session uses a custom/BYOK single-model provider, where the default model cannot exist.