Skip to content

feat: "Allow always" on a bot's requests, with the rules in its details - #110

Merged
httpsphl merged 3 commits into
mainfrom
feat/allow-always
Oct 2, 2026
Merged

httpsphl merged 3 commits into
mainfrom
feat/allow-always

Conversation

@httpsphl

@httpsphl httpsphl commented Oct 2, 2026

Copy link
Copy Markdown
Owner

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 always on the approval item. It is null when the request cannot be allowed for good.

Tool "Always" covers
Bash, PowerShell that exact command (up to 2 000 characters; a longer one is a script, worth reading each time)
WebFetch the site, and its subdomains, as in the browser (21.5)
Read, Write, Edit, MultiEdit, NotebookEdit that file
WebSearch every search
anything else (plan, suggestion, routine, browser, unknown) nothing: it always asks

Daemon

  • approvals.answer takes always: true. With it, the request is kept in allow_rules (migration 0014) and bot.rules is sent. The scope is read from the chat item, because the stored input may be cut short.
  • permission_prompt checks the bot's rules after the running-tool check. A request a rule covers is allowed at once: no approval item and no needs_approval.
  • rules.list and rules.delete show and remove a bot's rules. Deleting the bot deletes its rules too.

App

  • The request card gets a third button that says what it covers ("Permitir sempre este comando", "Permitir sempre em example.com", "Permitir sempre neste arquivo"). Its hint says the bot will not ask again and that it can be undone in the details.
  • The bot's details end with "Permitido sem perguntar". Each rule shows the action and the command, site or file, with an X that makes the bot ask again.

Checks

  • Rust: cargo fmt, clippy -D warnings and cargo test --workspace pass. New tests:
    • store: rules kept once per bot, removal, and deletion with the bot;
    • unit: what each tool's scope covers, and that a site covers its subdomains;
    • 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 no always.
  • App: pnpm check passes (272 tests). allowAlways.test.tsx covers the button, the call with always, the rule in the details and its removal, the site label, and no button for Glob.
  • Preview (pt-BR): "Permitir sempre este comando" on a request turns it into "Permitido: rodar um comando", and the command appears under "Permitido sem perguntar" in the details.

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:

  1. Ask the bot to run git status twice.
  2. Answer "Permitir sempre este comando" on the first request.
  3. The second run should go through without a card, and the bot should not show "Precisa de aprovação".

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`).
@httpsphl
httpsphl enabled auto-merge October 2, 2026 15:33
@httpsphl
httpsphl merged commit 74edaf7 into main Oct 2, 2026
4 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