Repository navigation
fix(cua): SoM click must focus the input — the core of the type-stall - #952
Merged
Merged
Conversation
Live verification of #951 showed typing STILL failed: the brain SoM-clicks the search box but the run halts with the brain only emitting wait()/Return. Root cause is one layer deeper than #951: the SoM click path (cdp_click_at_point, which the runner uses for unstructured clicks) dispatches `el.click()` via Runtime.evaluate — and programmatic el.click() fires a click event but does NOT focus a text input the way a real mouse click does (focus happens on mousedown). So search/login/composer fields were left UNFOCUSED, the brain had no field to type into, and it stalled. #951's env CLICK-branch probe never even ran because SoM swaps the action to a no-op WAIT. Fix: - cdp_click_at_point: focus focusable targets (INPUT/TEXTAREA/SELECT/ contenteditable) before el.click(), mirroring native focus→click ordering; report `focused` on the result + _last_som_diag. - runner: after a SoM-dispatched click that focused a field, surface focused_input → the "input field focused — type your text now" feedback (#951) now fires on the SoM path too, so the brain types instead of waiting. Tests: test_cua_input_focus_feedback.py — SoM payload focuses + reports focused. 215 adjacent tests green; ruff clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
mercurialsolo
added a commit
that referenced
this pull request
Jul 1, 2026
…atrix + trajectory scanner) The cua-issues audit (R1-R3) ran against real LinkedIn/Reddit — where anti-bot from Modal IPs dominates the signal and where the audited builds predated the #948/#951/#952 fixes. This gives a clean capability read on any current build: - run_cua_audit.py: fires a category matrix against the mantis-linkedin sim env (deterministic, no anti-bot) — read / read-profile / search-type / contenteditable-write / multi-step-nav. Non-destructive (the write task types into the composer but never sends; nothing logs in or submits). - scan_cua_audit.py: reads the per-run trajectories off the Modal volume and prints the REAL per-category verdict (focus / typed / type-landed-verified / clicked / done) — wire status alone lies here (the sim-env search-results page is a stub, so a perfect type still 'halts'). First run on 69af1a6: reads work; search type-landing FIXED (text landed, verified) — the audit's "search 0/7" was stale (pre-#948); multi-step click+nav and contenteditable-write still fail (both gated by the multi-step click chain). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jul 1, 2026
mercurialsolo
added a commit
that referenced
this pull request
Jul 1, 2026
…atrix + trajectory scanner) (#954) The cua-issues audit (R1-R3) ran against real LinkedIn/Reddit — where anti-bot from Modal IPs dominates the signal and where the audited builds predated the #948/#951/#952 fixes. This gives a clean capability read on any current build: - run_cua_audit.py: fires a category matrix against the mantis-linkedin sim env (deterministic, no anti-bot) — read / read-profile / search-type / contenteditable-write / multi-step-nav. Non-destructive (the write task types into the composer but never sends; nothing logs in or submits). - scan_cua_audit.py: reads the per-run trajectories off the Modal volume and prints the REAL per-category verdict (focus / typed / type-landed-verified / clicked / done) — wire status alone lies here (the sim-env search-results page is a stub, so a perfect type still 'halts'). First run on 69af1a6: reads work; search type-landing FIXED (text landed, verified) — the audit's "search 0/7" was stale (pre-#948); multi-step click+nav and contenteditable-write still fail (both gated by the multi-step click chain). Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
mercurialsolo
added a commit
that referenced
this pull request
Jul 1, 2026
…fix multi-step nav (#955) Re-audit on the current build isolated the last open fault: multi-step click+nav (and the contenteditable-write flow it gates) failed because a SoM click on a feed row resolved to a NON-actionable container (DIV.post-author-meta) even though the brain aimed at the author-name link inside it. cdp_click_at_point's el.click() on that div does nothing, so navigation clicks looped to a halt. Fix (same family as #952's el.focus): before clicking, snap a non-actionable target to the nearest actionable element — an ancestor <a>/<button>, or a SINGLE actionable descendant whose box is within 40px of the click point (bounded so we never jump to a distant link in a huge container). Report retargeted/target_tag. VERIFIED live: the multi-step "open the author's profile and read the headline" task went halted(loop) → succeeded — the click retargeted to <a href="/in/lena-tanaka-9d79/"> and navigated to the profile (logs show the next frame is DIV.hero-banner on the profile page). Tests: test_cua_input_focus_feedback.py — SoM JS carries the retarget helpers and clicks the retargeted element. 6 pass; ruff clean. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bottom layer of the type-stall
Live-verifying #951 showed typing still failed. Root cause is one layer
deeper: the SoM click path (
cdp_click_at_point, which the runner uses forunstructured clicks) dispatches
el.click()via Runtime.evaluate — and aprogrammatic
el.click()fires a click event but does NOT focus a textinput (real mouse clicks focus on
mousedown).So:
el.click()→ click fires, input not focused (activeElementstaysbody).WAIT, so fix(cua): tell the brain when a click focused an input — break the type-stall #951's envCLICK-branch probe never runs.focused_input→ brain never told to type → stalls onwait()/Return.This is the actual bottom of the audit's "type never lands."
Fix
cdp_click_at_point:el.focus()focusable targets(
INPUT/TEXTAREA/SELECT/contenteditable) beforeel.click(),mirroring native focus→click ordering; report
focusedon the result and_last_som_diag.focused_inputsothe fix(cua): tell the brain when a click focused an input — break the type-stall #951 "input field focused — type your text now" feedback fires on the
SoM path too — the brain types instead of waiting.
Tests
test_cua_input_focus_feedback.py— SoM payload focuses + reportsfocused.215 adjacent tests green;
ruffclean.Verification
After merge + deploy I'll re-run the live typing test — expecting the brain to
finally
type()into the focused search box. This is layer 3 of the type-stall(brain-dead #948 → focus-feedback #951 → SoM-focus here); I'll confirm
empirically rather than assume.
🤖 Generated with Claude Code