Skip to content

test(e2e): drive the other-agents permission menu in agent-auto-permissions - #39202

Merged
nwparker merged 1 commit into
mainfrom
nwparker/nightly-e2e-agent-auto-permissions
Nov 6, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/nightly-e2e-agent-auto-permissions

Conversation

@nwparker

@nwparker nwparker commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

A nightly end-to-end test for the Agents > Permissions setting had been failing every night. The test was written for a settings control that no longer exists, so it was looking for radio buttons that are now a dropdown menu.

Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​40 $\color{#cf222e}{\Huge{\mathbf{−}}}$​15 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​25
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​11 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​11

What Changed

  • Before: When the main Permissions choice is "Approve for me", the "Permissions for other agents" control used to be a radio group. fix(settings): permission menus match the chat permission picker #36104 (permission menus match the chat permission picker) deliberately replaced it with the shared permission dropdown, but nobody updated this spec, so it failed with "radiogroup 'Permissions for other agents' radio 'Full access' not found".
  • After: The spec opens the dropdown (button "Permissions for other agents") and picks or checks items inside its own menuitemradio group, scoped by the group's label. It still checks what is saved (window.api.settings.get()) after each step and after a reload.
  • The new assertion, and why it isn't "Full access": On a fresh profile, the settings migration leaves OpenCode, OpenCode 2 and OMP on "Each agent's own settings" as per-agent choices. This is intended and pinned by tui-agent-permission-choice.test.ts: those agents never had a full-access flag. Picking "Full access" for all agents keeps per-agent choices, so after Full access followed by Approve for me, the agents without Auto really do differ (Grok is on full access, OpenCode is on its own settings). The dropdown correctly shows Mixed. The spec now asserts "Mixed" and adds opencode to the saved-permission checks. That makes the spec's stated goal ("global Auto preserves other agents' choices") checkable for both values that are kept. After "Each agent's own settings" is picked, the trigger text and the checked menu item are both asserted, before and after reload.
  • Routing: PR CI never picked this spec. A new feature.agent-permission-settings route selects it for changes under settings/agents/permissions/, agent/launch-settings/AgentPermission*, and the shared permission choice, migration and update modules. Unit tests cover the route.

Why

The product change was deliberate (#36104), so updating the test is the right fix. The checks stay as strong as before: they now verify both the displayed state and the saved state at each step. Open PR #38365 updates the same spec but asserts that "Full access" is checked in an unscoped menuitemradio query. On current main that fails, because the menu's value is empty (Mixed), and an unscoped query can also match items from the other Permissions menu. This PR scopes the queries to the other-agents menu and asserts the real Mixed state.

Linked Issue

N/A (nightly E2E failure; maintainer fix)

Visual Proof

N/A: test-only change, no UI or behavior change.

Testing

  • Reproduced the CI failure locally on macOS (headless, background launch). A temporary debug dump showed that a fresh profile starts with agentPermissionDefault: 'full-access' and {opencode, opencode2, omp}: 'own'.

  • With the fix, tests/e2e/agent-auto-permissions.spec.ts passed 2 times in a row locally.

  • Routing unit tests pass (config/scripts/workflow/source-routing, config/scripts/ci/...: 143 tests), and oxlint and the changed-code quality gate are clean.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

  • Every added test fails without this change and avoids the test anti-patterns

Risk

Test and CI-routing only. The new route adds this one spec (about 30 s) to PRs that touch agent permission settings. Revert is a plain revert.

Level: Low

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Overlaps #38365, which edits this spec. See Why.

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)
  • I stated the risk: what could break, for whom, and how to back it out
  • 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 (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 2 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 289a933b-5884-4a61-9212-21ba43fe7bd3
Commits

Reviewing files that changed from the base of the PR and between 6e46963 and 8b18cf2.

Files selected for processing: 3

  • config/scripts/workflow/source-routing/pr-e2e-gate-contract.test.mjs
  • config/scripts/workflow/source-routing/pr-feature-area-e2e-source-routes.mjs
  • tests/e2e/agent-auto-permissions.spec.ts

No actionable comments were generated in the recent review.

Walkthrough

The E2E test now checks the other-agents control as a button with a menu, and verifies permission values for Grok and OpenCode before and after reload. Source-routing rules map agent permission settings and launch-settings changes to this test. Routing tests cover the listed product sources and confirm that the TUI permission-choice unit test does not select it.

Merge Risk: Minimal · previous review 6e469

The change updates permission-menu coverage and CI routing; no merge-blocking issue is evident.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title clearly describes the main E2E test change.
Description check Passed The description covers the changes, reason, testing, risk, and revert plan. It identifies the fix as a maintainer change and explains why visual proof is not needed.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 3 files.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6277b050-dd3f-4758-bbb3-8b089edf7dd6
Commits

Reviewing files that changed from the base of the PR and between a2ad899 and 6e46963.

Files selected for processing: 3

  • config/scripts/workflow/source-routing/pr-e2e-gate-contract.test.mjs
  • config/scripts/workflow/source-routing/pr-feature-area-e2e-source-routes.mjs
  • tests/e2e/agent-auto-permissions.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@nwparker
nwparker force-pushed the nwparker/nightly-e2e-agent-auto-permissions branch from e7cf9fc to 6e46963 Compare November 6, 2026 22:50
…ssions

permission dropdown, and fresh profiles keep OpenCode on its own settings, so
the agents without Auto read Mixed after Full access -> Approve for me. Assert
that, track OpenCode in the stored-permission checks, and route the spec on
permission settings sources.
@nwparker
nwparker force-pushed the nwparker/nightly-e2e-agent-auto-permissions branch from 6e46963 to 8b18cf2 Compare November 6, 2026 23:01
@nwparker
nwparker enabled auto-merge (squash) November 6, 2026 23:01
@nwparker
nwparker merged commit c8ea52d into main Nov 6, 2026
48 checks passed
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