-
Notifications
You must be signed in to change notification settings - Fork 150
[Performance] Add selected-tab tiered agent prewarming #842
Open
Description
Goal
Prewarm the shared master and a safely selected provider while limiting speculative helper materialization to the selected eligible tab.
Parent tracking issue: #786
Depends on: #841
Scope
- Acquire the process-level master lease when AI functionality is eligible.
- Prewarm a provider only when built-in identity, policy, availability, execution source, command/model semantics, and the exact pool key are known.
- Keep custom agents, WSL providers, and per-tab overrides lazy initially.
- Materialize at most one speculative helper for the selected eligible tab.
- Evict only unused speculative helpers when selection changes.
- Preserve visible, manually opened, restored, dragged, conversation-bearing, and user-triggered connecting helpers.
- Never run command recall, hooks, shell profiles, or other user code during speculative materialization.
Acceptance criteria
- Visiting five unused tabs leaves at most one speculative helper plus the shared master.
- Existing conversation helpers are never evicted by tab selection.
- Policy and settings changes cancel obsolete speculative work.
- Custom and WSL commands do not execute speculatively.
- Prewarm and real helper acquisition use the same exact provider pool key.
Non-goals
- Prewarming every tab.
- Speculatively executing custom commands.