Skip to content

v0.2.2 - batches abort when the target window is missing

Choose a tag to compare

@kanishka089 kanishka089 released this 25 Aug 09:28
· 4 commits to master since this release

A safety fix for steps batching, introduced in 0.2.0.

activate_window used to return No window matching '<title>' as an ordinary status string. In a single-action call that was harmless. In a batch it was not: that step decides which application the following keystrokes land in, so reporting the miss and carrying on typed the rest of the batch into whatever happened to have focus.

This is not hypothetical — it happened while driving a release. Chrome had been closed, activate_window reported the miss, and the batch went on to type a URL and press Enter into the editor that had focus. On a tool that drives the real keyboard, a step that silently retargets the rest of the sequence is a hazard, not a warning.

activate_window now raises instead, still listing the open window titles so the failure stays diagnosable. The batch runner already stops on the first exception and reports which step failed, so the run aborts at the right point and no later step executes:

STEP 1 (activate_window) FAILED: LookupError: No window matching 'Chrome' —
nothing was focused, so no further steps were run. Open titles: [...]

Single-action activate_window calls now surface a tool error rather than a success message with a "no match" note — the same information, correctly classified.

Upgrade: uvx realhands@latest picks this up on your next client restart. On a pinned install, pip install --upgrade realhands.