Skip to content

Desktop: approvals answered too late run nothing, one dialog at a time, one grant per folder - #1587

Open
davidmckayv wants to merge 3 commits into
mainfrom
fix/stale-approval-prompt
Open

davidmckayv wants to merge 3 commits into
mainfrom
fix/stale-approval-prompt

Conversation

@davidmckayv

@davidmckayv davidmckayv commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

What broke

OpenBot Desktop asks before a Bot runs a command or changes a file in a folder, with a native "Allow this command?" dialog. When nobody answers within the time OpenBot waits, OpenBot gives up on that action, but a native dialog cannot be closed from outside, so it stayed on screen:

  • It still offered Allow once, and pressing it did nothing anyone could see.
  • Until someone dismissed it, every folder action that Bot asked for failed with "That Bot already has a host operation in progress."

The fix

  • Allow on an action OpenBot already gave up on runs nothing and opens a notice: "This command didn't run. OpenBot stopped waiting for your answer, so 's command didn't run. Ask again to run it." (or "This file wasn't changed" for a file change). The notice is not waited for.
  • When an action is cancelled, its Bot is free at once: the next action asks straight away, even with the stale dialog still open. A cancelled action no longer counts toward the limit of four waiting.
  • A Bot's slot is now tracked by the action holding it, so the stale dialog's worker finishing later cannot free a newer action's slot.
  • One dialog at a time. A second dialog shown beside the stale one sat exactly on top of it, two identical dialogs nobody could tell apart. Every dialog (folder picker, command, file change, and the "didn't run" notice) now waits for the one before it, and one that is no longer wanted by its turn is never shown.
  • One grant per Bot and folder. Choosing a folder the Bot already had made a second grant beside the first (Settings read "2 read-only folders", and the Bot saw two grants with one name). Choosing it again now makes the existing grant live again, under the id the Bot already knows.

Tests

  • a_command_allowed_after_the_server_stopped_waiting_does_not_run_and_the_folder_still_asks: cancel, then a late Allow; nothing runs, the notice fires once, the folder is still held, and the next command asks again.
  • a_dialog_left_on_screen_holds_up_no_bot_and_the_next_dialog_waits_its_turn: with the stale dialog still open, the Bot's next command is taken (not turned away) but not shown; once the stale one is answered and its notice closed, it is shown; one given up on while waiting is never shown.
  • choosing_a_folder_the_bot_already_has_keeps_one_grant_and_makes_it_live_again: the same folder chosen again for the same Bot keeps one grant, live, under the same id; another Bot gets its own.
  • a_late_allow_says_nothing_ran_and_names_the_bot: the notice's words.

The behaviour tests fail with the fix taken out and pass with it. Checked live on Windows and Mac before merge.

…es its Bot

A native dialog cannot be closed from outside, so "Allow this command?"
stayed on screen after OpenBot stopped waiting for it, still offering
Allow once. Pressing it did nothing anyone could see, and until it was
dismissed every folder action that Bot asked for failed with "That Bot
already has a host operation in progress."

Allow on an operation that was cancelled or expired now runs nothing and
opens a notice that says the command didn't run (or the file wasn't
changed) and to ask the Bot again. When an operation is cancelled, its
Bot's slot is freed at once, so the next action asks straight away, and
a cancelled operation no longer counts toward the waiting limit.
With a stale "Allow this command?" still on screen, the next dialog
sat exactly on top of it: two identical dialogs nobody could tell
apart. Every dialog now waits for the one before it, the "didn't run"
notice included, and one that is no longer wanted by its turn is never
shown.

Choosing a folder the Bot already had made a second grant beside the
first, so Settings listed it twice and the Bot was handed two grants
with one name. Choosing it again now makes the existing grant live
again, under the id the Bot already knows.
@davidmckayv davidmckayv changed the title Desktop: an approval answered too late runs nothing, says so, and frees its Bot Desktop: approvals answered too late run nothing, one dialog at a time, one grant per folder Nov 14, 2026
A grant is read-only whichever time it was chosen. The test now checks
that after the same folder is chosen again, a file change and a command
that can change files still ask the person, even under always allow.

This branch has not been deployed

No deployments
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