Repository navigation
test(e2e): drive the other-agents permission menu in agent-auto-permissions - #39202
Conversation
|
Warning Review limit reachedYou'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. View limit details
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
e7cf9fc to
6e46963
Compare
…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.
6e46963 to
8b18cf2
Compare
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.
What Changed
button"Permissions for other agents") and picks or checks items inside its ownmenuitemradiogroup, scoped by the group's label. It still checks what is saved (window.api.settings.get()) after each step and after a reload.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 addsopencodeto 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.feature.agent-permission-settingsroute selects it for changes undersettings/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
menuitemradioquery. 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.tspassed 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
Notes
Overlaps #38365, which edits this spec. See Why.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)