Skip to content

Add act_with_mode: trial and force action modes over the actionability gate#452

Merged
JE-Chen merged 1 commit into
devfrom
feat/act-modes-batch
Jun 26, 2026
Merged

Add act_with_mode: trial and force action modes over the actionability gate#452
JE-Chen merged 1 commit into
devfrom
feat/act-modes-batch

Conversation

@JE-Chen

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

Copy link
Copy Markdown
Member

Summary

Completes the ROUND-15 input-fidelity lane (7/7). actionability.act_when_ready only waits-then-acts. Real flows need two more modes Playwright codified.

  • Headless core utils/act_modes/: act_with_mode(action, bbox_provider, *, mode, …)trial (run every actionability check but DON'T act; report whether it would have — a side-effect-free dry run), force (skip the checks and act now — the escape hatch when the gate misjudges a control), and the default auto (gate then act). Returns {mode, acted, actionable, reason, point, result}. Reuses actionability.wait_actionable + _center; the gate's injectable probes/config are forwarded, so each mode is testable without a screen. Unknown mode raises ValueError.
  • 5 layers wired: facade __all__; AC_act_with_mode executor command (gated/dry-run/force click at a point); ac_act_with_mode MCP tool (side-effect); Script Builder under Flow.
  • Docs: EN + Zh v222_features_doc.rst + WHATS_NEW.md.

Test

test/unit_test/headless/test_act_modes_batch.py — force acts ignoring a disabled probe / no-target no-op; trial reports actionable + not-actionable without ever acting; auto acts when actionable / no-op on gate timeout; unknown-mode raises; ACT_MODES constant; plus facade + executor/MCP/builder wiring. All 10 green; ruff + bandit + radon clean; no float ==; package stays Qt-free.

…y gate

act_when_ready only waits-then-acts. Real flows need two more modes
Playwright codified: trial (run every actionability check but DON'T act -
a side-effect-free dry run) and force (skip checks, act now). act_with_mode
adds both alongside the default auto, over the same injectable seams as the
gate, so each mode is testable without a screen. Reuses wait_actionable.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 23 complexity · 1 duplication

Metric Results
Complexity 23
Duplication 1

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 dcf86b7 into dev Jun 26, 2026
16 checks passed
@JE-Chen JE-Chen deleted the feat/act-modes-batch branch June 26, 2026 04:28
@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