Repository navigation
Fix standalone Artifact Explorer account discovery - #6384
aaronpowell merged 6 commits into
Conversation
Restore the GitHub CLI roaming configuration directory when a standalone canvas omits APPDATA, preserving explicit configuration overrides and existing account selection. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
🚦 Submission status: 🛠️ Requires submitter fixesRisk tier: Why this tier
Automated checks
Action needed
Review
Commands
Updated for |
🧩 Canvas smoke test✅ Passed · 0 error(s), 29 warning(s)
Plugin
|
| Field | Value |
|---|---|
| Description | Manage local and remote Git tags, create and push release tags, and delete tags with confirmation. |
| Author | James Montemagno — https://github.com/jamesmontemagno |
| License | MIT |
| Keywords | canvas, git, tags, releases, github-actions |
| Extensions | git-tag-manager |
| Materialize | ✅ |
| Install | ✅ |
Changed plugin files
plugins/git-tag-manager/README.mdplugins/git-tag-manager/plugin.json
Plugin keyboard-2048 v1.0.0
| Field | Value |
|---|---|
| Description | Play 2048 in a Copilot canvas with keyboard and touch controls, undo, and session saves. |
| Author | geniodelmale — https://github.com/geniodelmale |
| License | MIT |
| Keywords | 2048, copilot-canvas, game, keyboard, puzzle, undo |
| Extensions | keyboard-2048 |
| Materialize | ✅ |
| Install | ✅ |
Changed plugin files
plugins/keyboard-2048/README.mdplugins/keyboard-2048/plugin.json
Plugin pr-artifact-explorer v1.0.1
| Field | Value |
|---|---|
| Description | Navigate pull requests and workflow runs (including scheduled and manual runs without a PR) and securely explore GitHub Actions artifacts, including test results, static sites, terminal recordings, and source files. |
| Author | David Pine — https://github.com/IEvangelist |
| License | — |
| Keywords | actions-artifacts, artifact-browser, canvas, copilot-extension, github-actions, pull-requests, test-results |
| Extensions | pr-artifact-explorer |
| Materialize | ✅ |
| Install | ✅ |
Changed plugin files
plugins/pr-artifact-explorer/README.mdplugins/pr-artifact-explorer/plugin.json
Extension git-tag-manager
| Field | Value |
|---|---|
| Registered by | git-tag-manager |
| Package | — |
| Preview | 1200×900, 75.6 KB |
| Modules | 11 (6 reachable from extension.mjs) |
| Files | 16 |
Permissions and capabilities (static analysis of modules reachable from extension.mjs)
- Spawns processes (node:child_process)
- File system access (node:fs)
- Network sockets / local server (node:http, node:net, ...)
- Host information (node:os)
- Reads environment variables (process.env)
Warnings
- manager.test.mjs: import "node:test" is not a Node.js builtin, host-provided package, or declared dependency (module is not reachable from extension.mjs)
- server.test.mjs: import "node:test" is not a Node.js builtin, host-provided package, or declared dependency (module is not reachable from extension.mjs)
Changed extension files
extensions/git-tag-manager/README.mdextensions/git-tag-manager/assets/preview.pngextensions/git-tag-manager/copilot-extension.jsonextensions/git-tag-manager/extension.mjsextensions/git-tag-manager/git.mjsextensions/git-tag-manager/manager.mjsextensions/git-tag-manager/manager.test.mjsextensions/git-tag-manager/public/client.jsextensions/git-tag-manager/public/index.htmlextensions/git-tag-manager/public/styles.cssextensions/git-tag-manager/public/theme.jsextensions/git-tag-manager/schemas.mjsextensions/git-tag-manager/server.mjsextensions/git-tag-manager/server.test.mjsextensions/git-tag-manager/storage.mjsextensions/git-tag-manager/test-fixture.mjs
Extension keyboard-2048
| Field | Value |
|---|---|
| Registered by | keyboard-2048 |
| Package | — |
| Preview | 1546×1496, 160.2 KB |
| Modules | 7 (3 reachable from extension.mjs) |
| Files | 10 |
Permissions and capabilities (static analysis of modules reachable from extension.mjs)
- File system access (node:fs)
- Network sockets / local server (node:http, node:net, ...)
Warnings
- extension.test.mjs: non-literal dynamic import cannot be analyzed safely (module is not reachable from extension.mjs)
- extension.test.mjs: import "node:test" is not a Node.js builtin, host-provided package, or declared dependency (module is not reachable from extension.mjs)
- game.test.mjs: import "node:test" is not a Node.js builtin, host-provided package, or declared dependency (module is not reachable from extension.mjs)
- server.test.mjs: import "node:test" is not a Node.js builtin, host-provided package, or declared dependency (module is not reachable from extension.mjs)
Changed extension files
extensions/keyboard-2048/app.mjsextensions/keyboard-2048/assets/preview.pngextensions/keyboard-2048/extension.mjsextensions/keyboard-2048/extension.test.mjsextensions/keyboard-2048/game.mjsextensions/keyboard-2048/game.test.mjsextensions/keyboard-2048/index.htmlextensions/keyboard-2048/server.mjsextensions/keyboard-2048/server.test.mjsextensions/keyboard-2048/style.css
Extension pr-artifact-explorer
| Field | Value |
|---|---|
| Registered by | pr-artifact-explorer |
| Package | pr-artifact-explorer 1.0.1 |
| Preview | 1440×900, 81.5 KB |
| Modules | 51 (21 reachable from extension.mjs) |
| Files | 120 |
Permissions and capabilities (static analysis of modules reachable from extension.mjs)
- Spawns processes (node:child_process)
- File system access (node:fs)
- Network sockets / local server (node:http, node:net, ...)
- Host information (node:os)
- Outbound HTTP requests (fetch)
- Reads environment variables (process.env)
- Third-party runtime packages: playwright-core
Warnings
- accounts.test.mjs: import "node:test" is not a Node.js builtin, host-provided package, or declared dependency (module is not reachable from extension.mjs)
- backend-gaps.test.mjs: import "node:test" is not a Node.js builtin, host-provided package, or declared dependency (module is not reachable from extension.mjs)
- capture.test.mjs: import "node:test" is not a Node.js builtin, host-provided package, or declared dependency (module is not reachable from extension.mjs)
- close-bounded.test.mjs: import "node:test" is not a Node.js builtin, host-provided package, or declared dependency (module is not reachable from extension.mjs)
- jobs-limits.test.mjs: import "node:test" is not a Node.js builtin, host-provided package, or declared dependency (module is not reachable from extension.mjs)
- markdown-preview.test.mjs: import "node:test" is not a Node.js builtin, host-provided package, or declared dependency (module is not reachable from extension.mjs)
- media-junit.test.mjs: import "node:test" is not a Node.js builtin, host-provided package, or declared dependency (module is not reachable from extension.mjs)
- mode-race.test.mjs: import "node:test" is not a Node.js builtin, host-provided package, or declared dependency (module is not reachable from extension.mjs)
- nav-history.test.mjs: import "node:test" is not a Node.js builtin, host-provided package, or declared dependency (module is not reachable from extension.mjs)
- owned-theme.test.mjs: import "node:test" is not a Node.js builtin, host-provided package, or declared dependency (module is not reachable from extension.mjs)
- pull-loading.test.mjs: import "node:test" is not a Node.js builtin, host-provided package, or declared dependency (module is not reachable from extension.mjs)
- range-integrity.test.mjs: import "node:test" is not a Node.js builtin, host-provided package, or declared dependency (module is not reachable from extension.mjs)
- raw-open.test.mjs: import "node:test" is not a Node.js builtin, host-provided package, or declared dependency (module is not reachable from extension.mjs)
- raw-wiring.test.mjs: import "node:test" is not a Node.js builtin, host-provided package, or declared dependency (module is not reachable from extension.mjs)
- report-state.test.mjs: import "node:test" is not a Node.js builtin, host-provided package, or declared dependency (module is not reachable from extension.mjs)
- rerun.test.mjs: import "node:test" is not a Node.js builtin, host-provided package, or declared dependency (module is not reachable from extension.mjs)
- review-fixes.test.mjs: import "node:test" is not a Node.js builtin, host-provided package, or declared dependency (module is not reachable from extension.mjs)
- runs-ui.test.mjs: import "node:test" is not a Node.js builtin, host-provided package, or declared dependency (module is not reachable from extension.mjs)
- runs.test.mjs: import "node:test" is not a Node.js builtin, host-provided package, or declared dependency (module is not reachable from extension.mjs)
- server.test.mjs: import "node:test" is not a Node.js builtin, host-provided package, or declared dependency (module is not reachable from extension.mjs)
- targets.test.mjs: import "node:test" is not a Node.js builtin, host-provided package, or declared dependency (module is not reachable from extension.mjs)
- video-http.test.mjs: import "node:test" is not a Node.js builtin, host-provided package, or declared dependency (module is not reachable from extension.mjs)
- zip64.test.mjs: import "node:test" is not a Node.js builtin, host-provided package, or declared dependency (module is not reachable from extension.mjs)
Changed extension files
extensions/pr-artifact-explorer/README.mdextensions/pr-artifact-explorer/accounts.mjsextensions/pr-artifact-explorer/accounts.test.mjsextensions/pr-artifact-explorer/assets/app.jsextensions/pr-artifact-explorer/extension.mjsextensions/pr-artifact-explorer/package-lock.jsonextensions/pr-artifact-explorer/package.jsonextensions/pr-artifact-explorer/server.mjs
Static checks compile modules without executing them. Minimum preview size is configurable with CANVAS_PREVIEW_MIN_WIDTH/CANVAS_PREVIEW_MIN_HEIGHT. Workflow run
There was a problem hiding this comment.
🟡 Changes recommended
The plugin version remains at 1.0.0, so installed clients may not receive the account-discovery fix until the version is bumped and the marketplace entry regenerated.
1 open issue
What changed in this PR
Repairs GitHub account discovery for Artifact Explorer canvases opened outside a Copilot session on Windows.
Changes:
- Restores default
APPDATAfor GitHub CLI subprocesses when no configuration override is set. - Adds tests for standalone and session-backed discovery, explicit overrides, and non-Windows behavior.
- Documents authentication fallback and separate updates for user-scoped extension copies.
| File | Description |
|---|---|
extensions/pr-artifact-explorer/README.md |
Explains standalone authentication and extension-copy updates. |
extensions/pr-artifact-explorer/accounts.test.mjs |
Adds account-discovery regression tests. |
extensions/pr-artifact-explorer/accounts.mjs |
Adds the conditional Windows APPDATA fallback. |
Review effort: Max (auto)
…very Replace empty AppData keys without duplicate casing, document the redirected Roaming AppData limitation, and regenerate marketplace metadata. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
🔒 PR Risk Scan ResultsScanned 11 changed file(s).
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are blocking the Windows account-discovery fallback change.
No open issues 🎉
1 resolved since last review
1 file not reviewed
extensions/pr-artifact-explorer/package-lock.json: Generated file
Review effort: Balanced (auto)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
An empty HOME on Linux causes CLI account discovery to be skipped despite a valid OS account home directory; safeHome() needs a fallback to os.userInfo().homedir and updated tests.
1 open issue
1 file not reviewed
extensions/pr-artifact-explorer/package-lock.json: Generated file
Review effort: Balanced (auto)
Skip ambient GH_TOKEN/GITHUB_TOKEN when GH_HOST names another host, and retry the matching Windows Roaming gh store when no home-store account authenticates (including revoked tokens). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Fall back to the absolute OS-account home when environment-based home discovery is empty, relative, or unavailable. Cover native Linux empty HOME and unavailable lookup cases. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Token deduplication can hide an authenticated token’s primary CLI store origin, allowing unnecessary Roaming fallback to select a different account when no preference is saved.
1 open issue
1 resolved since last review
1 file not reviewed
extensions/pr-artifact-explorer/package-lock.json: Generated file
Review effort: Max (auto)
There was a problem hiding this comment.
🔵 Needs a closer look
Home-store tokens shared with environment or Copilot credentials lose their provenance during deduplication, incorrectly triggering Roaming fallback and potentially selecting a different active account.
1 file not reviewed
extensions/pr-artifact-explorer/package-lock.json: Generated file
Review effort: Max (auto)
aaronpowell
left a comment
There was a problem hiding this comment.
One account-selection path still needs coverage. In extensions/pr-artifact-explorer/accounts.mjs, add() drops duplicate tokens without retaining all source labels, while resolveAccountsUncached() treats the home CLI store as authenticated only when a candidate has source === "gh". If the home-store token is identical to a Copilot or environment token found first, the valid CLI origin is lost and the code may inspect Roaming unnecessarily, potentially selecting a different account. Please preserve all source origins when deduplicating (or determine home-store authentication before deduplication) and add a regression test for the shared-token case.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
@aaronpowell, the shared-token account-selection issue is fixed in 1d3fd82 with regression coverage. Please re-review when you have a chance. |
There was a problem hiding this comment.
🔵 Needs a closer look
Human assessment is needed because an unpublished finding indicates that credential decoding can prevent session-only authentication for GitHub users with hyphenated logins.
No open issues 🎉
1 resolved since last review
1 file not reviewed
extensions/pr-artifact-explorer/package-lock.json: Generated file
Review effort: Max (dynamic)
aaronpowell
left a comment
There was a problem hiding this comment.
Thanks for adding the shared-token regression coverage and the guarded standalone account-discovery fallback. The latest change now recognizes an authenticated home-store token even when it is deduplicated with a Copilot or environment credential, and the extension validation and canvas smoke checks pass.




Pull Request Checklist
npm startand verified thatREADME.mdis up to date.mainbranch for this pull request.Description
Fix Artifact Explorer failing to find saved GitHub CLI accounts when opened from the Copilot app's standalone Canvases sidebar. In the observed Windows runtime, the standalone provider had neither conversation account credentials nor
APPDATA, soghcould not locate its normal account store.APPDATAis missing, including redirected folders. Preserve explicitGH_CONFIG_DIR,XDG_CONFIG_HOME, andAPPDATAsettings, an existing home configuration, and an explicitly differentUSERPROFILE; conflicting Windows settings fail with a diagnostic rather than selecting an arbitrary store.HOMEfor the CLI subprocess only when an absolute home is available. Ifos.homedir()returns nothing, returns a relative path, or throws, tryos.userInfo().homedir; both lookups retain absolute-path checks and error handling. If neither a safe home nor explicit CLI configuration exists, avoid probing a relative configuration directory. The parent environment is never changed, and no sign-in or GitHub CLI account switch is performed.api.github.com; saved enterprise and lookalike-host CLI accounts are not sent there. Keep session-backed account preference and normal GitHub.com selection. Strip inheritedGH_TOKEN,GITHUB_TOKEN, and Copilot account tokens from CLI subprocesses.USERPROFILE\.config\ghstore has no GitHub.com account that authenticates (including a revoked or expired token thatgh auth tokenstill returns), retry the matching Roaming store after probing. Track home-store credentials independently of token deduplication, so credentials also supplied by Copilot or the environment still count. A subsequent repository-check error does not trigger a retry after/userauthenticates. The fallback is also skipped when the CLI is unavailable, configuration is explicit, or the known folder belongs to another profile.GH_TOKEN/GITHUB_TOKENwhenGH_HOSTnames a host other thangithub.com. These variables carry no trustworthy host, so withoutGH_HOSTthey are still treated as GitHub.com tokens; this narrows, but cannot eliminate, Enterprise tokens reachingapi.github.com.Scope: This recovers saved GitHub CLI accounts; it does not add Copilot-only authentication to standalone canvases, which may have no conversation credentials. Users without a saved CLI account need
gh auth login --hostname github.comor a session-backed canvas. A separately installed user-scoped extension copy must also be updated independently of the plugin.Release: Bump the plugin and extension package to
1.0.1, regenerate the marketplace entry, and document the changes in the plugin and extension READMEs.Type of Contribution
Additional Notes
Validation
node --test --test-name-pattern='home lookup from the OS account' extensions\pr-artifact-explorer\accounts.test.mjs(pre-fix control)node --test --test-name-pattern='Windows roaming fallback .*shared' extensions\pr-artifact-explorer\accounts.test.mjs(pre-fix control)node --test --test-name-pattern='home-store token when the repository request fails' extensions\pr-artifact-explorer\accounts.test.mjs(pre-fix control)node --test extensions\pr-artifact-explorer\accounts.test.mjsnode --test --test-reporter=dot(extension directory)$workspace = (Get-Location).Path; docker run --rm --pull=never --network none --mount "type=bind,source=$workspace,target=/work,readonly" --workdir /work node:22-slim node --test extensions/pr-artifact-explorer/accounts.test.mjsHOME="", verifiesos.homedir()is empty, and recovers the account using realos.userInfo(); CLI and API use synthetic credentials and mocks. The container has no network access or host credentials.npm start(earlier revision)npm run buildnpm run plugin:validatenpm run website:data(earlier revision)bash --noprofile --norc -c 'cd extensions/pr-artifact-explorer && bash ../../.github/scripts/maintenance/fix-line-endings.sh && cd ../../plugins/pr-artifact-explorer && bash ../../.github/scripts/maintenance/fix-line-endings.sh'git diff --checkTests use synthetic tokens and mocked GitHub responses. The Linux and macOS synthetic regressions cover empty, relative, and throwing environment-based lookups; unavailable-home tests mock both lookups, including empty/relative OS homes and failed lookups. Explicit CLI configuration still works when neither home lookup succeeds. Pre-fix controls reproduced the standalone discovery, missing-home, cross-host, and account-selection regressions. The real Windows PowerShell known-folder lookup was also exercised with a synthetic CLI and API; earlier isolated Linux CLI probes checked credential retrieval, missing
HOME, and configuration precedence.Limitations and review
accounts.mjsand be reloaded independently of the plugin./userprobe, including a network outage, leaves home-store authentication unconfirmed and can still cause a same-profile Roaming retry. If connectivity recovers and that store contains a different account, it may be selected. A repository request failing after a successful/userprobe no longer causes that retry.merge-risk:highand requires an eligible maintainer approval and resolution of the outstanding changes-requested review.By submitting this pull request, I confirm that my contribution abides by the Code of Conduct and will be licensed under the MIT License.