Repository navigation
feat: "Allow always" on a bot's requests, with the rules in its details - #110
Merged
Merged
Conversation
A bot asked again for the same command or site every time, and the owner spent the day saying yes. Now a request can be allowed for good (spec 10.1): - Each approval item says what "Allow always" would cover (`always`): that exact command (Bash, PowerShell, up to 2 000 characters), the site of a WebFetch (and its subdomains, as in the browser), the file of a Read/Write/Edit/MultiEdit/NotebookEdit, or every WebSearch. Plans, suggestions, routines, the browser and unknown tools always ask. - `approvals.answer` with `always: true` keeps it in `allow_rules` (migration 0014) and sends `bot.rules`. - `permission_prompt` allows a request a rule covers at once, after the running-tool check, without an approval item or `needs_approval`. - `rules.list` and `rules.delete` show and remove a bot's rules; deleting the bot takes them along.
…tails
- A request that can be allowed for good gets a third button that says
what it covers ("Always allow this command", "Always allow
example.com", "Always allow this file"), with a hint that the bot will
not ask again and where to undo it.
- The bot's details end with "Allowed without asking": each rule with
its action and the command, site or file, and an X that makes the bot
ask again. Read when shown, kept current by `bot.rules`.
- The fake daemon keeps rules too (`fakeAllow.ts`).
# Conflicts: # docs/spec.md
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.
What
A bot asked again for the same command or site every time. Now the owner can allow a request for good, and the bot stops asking for it (spec 10.1; roadmap item 18.3).
What it covers. The daemon decides from the tool and its input, and sends the result as
alwayson the approval item. It isnullwhen the request cannot be allowed for good.Bash,PowerShellWebFetchRead,Write,Edit,MultiEdit,NotebookEditWebSearchDaemon
approvals.answertakesalways: true. With it, the request is kept inallow_rules(migration 0014) andbot.rulesis sent. The scope is read from the chat item, because the stored input may be cut short.permission_promptchecks the bot's rules after the running-tool check. A request a rule covers is allowed at once: no approval item and noneeds_approval.rules.listandrules.deleteshow and remove a bot's rules. Deleting the bot deletes its rules too.App
Checks
cargo fmt,clippy -D warningsandcargo test --workspacepass. New tests:tests/allow_always.rs: allowed always, the same command no longer asks and another command still does; list, delete, and it asks again; a site rule covers other pages; a plain Allow keeps no rule; a plan has noalways.pnpm checkpasses (272 tests).allowAlways.test.tsxcovers the button, the call withalways, the rule in the details and its removal, the site label, and no button forGlob.Still to see (real Claude Code)
Nothing new is asked of Claude Code: a request a rule covers gets the same
{"behavior":"allow"}an answered one gets. To check with a real bot:git statustwice.