Skip to content

Add popup/interrupt watchdog for unattended automation#216

Merged
JE-Chen merged 1 commit into
devfrom
feat/popup-watchdog
Jun 18, 2026
Merged

Add popup/interrupt watchdog for unattended automation#216
JE-Chen merged 1 commit into
devfrom
feat/popup-watchdog

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jun 18, 2026

Copy link
Copy Markdown
Member

Summary

The practitioner pain-point research flagged this as the #1 cause of
unattended-automation failure
: an unexpected dialog the script was never
coded for (UAC, "session expiring", Windows Update, a modal). The popup
watchdog runs a concurrent guard thread that watches for registered
patterns and dismisses them independently of the main step sequence.

(Re-targeted to dev after #214 merged; diff is watchdog-only.)

What's added (full five-layer wiring)

  • Headless PopupWatchdog / WatchdogRule / default_popup_watchdog:
    generic matcher+action rules, window-title convenience builders
    (action="close" or a key to press), background poll thread, hits
    log. A failing rule is logged and skipped — one bad rule never kills the
    guard loop.
  • Executor: AC_watchdog_add / AC_watchdog_start /
    AC_watchdog_stop / AC_watchdog_list.
  • MCP tools: ac_watchdog_*. Script Builder: "Flow" entries.
  • Docs: v8 reference page (EN + Traditional Chinese) + README sections.

Testing

  • Headless tests use injected matcher/action callables (no real desktop):
    dismissal, error-swallowing resilience, start/stop lifecycle, and the
    executor/MCP/builder wiring.
  • ruff / radon / bandit clean; import je_auto_control stays
    Qt-free; no orphan Script Builder commands.

Add a concurrent guard thread that watches for registered popups and
dismisses them independently of the main flow — the #1 unattended-run
failure cause per the practitioner-pain research. Generic
matcher+action rules (window-title convenience builders + injectable
custom rules); a failing rule is logged and skipped so the loop never
dies. Wired through facade (PopupWatchdog / WatchdogRule /
default_popup_watchdog), AC_watchdog_add/start/stop/list executor
commands, ac_watchdog_* MCP tools, Script Builder entries, fake-driven
headless tests, and v8 docs / README sections.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 53 complexity · 0 duplication

Metric Results
Complexity 53
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen JE-Chen merged commit 9a0ea4e into dev Jun 18, 2026
16 checks passed
@JE-Chen JE-Chen deleted the feat/popup-watchdog branch June 18, 2026 22:19
@sonarqubecloud

Copy link
Copy Markdown

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