Repository navigation
fix(computer): fail closed on malformed macOS AXSubrole - #1385
Conversation
swjnxyf
left a comment
There was a problem hiding this comment.
Reviewed all three changed files and the macOS AX read / fingerprint / tree / scoped-correlation / native control paths at 87b8d18 on mini. AXSubrole provider Failure and unexpected CF value types conservatively mark the element protected; inherited protection suppresses title, description, placeholder, AXValue, native press/focus/scroll and text input. Unverified nodes lack positive identity evidence; ordinary NoValue/unsupported, API-disabled, and other errors retain their respective original fail-closed handling. Exact AX attribute names improve diagnostics without exposing values. On mini (macOS arm64), cargo test --locked --offline -p webcodex-computer --lib passed: 90 passed, 0 failed, 6 intentionally ignored; cargo fmt --all -- --check and git diff --check passed. The optional live Calculator test is intentionally not run here because no Calculator window is open; the PR documents successful author's opt-in live test. Hosted CI was still running at review time, with no failures observed. No blocking findings or follow-up commits required. Approve; do not merge.
Summary
AXUIElementCopyAttributeValue(AXSubrole)returningAXError(-25200)without discarding the entire accessibility tree.Observed reproduction
Directly reproduced with WebCodex 0.5.0 on macOS (Apple M1).
observe_computer(action=accessibility_tree)on a Calculator window failed with:On isolated current
main(d8e437b4), diagnostic instrumentation identifiedattribute=AXSubrole. An opt-in Calculator test passed at tree depths 0 and 1, but failed at depth 2 before this fix. After this change it passes at depths 0–3.The root cause inside Apple's AX provider is not established; the fix conservatively handles a bounded failure case rather than assuming the subrole is absent.
Safety
CFString(tested usingCFBoolean) is also protected, not treated as a benign missing subrole.AXError::APIDisabledremainspermission_denied; unrelated failures remain failures. No changes to authorization, installation, Server, or Runner process lifecycle.Validation
cargo fmt --all -- --check— passedgit diff --check— passedcargo test --locked --offline -p webcodex-computer --lib— 90 passed, 0 failed, 6 ignoredcargo test --locked --offline -p webcodex-computer computer_macos_accessibility_calculator_live_regression -- --ignored --nocapture— 1 passedAXDescriptionAXError(-25200), deliberately left outside this PR./healthzreturned HTTP 200.Related to #1161 (Computer Use ergonomics/reliability); this patch does not close the broader issue.