Repository navigation
agentHost: serve BYOK provider groups to agent hosts as model sources - #349506
Logan Ramos (lramos15) wants to merge 21 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved direct-routing flaws can send credentials to unintended endpoints and leave live sessions using withdrawn or stale routes.
5 open issues
What changed in this PR
This PR adds opt-in direct Custom Endpoint BYOK calls from the local agent host’s Copilot runtime, reducing dependence on the window-side bridge while retaining fallback for unsupported configurations.
Changes:
- Shares endpoint URL and authentication rules between core and the Copilot extension.
- Adds credential delivery, runtime provider registration, and model-ID translation for direct routing.
- Adds unit and integration coverage for routing, credentials, history restoration, and key persistence.
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/test/common/languageModels.ts | Updates the null service for credential resolution. |
| src/vs/workbench/contrib/chat/test/browser/chatManagement/chatModelsViewModel.test.ts | Updates the language-model service mock. |
| src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostByokLmHandler.test.ts | Tests direct discovery and credential gating. |
| src/vs/workbench/contrib/chat/common/languageModels.ts | Adds internal provider-group key resolution. |
| src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostByokLmHandler.ts | Advertises direct endpoints and serves credentials. |
| src/vs/platform/agentHost/test/node/providerIntegration/README.md | Documents direct-endpoint integration coverage. |
| src/vs/platform/agentHost/test/node/providerIntegration/copilotByokDirect.integrationTest.ts | Exercises four wire formats and checks key persistence. |
| src/vs/platform/agentHost/test/node/mapSessionEvents.test.ts | Tests restored direct-model identities. |
| src/vs/platform/agentHost/test/node/copilotSessionLauncher.test.ts | Tests provider synthesis, ID translation, and key withdrawal. |
| src/vs/platform/agentHost/test/node/byokLmBridgeRegistry.test.ts | Tests publication after credential or capability changes. |
| src/vs/platform/agentHost/test/node/agentHostClientByokLmChannel.test.ts | Tests separate credential requests. |
| src/vs/platform/agentHost/test/common/byokCustomEndpoint.test.ts | Tests endpoint mapping and bridge fallbacks. |
| src/vs/platform/agentHost/node/copilot/mapSessionEvents.ts | Translates runtime model IDs during replay. |
| src/vs/platform/agentHost/node/copilot/copilotSessionLauncher.ts | Builds direct providers and translates launch selections. |
| src/vs/platform/agentHost/node/copilot/copilotByokModelIds.ts | Defines stable provider names and ID conversions. |
| src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts | Applies ID translation and tracks live routing configuration. |
| src/vs/platform/agentHost/node/copilot/copilotAgent.ts | Syncs live sessions when BYOK models are withdrawn. |
| src/vs/platform/agentHost/node/byokLmBridgeRegistry.ts | Detects direct-route and capability changes. |
| src/vs/platform/agentHost/common/customEndpointUrl.ts | Centralizes URL and authentication rules. |
| src/vs/platform/agentHost/common/byokCustomEndpoint.ts | Maps compatible settings to runtime endpoints. |
| src/vs/platform/agentHost/common/agentService.ts | Declares the direct-routing setting ID. |
| src/vs/platform/agentHost/common/agentHostStarter.config.contribution.ts | Registers the default-off experimental setting. |
| src/vs/platform/agentHost/common/agentHostClientByokLmChannel.ts | Adds credential delivery over local IPC. |
| src/vs/platform/agentHost/common/agentHostByokLm.ts | Defines direct-endpoint and credential contracts. |
| extensions/copilot/src/util/vs/platform/agentHost/common/customEndpointUrl.ts | Vendors the shared endpoint rules. |
| extensions/copilot/src/extension/byok/vscode-node/test/customEndpointProvider.spec.ts | Adapts tests to the shared URL helper. |
| extensions/copilot/src/extension/byok/vscode-node/customEndpointProvider.ts | Uses shared URL and authentication helpers. |
| extensions/copilot/script/setup/copySources.ts | Includes the shared helper in source copying. |
Review effort: Balanced
98df516 to
a584811
Compare
…untime Behind the experimental `chat.agentHost.byokModels.customEndpointDirect.enabled` setting, the local agent host registers Custom Endpoint BYOK models with the Copilot runtime as real providers (the model's endpoint and the provider group's API key) instead of routing every request back through the window's bridge. - Share the Custom Endpoint URL rules between core and the Copilot extension (`customEndpointUrl.ts`, vendored by `copySources.ts`) and map each model to an `openai` (Chat Completions or Responses), `azure` or `anthropic` runtime endpoint that sends the same request and auth header as the extension. Models the runtime cannot reach the same way keep using the bridge. - The window serves each group's key over a separate `credential` call on the existing BYOK channel, behind the BYOK policy and the setting; model lists never carry keys. The agent host sets it as the provider's static `apiKey`, re-syncs on key changes, and drops it from live sessions once the window stops reporting the model. - Each direct model has its own runtime provider; the agent host translates its runtime selection id to and from the picker's `vendor/[group/]id`. Co-authored-by: Copilot <[email protected]>
…irect routing Addresses review feedback on direct Custom Endpoint BYOK routing: - A direct provider the window no longer reports (BYOK disabled by policy, the group removed or changed, the setting turned off) is pointed at the BYOK bridge under the same provider name, with or without a key. The session keeps its selection, and each request gets the bridge's per-request checks. If the proxy cannot start, the provider and its models are withdrawn. - Credential requests carry the snapshot's `credentialVersion`; the window refuses a version whose key has since been replaced, so a new key never reaches the endpoint of an older snapshot. - Groups with a discovery `url`, and models with `modelOptions`, stay on the bridge, since the extension's requests for them differ from the runtime's. Co-authored-by: Copilot <[email protected]>
Replace the private direct-routing path (a credential call on the local BYOK channel plus agent/runtime model id translation) with the Agent Host Protocol model source registry, so local and remote agent hosts share one path. - Sync the protocol types to the pre-release microsoft/agent-host-protocol#627 (on #543), and narrow `authenticate` targets that are not MCP servers. - Host: a model source registry validates `root/modelSourceRegistrationSet` and `Removed`, reports status with `root/modelSourceStateChanged`, holds credentials delivered with a `modelSource` target in memory, fences them with a nonce, and removes a departed client's `contributingClient` sources. - Copilot agent: reads the `code.visualstudio.com/custom-endpoint@1` format, publishes each source's models with `modelSourceId`, and registers them on live sessions as host-owned providers that replace earlier ones on sync. Model ids are the runtime selection ids, bound to the registration, endpoint, and upstream model. - Window: registers eligible Custom Endpoint groups with every connected host that reads the format, and answers key requests; the bridge stops listing those models. Co-authored-by: Copilot <[email protected]>
…g back Moves BYOK model sources to a VS Code-owned `byok-endpoints@1` definition format that carries each model's resolved endpoint, with strict host-side validation, and maps Custom Endpoint, Custom OpenAI Compatible, Azure (with a key), xAI, OpenRouter and Ollama groups through a core vendor table. Models whose requests the runtime would send differently stay on the bridge. Adopts the registry from agent-host-protocol#627 at e06ed620: contributor sets, model-source auth reasons, credential IDs and origins, leases, the grace period, and resumable `modelSourceUnavailable` errors. - Registers only the selected model's provider on a session, and never runs a turn on another model after its source is withdrawn or its key revoked. - Marks a key rejected on the endpoint's 401 instead of asking for GitHub sign-in. - Asks before using a remote agent host, sends it only public https endpoints, and never registers over relays. - Namespaces registration IDs per installation and profile, and lets a window withdraw only its own contribution unless every window agrees. - Honors `chat.byokUtilityModelDefault` for these models, and hides bridged copies only while the local host serves them. Co-authored-by: Copilot <[email protected]>
9f9842f to
665267c
Compare
…27 at a03a5a1b Syncs the protocol to the registry as revised in review: model sources are `RootState.modelSources`, their definitions travel only on `root/modelSourceSet` with a client-chosen `nonce`, the host tracks contributing clients privately from each action's origin, and a key's ID is `authenticate`'s `accountId`. - Host: keeps definitions and contributors privately, treats a `Set` with the same provider, format and nonce as a re-registration that keeps the key, rejects one that repeats the nonce with a different definition, and publishes `accountId`. - Window: derives source IDs from the provider group and the nonce from a hash of the definition, so windows and devices share one source; registers it again on connect and reconnect; leaves another client's definition and key alone unless the user changed the group here; adds back a source another client removed only after reconnecting; and removes a source only when the user removes the group, or when policy turns the feature off on the local host. Co-authored-by: Copilot <[email protected]>
…nt left When the last contributing client of a contributingClient-retained model source disconnects, the host now drains the source instead of removing it immediately: its models leave the catalog and new work fails as modelSourceUnavailable, but sessions with a running turn on it keep the provider until the turn ends. The source is removed once idle, and a re-registration cancels the drain. Co-authored-by: Copilot <[email protected]>
…urces Register the OpenAI, Anthropic and Gemini vendors' provider groups as model sources, so the runtime calls their APIs directly with its own request settings instead of matching the extension's per-vendor behavior: - OpenAI models with a reasoning effort use Responses, the others Chat Completions, since the runtime always asks Responses for encrypted reasoning. - Anthropic models use Messages at the Anthropic API. - Gemini models use the runtime's experimental Google provider, the Interactions API with x-goog-api-key. Sessions on a model source's Responses model ask for no reasoning summary, as VS Code's BYOK providers never do, and restore the default when they leave it. A session launched on a model source's model gets tool search that defers tools past the 128 an OpenAI-compatible API accepts. The integration test adds a Gemini turn, checks Responses requests carry no reasoning summary, and checks the tool limit. A skipped test documents that the bundled runtime doesn't redact provider keys from tool results. Co-authored-by: Copilot <[email protected]>
…27 at a4a01c06 Sync the protocol from microsoft/agent-host-protocol#627 at a4a01c06, which implements #622 after its second review round: - The definition is part of the model source: root/modelSourceSet carries only the source, and the reducer keeps the definition in root state. - Credential nonces, credentialOrigins, the capability's gracePeriod and principalPolicy are gone, and formats are { format } objects. The host no longer issues nonces: a later delivery replaces the key it holds, and a lease only lapses for the key it was delivered with. The window checks the host's copy of the definition before sending a key: every endpoint the key reaches must be one its own copy sends it to, whatever the nonce. It checks again after reading the key, since the source may have changed meanwhile. Co-authored-by: Copilot <[email protected]>
A 401 on a model source's endpoint now carries the start time of the turn that got it, and the host drops the credential only if it accepted that credential before the turn started. A key delivered meanwhile is kept instead of being reported as rejected. The window no longer backs off and retries a failed key delivery on a timer. It delivers again on the next state change, such as a reconnect, a host report, or a replaced key. Co-authored-by: Copilot <[email protected]>
Drop the skipped tool-output redaction test, which can't pass until the runtime redacts provider keys from tool results and is tracked as a runtime ask, and the mapping assertions the real-runtime integration test already checks on the wire. Co-authored-by: Copilot <[email protected]>
Vritant Bhardwaj (vritant24)
left a comment
There was a problem hiding this comment.
Read at 6f67c7f. I traced these by reading; I did not run the code or read the tests in full, so a test may already cover some of them.
P1 is behavior a user can hit, worth settling before this leaves draft. P2 is a simplification or a maintainability point, and is your call.
P1
- A second window on a remote host can stop counting as a contributor after a group changes.
- A group with more than 256 direct-callable models is declined whole.
- Updating a group clears the key and can end turns running on its other models. Is that intended?
P2
4. The remote BYOK warning is hidden from the setting alone.
5. The Azure URL rule is a second copy of the extension's.
6. ConnectionModelSourceRegistrar could sync as one queued pass.
7. canSendKey could compare a recomputed nonce.
8. _reasoningSummaryOmitted may not need three states.
9. IModelSourceEntry repeats what is in root state.
10. Two 30-second disconnect timers.
Minor, no inline comment: the client-dispatchable action union is edited in 12 signatures across 6 files. A named type would make the next addition a one-line change.
- A window that contributed a source registers it again after another client updates it, so it keeps counting as a contributor. - A definition holds up to 512 models, and the window leaves any more on the bridge instead of the host declining the whole group. OpenRouter lists more than 256 tool-capable models. - The host declines a definition its agent can't read rather than storing it in root state for every client. - Before sending a key, the window compares the host's definition with its own through its nonce, and checks again after reading the key that the host still needs it. - Resuming a turn selects its model source's model again first, as sending does, and fails as unavailable while it can't. - The session's reasoning summary state is a boolean, and one timer drops a disconnected client's managed settings and model sources. Co-authored-by: Copilot <[email protected]>
…27 at 6a80f578 Sync the protocol from microsoft/agent-host-protocol#627 at 6a80f578, which targets main now that #543 and #622 are merged: - ModelSourceInfo and AgentInfo.modelSources are gone: root state lists every model source, so the host stops publishing a catalog per agent. - format, definition and nonce are optional on ModelSource. The host rejects a client registration without any of them, and a model counts as the user's own when its root source has a definition. - A request that selects a model whose registered source can't serve it fails with AhpErrorCodes.ModelSourceUnavailable (-32013). Co-authored-by: Copilot <[email protected]>
The remote BYOK warning was hidden whenever the direct endpoints setting was on, even when the session's host serves none of the window's models: a relayed connection, a host the user didn't allow, one whose agent lacks the format, or endpoints it can't reach. The registrar now publishes, per connection authority, whether the host serves the window's sources or is still setting them up, and the warning hides only for the session's own host. Co-authored-by: Copilot <[email protected]>
Resolve conflicts in copilotAgent.ts and its tests: keep both sides' imports, and in handleAuthenticationToken keep this branch's early return for non-MCP authenticate targets ahead of main's hasGitHubToReturnTo Entra change. Co-authored-by: Copilot <[email protected]>
|
Base:
|
…source registration Registration now follows the automation pattern. The window dispatches root/modelSourceRegisterRequested, and only the host publishes a source, with root/modelSourceSet, for every change including its status. ModelSource moves format, definition and retention into `registration`, has no nonce, and always has a state. root/modelSourceRemoved takes modelSourceId, and root/modelSourceStateChanged is gone. - Host: the registry keeps each registered source and publishes it whole. It compares the format and definition itself, so an unchanged registration keeps its status and key, and publishes before confirming the request. - Window: compares the host's registration with its own copy through a local definition key, and waits for a host that confirms a request before publishing the source. - Turns on an unavailable source end with errorCode ModelSourceUnavailable. The protocol is synced from #627's own changes applied to the AHP base this branch already used (745899da), without AHP main's deferred turns (#620) and search channel (#629), which VS Code main hasn't adopted. Co-authored-by: Copilot <[email protected]>
…source retention Retention is now only on root/modelSourceRegisterRequested, beside `registration`, and no longer in state. The window sends it there. The host keeps each source's retention privately from the latest request, uses it when the last contributor leaves, and still declines a retention it won't honor. Synced as before: #627's own change (git diff 2b520a36 cddbc7e7 -- types/) on top of the previous local tree based on AHP 745899da. Co-authored-by: Copilot <[email protected]>
…d AHP backport The AHP model source registry has merged (microsoft/agent-host-protocol#627 as 5c4fd945, on top of #543). AHP main also has deferred turns (#620) and a search channel (#629), which VS Code hasn't adopted, so the protocol is synced the narrow way documented in common/state/AGENTS.md: `.ahp-version` stays on main's pin 1928cd4e, with main's #631 backport plus #543's and #627's merged `types/` diffs. AGENTS.md lists the backport and how to reproduce it. The generated copy matches the previous branch copy except that #628's unrelated `DirectoryEntry.isSymlink` drops out. Conflicts: kept both sides' imports; in protocolServerHandler kept the model source checks without UNSUPPORTED_CLIENT_ACTION_TYPES, which main removed; the client test keeps `as const` for the MCP target alongside main's idToken. Co-authored-by: Copilot <[email protected]>
…ders directly - OpenRouter's Anthropic models use its Messages API with the key as a bearer token, through a new `auth: 'bearer'` endpoint option for anthropic and azure endpoints. - An Azure group without a key signs in with the Microsoft account the user chose for the Copilot extension. The window delivers its token as an `expiresIn` lease and renews it before the lease ends. - Custom Endpoint, Custom OpenAI Compatible, and Azure groups send extra request headers directly, unless a header may carry a credential or the providers drop it. Co-authored-by: Copilot <[email protected]>
…ustom-endpoint-integration
The agent host's direct path restated the extension's Azure URL rule. Both now call `resolveAzureModelUrl` in the import-free `customEndpointUrl.ts`, which the extension copies. It recognizes Azure hosts by domain instead of by text anywhere in the URL. Co-authored-by: Copilot <[email protected]>
Models of a registered BYOK model source now carry `byokModelIdentifier`, the window language model identifier from the definition's first alias, as their bridged copies do. The window then treats them as BYOK models: the model picker lists them under their provider group's name, and hiding a model in the Language Models editor hides its direct copy. Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical issues can misroute remote utility prompts, retry unsent turns without submitting their prompts, and prematurely finalize resumable turns, while direct-source models can also lose valid Copilot fallback.
4 open issues
5 resolved since last review
Review effort: Balanced
| * session, so it can't serve utility requests itself yet. | ||
| */ | ||
| private _assertCopilotServesModelSourceChat(context: IAgentHostUtilityModelContext): void { | ||
| if (this._resolveMainAgentModel(context)?.model?.modelSourceId === undefined) { |
| duration: this._turnDuration(turnStopWatch), | ||
| part: createErrorResponsePart(error), | ||
| // The turn can run once its model source can serve it again. | ||
| part: createErrorResponsePart(error, error.errorCode === AhpErrorCodes.ModelSourceUnavailable), |
| // The turn can run once its model source can serve it again. | ||
| part: createErrorResponsePart(error, error.errorCode === AhpErrorCodes.ModelSourceUnavailable), |
| } | ||
| const { agent, selection, model } = resolved; | ||
| if (model) { | ||
| return readAgentModelByokIdentifier(model) !== undefined ? model.id : undefined; |
Ulugbek Abdullaev (ulugbekna)
left a comment
There was a problem hiding this comment.
Automated lightweight security-only screening: no conspicuous security vulnerabilities found in the reviewed changes. This is not a comprehensive security audit or a general correctness review.


Registers BYOK provider groups with local and remote agent hosts as Agent Host Protocol model sources. The Copilot runtime then calls each provider's endpoint directly with the group's API key, or for an Azure group without a key, the user's Microsoft account token, instead of sending every request back to the window through the BYOK bridge. It's off by default, behind the experimental setting
chat.agentHost.byokModels.directEndpoints.enabled.Important
Builds on the AHP model source registry: microsoft/agent-host-protocol#543 and microsoft/agent-host-protocol#627, both merged. VS Code
mainis still on AHP1928cd4e, without AHPmain's deferred turns (microsoft/agent-host-protocol#620) and search channel (microsoft/agent-host-protocol#629). So the protocol files apply only the two PRs'types/changes to that pin as a targeted backport, next tomain's existing backport of microsoft/agent-host-protocol#631..ahp-versionstays1928cd4e, andstate/AGENTS.mdrecords the commits and the commands that reproduce the sync. Adopting AHPmainlater replaces the backport; no AHP release is needed for this PR.How it works
Window (
AgentHostModelSourceRegistrar)chatLanguageModels.jsonas a model source withroot/modelSourceRegisterRequested, with every connected host whose agent reads the format. The source ID comes from the group's configuration key, so every window and device with the group registers the same source.code.visualstudio.com/byok-endpoints@1, which lists each model's resolved endpoint, API, and limits.authenticateonly when the host asks for one, and only if the host's copy has the window's own format and definition, so the key reaches no other endpoint. It never caches or replays keys, and doesn't resend a key the host rejected or a client revoked until the user replaces it.https://cognitiveservices.azure.com/.defaultscope, read silently. Without such an account, the group stays on the bridge, whose provider asks the user to pick one. The window sends the token with anexpiresInlease that ends two minutes before the token expires, and renews it three quarters into the lease while the host still holds this account's token. TheaccountIdnames the account (a hash of its ID), so switching accounts replaces the credential like a new key.Host (
AgentHostModelSourceRegistry)root/modelSourceSet, for every change including its status. A request with the same provider, format, and definition re-registers the source and keeps its key; a changed definition drops the key. Contributing clients are kept privately; the definition is in root state.credentialResource, andaccountId, and therequired,expired,rejected, andrevokedreasons. A later delivery replaces the key the host holds.expiresInlease lapses. Relay and scoped clients can't register sources or deliver keys.contributingClientsource's last window leaves, the host waits out its 30-second grace period. Then new turns on it fail, and running turns finish before the source is removed.Copilot agent
apiKey, orbearerTokenwhen the definition's endpoint saysauth: "bearer"(OpenRouter's Messages API, and Azure sign-in tokens). Safe extra request headers from the group's settings go inheaders. A session registers only its selected model's provider, so it never holds another source's key.*auth*,*key*,*token*,*secret*or*cookie*,Bearer/Basicvalues,${...}references, and headers the providers drop or the runtime sets are rejected, and their models stay on the bridge.byokModelIdentifieras its bridged copy (the window's language model identifier, from the definition's first alias). So the window treats it as a BYOK model: it's listed under its provider group's name in the model picker, and hiding the model in the Language Models editor hides it.errorCodeisModelSourceUnavailable(-32013), and a request that selects the model fails with that code. It never falls back to another model, and resuming selects the model again first.chat.byokUtilityModelDefault. Automations are ready only while the model's key is present.Vendors
anthropic/models over its Messages API with a bearer tokenthinking, with safe extra headers;Authorization: Bearer ${apiKey}on Messages uses a bearer tokenthinking, headers that may carry a credential,modelOptions, andstreaming: false/messagesURLsThe Custom Endpoint and Azure URL rules live in one import-free module,
src/vs/platform/agentHost/common/customEndpointUrl.ts, which the Copilot extension's providers use through the copycopySources.tsmakes. So the direct path and the extension resolve the same URLs. The Azure rule now recognizes Azure hosts by domain (*.openai.azure.com,*.models.ai.azure.com,*.inference.ml.azure.com) rather than by text anywhere in the URL, in the extension too. A base URL whose host only contains one of those names, such ashttps://notmodels.ai.azure.com, is now reported as an unrecognized Azure URL.Still on the bridge
thinking, because ofinclude.modelOptions,streaming: false, and third-partyvscode.lmproviders.Accepted differences
generateContent.Known limits
localhost, by design.Runtime asks
include: ["reasoning.encrypted_content"]out of Responses requests for models without reasoningtool.execution_complete, and inevents.jsonl. The bridge leaks it the same way.Deferred to github/copilot-agent-runtime#47132 (sessionless
inference.chat), which won't land for a while: utility requests on direct models outside a session, and moving the built-in BYOK providers from the Copilot extension into core.Validation
Run locally against Copilot SDK 2.0.3 (runtime 1.0.116), the version
mainpins.npx tsc --project ./src/tsconfig.json --noEmit --skipLibCheck: passed.pnpm run oxlinton the changed files, andnode build/checker/layersChecker.ts: passed.npm testin agent-host-protocol on the backported protocol tree (AHP1928cd4eplus Javascript replaced with "(...token: string[]): void #631, [html] Please provide a built-in HTML.tmLanguage file #543 and Bad margins in debug call stack #627'stypes/changes): 674 passing../scripts/test.shoversrc/vs/platform/agentHost/testandsrc/vs/workbench/contrib/chat/test/browser/agentSessions: 23,207 passing, 0 failing.auth: "bearer"only on Anthropic and Azure endpoints, and no headers that may carry a credential../scripts/test-integration.sh --run src/vs/platform/agentHost/test/node/providerIntegration/copilotByokDirect.integrationTest.ts: 3 passing.api-key, Gemini, OpenRouter's Messages API with a bearer token, Azure OpenAI with a bearer token, and a keyless endpoint, against a loopback server. Each request carries only its own group's credential in the expected header, and no second auth header. A keyless endpoint gets none, the extra header configured on Chat Completions arrives, and no file the runtime writes contains a key.End to end in Code OSS (Agents window, local agent host, driven with Playwright over CDP; isolated throwaway profile):
thinking, Messages) pointing at a loopback fake OpenAI/Anthropic-compatible server that accepts only the group's key.User-Agent: GitHubCopilotChat/…, and the agent host log showedWired 3 BYOK model(s) … via loopback proxy.OpenAI/JSfor Chat Completions and Responses,Anthropic/JSfor Messages) with the group's key in the expected header (bearer orx-api-key), and the agent host loggedWired the selected model of a registered model source.modelSourceUnavailableerror, with no request and no fallback to another model. Picking the bridged model then worked again through the bridge.End to end on a remote agent host (the same Agents window connected to a standalone
scripts/code-agent-host.shserver throughchat.remoteAgentHosts, as a direct WebSocket connection):https://127.0.0.1.nip.io:<port>, which passes the remote reachability check. A fourth usedhttp://127.0.0.1, which doesn't. The fake server used a test CA certificate, which only the remote server trusted (NODE_EXTRA_CA_CERTS), so only the remote host's runtime could reach it.root/modelSourceRegisterRequested, thenroot/modelSourceSet, thenauthenticate, thenServing 3 model(s) of 1 registered model source(s). The private-network model wasn't sent.OpenAI/JSandAnthropic/JSwith the group's key in the expected header. The remote server loggedWired the selected model of a registered model source, and the window's local agent host wired nothing.root/modelSourceRemoved, thenServing 0 model(s)).Not run: a turn against a real provider, a real Microsoft sign-in, a remote host on another machine (SSH or a dev tunnel), or the Azure cross-platform pipeline.