feat(cli): offer to save denied open-url origins on exit#1222
Conversation
PR Review SummarySize
Affected crates
Blast radius — ContainedThis PR touches: source code Updated automatically on each push to this PR. |
There was a problem hiding this comment.
Code Review
This pull request introduces URL denial tracking and validation to the supervisor loop, allowing users to save allowed origins and localhost configurations directly from the interactive profile save prompt. The feedback highlights two key improvements: first, ensuring that pressing the 'deny-all' key (d) in the interactive selector correctly sets URL items to Skip instead of leaving them as Grant to prevent accidental permission grants; second, deduplicating URL denials inline within record_url_denial to prevent buffer exhaustion from repeated requests to the same blocked URL.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
f5cc211 to
e213faa
Compare
Fold fixable open-url denials into the exit-time profile save prompt. After a supervised run where a URL open was denied because its origin is not in open_urls.allow_origins, or because allow_localhost is false, the selector now offers to grant the origin or enable localhost and persist it to a user profile. Only the origin (scheme + host) is saved, never the full URL, so OAuth tokens in query strings are not persisted. Non-fixable denials (bad scheme, oversized, parse errors, browser-launch failures) are classified CLI-side and never produce a record, so they are never offered. Both the macOS and Linux supervisor loops accumulate URL denials. Signed-off-by: Caio Silva <caio@cdcs.dev>
- Factor the Linux supervisor loop's 4-tuple return into a SupervisorLoopResult type alias to satisfy clippy::type_complexity (only tripped on Linux, where the loop also returns URL records). - Deny-all in the interactive selector now skips URL items so pressing Enter afterwards cannot grant the default Grant action. - Deduplicate URL denial records inline so a child polling the same blocked URL cannot exhaust the record buffer. Signed-off-by: Caio Silva <caio@cdcs.dev>
e213faa to
4712e5a
Compare
Linked Issue
Closes #1187
Summary
Fold fixable open-url denials into the existing exit-time profile save prompt.
When a sandboxed child asks the supervisor to open a URL that the profile does
not allow (common in OAuth flows like
gcloud auth login,gh auth login),the denial was previously dropped on the floor. After this change, the exit-time
selector accumulates these denials and offers to:
https://accounts.google.com) toopen_urls.allow_origins, oropen_urls.allow_localhostfor blocked localhost callbacks.Details matching the issue:
tokens in query strings are never persisted.
file:///javascript:, oversized URL, parse error,browser-launch failure) are classified CLI-side and never produce a record,
so they are never offered in the save prompt.
suppress list).
denials.
The library stays policy-free:
UrlDenialReason(incrates/nono) carries onlythe two fixable variants that are actually persisted; the richer non-fixable
classification lives on the CLI-side
UrlDenialenum.Test Plan
make clippy— clean (-D warnings -D clippy::unwrap_used)make fmt-check— cleancargo test -p nono -p nono-cli --bins --lib— nono 670 passed, nono-cli 1303 passedtest_url_denial_maps_to_record_for_save_prompt— a denied origin/blockedlocalhost maps to the correct
UrlDenialRecord(origin-only payload);non-fixable denials map to no record.
build_url_patch_*,build_combined_patch_from_items_*,merge_profile_patch_*(origins dedup-append, localhost monotonicfalse->true).
test_profile_save_prompt_triggers_on_url_denial_with_zero_exit.Note:
test_open_url_helper_binary_succeeds_with_valid_supervisorfails in mylocal checkout because the workspace path makes the supervisor socket path
exceed
SUN_LEN. This is pre-existing (reproduces on a cleanmain) andenvironment-specific, not introduced by this change.
Checklist
CHANGELOG.mdif needed