Follow-up to #324329.
The agent host utility process is spawned lazily — only when something first accesses IAgentHostService, which today happens at WorkbenchPhase.AfterRestored. So on a fresh window start the process (and therefore the live session list and session openability) only begins coming up after restore. By contrast, the extension host is started earlier, at LifecyclePhase.Ready.
We should start the agent host sooner:
- Prewarm the process: a small contribution at
BlockRestore (gated on isAgentHostEnabled), in both the Agents window and the editor window, that forces IAgentHostService construction so the spawn + SDK load + auth overlaps window restore. It's non-blocking (the client constructor returns immediately after scheduling the async connect).
- Reorder the contribution: register the local agent host sessions provider before the heavy
AgentHostContribution so the startup-cached sessions surface as soon as the provider registers rather than being queued behind agent discovery / content-provider / language-model / customization wiring.
- Optional (measure first): move the provider's hydration fully pre-restore so the cached list paints before restore.
The session-caching half (immediate-on-reload) is tracked by #324329 / #324328; this issue tracks the process-startup + ordering work.
Follow-up to #324329.
The agent host utility process is spawned lazily — only when something first accesses
IAgentHostService, which today happens atWorkbenchPhase.AfterRestored. So on a fresh window start the process (and therefore the live session list and session openability) only begins coming up after restore. By contrast, the extension host is started earlier, atLifecyclePhase.Ready.We should start the agent host sooner:
BlockRestore(gated onisAgentHostEnabled), in both the Agents window and the editor window, that forcesIAgentHostServiceconstruction so the spawn + SDK load + auth overlaps window restore. It's non-blocking (the client constructor returns immediately after scheduling the async connect).AgentHostContributionso the startup-cached sessions surface as soon as the provider registers rather than being queued behind agent discovery / content-provider / language-model / customization wiring.The session-caching half (immediate-on-reload) is tracked by #324329 / #324328; this issue tracks the process-startup + ordering work.