-
Notifications
You must be signed in to change notification settings - Fork 151
[Performance] Move command recall off the Autofix prompt critical path #844
Open
Description
Goal
Ensure prompt construction never waits for PowerShell command enumeration while preserving accurate warm-cache near-match suggestions.
Parent tracking issue: #786
Depends on: #839
Scope
- Keep the prompt path to token extraction, cheap existence checks, memory-only lookup, and ranking.
- On a cold or stale cache, omit near matches for the current turn and schedule refresh only after an actual command-not-found event.
- Do not warm command recall from helper startup or tab selection.
- Prefer a process-scoped master cache keyed by execution source, shell, PATH fingerprint, and profile/environment identity.
- Initially support host PowerShell explicitly; leave undefined WSL/other-shell environments unsupported.
- Bound both profile-aware enumeration and -NoProfile fallback.
- Use retryable single-flight cache entries with cleanup and TTL.
Acceptance criteria
- Prompt assembly awaits zero command-enumeration subprocesses.
- Selecting tabs without Autofix starts no PowerShell processes.
- Concurrent misses for one cache key start one enumeration.
- Both enumeration paths terminate within documented deadlines.
- Failures and timeouts remain retryable.
- Warm-cache ranking matches the existing blocking implementation.
- Existing cmdlets, functions, and aliases are not misclassified as missing.
Explicit tradeoff
The first cold Autofix turn may omit best-effort near-match hints; it must still send the prompt immediately.