Skip to content

Add popup/interrupt watchdog for unattended automation#215

Closed
JE-Chen wants to merge 1 commit into
feat/native-ui-controlfrom
feat/popup-watchdog
Closed

Add popup/interrupt watchdog for unattended automation#215
JE-Chen wants to merge 1 commit into
feat/native-ui-controlfrom
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, so
a long run keeps going.

Stacked on #214 (native UI control) — both touch shared files
(__init__, executor, MCP, builder, docs). Base will auto-retarget to
dev when #214 merges; this PR's diff is watchdog-only.

What's added (full five-layer wiring)

  • Headless core PopupWatchdog / WatchdogRule: generic
    matcher+action rules, window-title convenience builders
    (action="close" or a key to press), a background poll thread, and a
    hits log. A failing rule is logged and skipped — one bad rule never
    kills the guard loop.
  • Facade: PopupWatchdog, WatchdogRule, default_popup_watchdog.
  • 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),
    covering 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.
@sonarqubecloud

Copy link
Copy Markdown

@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 deleted the branch feat/native-ui-control June 18, 2026 22:08
@JE-Chen JE-Chen closed this Jun 18, 2026
@JE-Chen JE-Chen deleted the feat/popup-watchdog branch June 18, 2026 22:19
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