Auto-install official extension stubs in CI - #13581
Merged
BagToad merged 2 commits intoJun 4, 2026
Merged
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the hidden “official extension” stub command behavior so that invoking an uninstalled official extension no longer hangs in non-interactive CI: it auto-installs in CI when prompting isn’t possible, while preserving prompting behavior for interactive TTY sessions.
Changes:
- Aligns official extension stub branching with
ci.IsCI()detection to auto-install in non-TTY CI and show install instructions with a non-zero exit outside CI. - Extends unit tests for the stub run behavior across TTY/non-TTY and CI/non-CI permutations, including clearing CI-related env vars per subtest.
- Updates telemetry acceptance test expectations to account for the new non-zero exit behavior outside CI.
Show a summary per file
| File | Description |
|---|---|
| pkg/cmd/root/official_extension_stub.go | Adds CI-aware non-interactive behavior (auto-install in CI; instructions + SilentError outside CI). |
| pkg/cmd/root/official_extension_stub_test.go | Expands table tests to cover CI/non-CI and TTY/non-TTY branches; resets CI env vars per case. |
| acceptance/testdata/telemetry/telemetry-for-official-extension-stub.txtar | Ensures CI env vars are cleared and expects non-zero exit for the non-TTY outside-CI path. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (1)
pkg/cmd/root/official_extension_stub_test.go:61
- If declining the interactive prompt is changed to return
cmdutil.SilentError(to matchcopilotsemantics), this test case should expect the non-zero exit (and install guidance on stderr) rather than treating the declined prompt as success.
{
name: "TTY declined does not install",
isTTY: true,
confirmResult: false,
},
- Files reviewed: 3/3 changed files
- Comments generated: 1
babakks
approved these changes
Jun 3, 2026
When CI is detected, skip the install prompt and install directly so the stub doesn't block agents and CI runners. Outside CI, keep the existing TTY-prompt and non-TTY silent-error behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
BagToad
force-pushed
the
bagtoad/kw-extension-install-non-interactive
branch
from
June 3, 2026 22:17
08c6393 to
ef8c7d8
Compare
babakks
approved these changes
Jun 4, 2026
shacharPash
added a commit
to shacharPash/pr-review-assistant
that referenced
this pull request
Jun 4, 2026
#14) The '↑/↓ Expand 10' chips were Monaco content widgets, which float on top of the editor text — so once context was expanded, the chip landed on top of a code line (see report). Render them as Monaco view zones instead: each chip gets its own reserved row, so it never overlaps code (GitHub-style). Verified live on cli/cli#13581: chips sit in .expand-context-row zones with 0 overlapping code lines, before and after expanding; expand still works. typecheck + build green. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
shacharPash
added a commit
to shacharPash/pr-review-assistant
that referenced
this pull request
Jun 4, 2026
The view-zone fix (#14) stopped the overlap but introduced a regression: Monaco paints the .view-lines layer above the view-zones layer, so clicks on the chip were swallowed by the lines layer (elementFromPoint returned .view-lines, not the chip). Lift the chip row with position:relative + z-index so the button is the topmost element at its location. Verified live on cli/cli#13581: click now lands on the chip and expands context (39 -> 49 lines); still no code overlap; no console errors. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
shacharPash
added a commit
to shacharPash/pr-review-assistant
that referenced
this pull request
Jun 4, 2026
…hidden (#16) Two issues in the hunks-only renderer (used for files with hidden noise hunks): - Every inter-hunk gap rendered BOTH the previous hunk's '↓ Expand' and the next hunk's '↑ Expand' — two buttons for one gap. Now render one chip per gap: each hunk's '↑ above' (covers the file head + each inter-hunk gap) plus '↓ below' only on the LAST hunk (the file tail). - A ⋯ separator row was inserted between every pair of hunks even when they're contiguous (no hidden lines). Now it's inserted only when there's a real gap, so where a separator/chip appears the line numbers genuinely jump, and fully contiguous hunks render with no fake ⋯ / expand control. Verified on cli/cli#13581: visible contiguous region shows consecutive line numbers and no chip; file shows one head + one tail chip (no stacked pair). typecheck + 70 tests + build green. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Description
Skip the install prompt when
CIis detected so official extension stubs (likegh aw,gh stack) auto-install instead of blocking onY/nin CI runners and agent sessions.Key Points
runCopilotexactly: TTY always wins, so a pseudo-TTY agent session withCI=1still hung on the prompt. This revision flips the order soCIwins over TTY.gh copilot: a follow-up could apply the same change there for consistency, but extension stubs are the more pressing case (agents callgh <extname>frequently).CIis detected viaci.IsCI()(any ofCI,BUILD_NUMBER, orRUN_ID).Notes for reviewers
Two commits, reviewable in order:
fix(extension): auto-install official extension stubs in CIis the behavior change. Theofficial_extension_stubfile holds the new branching; the stub test extends the existing run-function table test and clears CI env vars per subtest; the acceptance test clears CI env vars and expects non-zero exit plus install instructions on stderr.docs(extension): explain CI bypass in stub install logicis a one-line comment addressing review feedback that the non-TTY+CI behavior wasn't obvious from the code.Additional Context
Manually verified locally with
gh stackuninstalled. The TTY+CI case is the one this revision actually fixes versus the previous version of the diff: