Skip to content

Start the agent host process earlier (prewarm) so local sessions appear quickly on window startup #324330

Description

@roblourens

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.

Metadata

Metadata

Assignees

Labels

agent-hostIssues for the agent-host implementation (not the protocol)bugIssue identified by VS Code Team member as probable bug

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions