Skip to content

fix(copilot): restore the permission prompt as a blocked signal - #5

Merged
nplez1 merged 1 commit into
nplez1/mainfrom
nplez1/Copilot-Permissions-Issue
Sep 19, 2026
Merged

nplez1 merged 1 commit into
nplez1/mainfrom
nplez1/Copilot-Permissions-Issue

Conversation

@nplez1

@nplez1 nplez1 commented Sep 19, 2026 •

Copy link
Copy Markdown
Owner
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​63 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​60
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​4 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1

ELI5

When Copilot CLI stops and asks "Allow Bash to run this command?", Orca's sidebar kept showing the yellow spinning busy indicator instead of the red question mark that means "this agent needs you". This puts the red question mark back.

What Changed

Before: with a GitHub Copilot CLI pane waiting on a permission prompt, the sidebar and tab read as working (yellow spinner), so nothing signalled that the agent was blocked on you.

After: the same prompt reads as blocked (red question mark) and the pane carries the prompt text, e.g. "Allow Bash to run?" — the same treatment Claude, Codex and Droid already give a real approval wait.

Mechanism. Copilot's status is hook-driven, and the two permission-related hooks mean different things:

  • PermissionRequest fires before the permission service runs — before rule checks, session approvals, auto-allow/auto-deny and user prompting — and it also fires for requests a rule auto-approves. It cannot say whether a human is blocked, so it stays working.
  • Notification with notification_type: "permission_prompt" is the signal that a prompt is actually on screen.

Commit 38bfe083fe (on the unopened fix/copilot-background-work branch, staged into nplez1/main by a24125701a) removed that notification from Copilot's blocking predicate, so a real prompt had no signal left to raise the wait. This restores it in both places it is read: the blocked-state predicate in src/shared/agent-hook-listener/providers/copilot-events.ts and the prompt-text extraction in .../copilot-tool-fields.ts.

Why

The mapping was removed deliberately, for a reason that no longer holds. copilot-cli#2586 made Notification(permission_prompt) fire for every tool execution in interactive mode, including tools already approved for the session, so treating it as blocked parked panes on a prompt nobody had to answer. Copilot CLI 1.0.26 fixed that — "Permission prompt notification hook only fires when a prompt is actually shown to the user" (current CLI is 1.0.86) — so the notification is authoritative again, and the removal now costs a missed prompt instead of preventing a false one.

Alternatives considered:

  • Detect the prompt from the terminal screen instead. Rejected: the hook is the execution host's own report, and a screen rule is a guess over wrapped ANSI text.
  • Raise the wait from PermissionRequest instead. Rejected: it fires before auto-allow/auto-deny, so every auto-approved tool call would read as "needs you".
  • Gate on the Copilot CLI version. Not possible: no CLI version travels in the hook payload, and a probe would leave the current CLI broken until it landed.

This is a fork-local regression: origin/main (upstream) still has the mapping. It exists here only through the unopened fix/copilot-background-work branch.

Linked Issue

None, and no Fixes — this is a fork-local regression, so there is no upstream Orca issue to close (upstream main still maps permission_prompt to blocked). The CLI-side cause is github/copilot-cli#2586, fixed in copilot-cli 1.0.26.

Visual Proof

N/A, and here is why: reproducing needs an interactive Copilot CLI session sitting on a permission prompt, and no Copilot CLI is installed in the environment this was written in. The state is instead pinned at the exact boundary the sidebar consumes — server-copilot-normalization.test.ts posts a permission_prompt to /hook/copilot over HTTP and asserts the listener receives state: 'blocked', and the renderer already maps blocked to the red question-mark "permission" visual (src/renderer/src/lib/agent-status.ts, covered by its own test). Say the word and I will attach a CDP capture from an installed build showing the pane flipping yellow → red.

Testing

  • pnpm test src/main/agent-hooks/ — 88 files, 929 passed, 9 skipped
  • pnpm test src/shared/agent-hook-listener — 19 files, 259 passed
  • pnpm test for the affected renderer notification test, plus server-copilot-normalization.test.ts — passed
  • pnpm typecheck — exit 0
  • oxlint and oxfmt --check on the three changed files — clean
  • pnpm run check:code-quality:changed — 0 new findings

New tests: the permission_prompt → blocked mapping plus prompt text; a lifecycle test pinning working → working → working → blocked → working across UserPromptSubmit, PreToolUse, PermissionRequest, Notification(permission_prompt), PostToolUse; and an HTTP-ingest test for permission_prompt on /hook/copilot.

Platforms: the suite ran on macOS only; no app was launched. The change is platform-agnostic — it reads hook payload fields, with no path, shell, shortcut or windowing code, and the POSIX and PowerShell hook wrappers post the same payload shape.

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

AI Disclosure

Drafted and verified by an AI coding agent (Pi, DeepSeek deepseek-flash) under @nplez1's direction. The root-cause evidence (the CLI changelog entry for 1.0.26 and copilot-cli#2586), the decision to restore rather than rework, and the final diff were reviewed and approved by @nplez1 before this PR was opened.

Review

Two things a reviewer should look at:

  1. PermissionRequest is deliberately left as working. The lifecycle test fails if a later change makes it block, because that would mark auto-approved tool calls as "needs you".
  2. The restored mapping trusts a CLI-side fix. If a Copilot CLI older than 1.0.26 is in use, permission_prompt fires per tool execution and panes will flap. There is no way to detect the CLI version from the payload; the alternative is the missed prompt this PR fixes.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Security: no change to the permission decision itself; Orca only reports what the CLI is doing. No auth, credential or trust-boundary code is touched.
  • Remote SSH / WSL: normalisation runs on the execution host, so the fix applies where the agent runs; nothing in the wire format changed.
  • Windows / Linux / macOS: no platform-specific code.
  • Follow-up (not in this PR): BRANCHES.md still describes fix/copilot-background-work as fixing "a Notification(permission_prompt) was treated as blocked even though approval may be automatic"; that premise is what this PR reverses, and fix/copilot-background-work should drop its permission_prompt hunk when it rebases or the two will collide.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass — typecheck plus the affected test suites pass; full pnpm lint/test/build were not run locally.

Copilot's `PermissionRequest` hook fires before the permission service runs —
before rule checks, session approvals, auto-allow/auto-deny, and user
prompting — so the event alone cannot say whether a human is blocked. The
notification hook is the signal that a prompt is actually on screen, and
dropping `permission_prompt` from the blocking predicate left a real
"Allow Bash to run?" prompt showing the busy indicator instead of the red
question mark.

That mapping was removed because copilot-cli#2586 made the notification fire
for every tool execution in interactive mode, including tools already approved
for the session, so it flapped panes that had nothing to answer. The CLI fixed
that in 1.0.26 ("Permission prompt notification hook only fires when a prompt
is actually shown to the user"), so the notification is authoritative again.
Restore it for both the blocked state and the prompt text the row surfaces.

`PermissionRequest` stays `working`: it still fires for requests a rule
auto-approves, so only the notification may block.
@nplez1
nplez1 merged commit 9189a30 into nplez1/main Sep 19, 2026
30 of 34 checks passed
nplez1 pushed a commit that referenced this pull request Oct 19, 2026
…-page readers off the deprecated owner resolver (stablyai#30478)

Thirteen read-routing callers (#4, #5, #10-#20 of the round-3 caller list) read the owner through
runtimeEnvironmentIdWithLegacyFallbackUnlessTwin. A workspace two hosts publish is no longer
searched on either host. The focus-read ratchet now counts the legacy-fallback adapter, which
reads the focused runtime inside an object literal its discovery skipped; the five F1 entries
that blind spot pruned come back. Deprecated importers 53 -> 40.
@nplez1
nplez1 deleted the nplez1/Copilot-Permissions-Issue branch October 24, 2026 03:23
nplez1 pushed a commit that referenced this pull request Oct 26, 2026
…anel (stablyai#7655)

The workspace space-manager rendered every hosted review as "PR #N", so a
GitLab merge request showed as "PR #5" instead of "MR !5". The cached review
already carries its provider (HostedReviewInfo.provider) — the panel's local
input type just narrowed it away. Thread provider through and format via the
same localizedHostedReviewCopy / '!' vs '#' helpers the rest of the app uses.

Extract the label formatting into hosted-review-label.ts (a pure module, away
from the panel's heavy React/store imports) so it can be unit-tested directly,
and add hosted-review-label.test.ts covering github / gitlab / azure-devops /
gitea and the status suffix.

linkedPR stays "PR #N" — it is the GitHub-specific workspace field, distinct
from linkedGitLabMR.

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Co-authored-by: Neil <[email protected]>
Co-authored-by: Neil <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant