Cross-session cache for discovered system Python path#1455
Draft
eleanorjboyd wants to merge 3 commits intomicrosoft:mainfrom
Draft
Cross-session cache for discovered system Python path#1455eleanorjboyd wants to merge 3 commits intomicrosoft:mainfrom
eleanorjboyd wants to merge 3 commits intomicrosoft:mainfrom
Conversation
d78fc30 to
c27bac3
Compare
c27bac3 to
e9f2f7d
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR adds a cross-session “fast path” for resolving the system Python by persisting the discovered global Python path and using it immediately on next startup, while verifying validity in the background.
Changes:
- Add optional global-scope persisted-path support to
tryFastPathGet()and emit telemetry for global cache hit/miss/stale. - Update system Python manager/cache to read/write the global persisted path via global persistent state.
- Extend unit tests to cover global-scope fast-path behavior and telemetry emission.
Show a summary per file
| File | Description |
|---|---|
| src/test/managers/fastPath.get.unit.test.ts | Stubs global cache getter to avoid test behavior changes with new global fast-path support. |
| src/test/managers/common/fastPath.unit.test.ts | Adds test coverage for global persisted-path behavior and verifies telemetry results. |
| src/managers/common/fastPath.ts | Implements optional global persisted-path lookup and emits global cache telemetry. |
| src/managers/builtin/sysPythonManager.ts | Wires system manager into new global persisted-path fast-path option. |
| src/managers/builtin/cache.ts | Moves global key storage to global persistent state and clears workspace/global keys in their respective stores. |
| src/common/telemetry/constants.ts | Adds GLOBAL_ENV_CACHE event and GDPR property mapping for the new telemetry. |
Copilot's findings
- Files reviewed: 6/6 changed files
- Comments generated: 2
Member
Author
|
@copilot resolve the merge conflicts in this pull request |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Persist the discovered system Python path (e.g.,
/usr/bin/python3orC:\Python312\python.exe) toglobalState. On next startup, use the cached path immediately and verify it's still valid in the background.Potential risk: The cache could become stale if the user uninstalls/upgrades Python. Background verification mitigates this — the cached env is used immediately, and if verification fails, a re-scan is triggered. The user would see a brief env switch in the rare case the cache is wrong.