SIGN IN SIGN UP

Remote agent host: fix model picker on new session page (#306553)

* Revert bad merge from #306130

Co-authored-by: Copilot <[email protected]>

* Always resolve language models on provider registration

Previously, registerLanguageModelProvider only eagerly resolved models
when _hasStoredModelForVendor returned true. Otherwise it waited for
onDidChange. This created a hidden temporal coupling: if a provider
populated models before registration (like AgentHostLanguageModelProvider),
the onDidChange event fired with no listener attached, and the models
never appeared.

Fix: always call _resolveAllLanguageModels on registration. This is safe
(the provider guard handles unregistration races, and the per-vendor
sequencer prevents duplicate work).

Also use ActiveSessionProviderIdContext.key instead of a hardcoded string
in the remote agent host context key expression.

(Written by Copilot)

* fix

Co-authored-by: Copilot <[email protected]>

* fix

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>
R
Rob Lourens committed
d13d7c7add720c958308ba619e02cd37caffad76
Parent: 9a11a08
Committed by GitHub <[email protected]> on 3/31/2026, 2:47:26 AM