feat: optional (best-effort) clash setup steps — click-if-present, else skip#78
Conversation
…se skip
Add an `optional: true` flag to agent-profile setup steps. When set, if the
step's selector never appears within its timeout, the step is skipped instead
of throwing and failing the match.
Motivation: the Agora ConvoAI demo shows a one-time "Personal Data Protection
Guide" consent modal that only appears for accounts that haven't accepted yet.
A hard "click Agree" step fails (timeout) once the account is consented and the
modal no longer renders; omitting it fails for a fresh account where the modal
blocks "Call AI Engine". An optional step handles both: click when present,
no-op when absent.
Usage in a profile's setupSteps (after Sign In, before Call AI Engine):
{ "action": "click", "selector": "button:text-is('Agree')",
"optional": true, "timeout": 8000 }
🤖 Built with SMT <smt@agora.build>
🤖 Codex Code ReviewFindings
Open Questions
No security or performance issues found beyond that error-swallowing edge case. |
🤖 Claude Code ReviewThe change is small, well-scoped, and correct. Optional steps that reference a selector wait up to Two minor observations, neither blocking:
Nothing else stands out. The per-absent-step |
…ures Address code-review: .catch(()=>false) hid invalid selectors / page crashes as 'not present'. Only a Playwright TimeoutError now means skip; any other error still aborts the run. 🤖 Built with SMT <smt@agora.build>
🤖 Codex Code ReviewNo findings.
|
🤖 Claude Code ReviewI reviewed the diff (the This is a clean, well-scoped change. The core design decision — only swallowing No security concerns: selectors/values are the same config-sourced data as before (no new injection surface), and the log line prints A few minor notes, none blocking:
Overall: correct, defensive, and the error-handling refinement in commit |
What
Adds an
optional: trueflag to agent-profile setup steps (SetupStep). When set, if the step'sselectornever appears within itstimeout, the step is skipped (no-op) instead of throwing and failing the match.Why
Debugging live clash matches surfaced this: the Agora ConvoAI demo shows a one-time "Personal Data Protection Guide" → Agree modal that only appears for accounts that haven't consented yet.
click "Agree"step fails (timeout) once the account is consented and the modal stops rendering.An optional step handles both states: click when present, no-op when absent. Generalizes to any conditional UI.
How
In the step loop, if
step.optional && step.selector, probe withwaitForSelector({ state: "visible" }); on timeout, log andcontinueinstead of running the action.Usage
{ "action": "click", "selector": "button:text-is('Agree')", "optional": true, "timeout": 8000 }Notes
vox-upgrade.sh.Generated with SMT smt@agora.io