chat-open bench: click a subagent line named by its task; a failed click says what the page shows

Merged
TE
2d ago
+75-30

Follow-up to #36070 and #36002 (#36060). Leo, 2026-11-05: "things just don't f***ing open up fast enough on the right. / links. subagents. all".

Part of the main-thread hang push (manaflow-ai/cmuxterm-hq#6338, comment 6597127823), where Leo also said: "i frequently see this / but claude: / and codex: / have much more useful right click things and dont get the application not responding thing".

What was wrong

After #36070 the chat-open subagent case still found no line to click: every open came back no visible element matches, n=10 at base.

  • The running tray and a finished line name a subagent by its task first ("Audit area 3: ..."), so no element's text is the name alone.
  • No finished line (button.cv-subagent-done) is drawn while the tray holds the subagents.

What the bench does now:

  • It tries each subagent's task after its name.
  • Then it tries the enabled buttons of the finished line and the tray line (:not([disabled]), which covers #36060's review follow-up).
  • When nothing matches, the open's reply carries a probe of the subagent selectors the page shows, plus its chat_state, so the next failure names its cause.

Tests (red at base, green at head)

  • scripts/cmux-next/tests/test_chat_open_bench.py SubagentClickTests: test_a_line_named_by_its_task_is_clicked_by_its_task, test_a_line_matched_by_no_text_is_clicked_by_its_selector and test_no_shown_line_keeps_the_error_and_says_what_the_page_shows fail at base and pass at head.
  • 4 OpenTests fail the same way at base and at head (base reds, untouched).
  • In the bench at 1afb16d5 plus this commit (step c13f1372, display Mac, n=5 per condition), 10 of 10 opens were valid. The same bench at #36070's tip gave 0 of 10 (step b3a04e49).

Performance

This PR changes only the measurement.

metricbeforeafterdeltaharness
chat-open subagent valid opens at 1afb16d5 (n=10)010+10b3a04e49 โ†’ c13f1372

Risk

Low. The change is a bench script only. It adds no timers or observers.

Changelog

  • None (bench only).

Agent session: agent session

๐Ÿค– Generated with Claude Code


Autofix with [code]smith
Open in [code]smith ยท Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Makes the chat-open bench click subagent lines that are named by their task, and makes a failed click report what the page actually shows.

The bench previously clicked subagents by name only, which matched nothing once the tray and finished lines started reading the task first ("Audit area 3: ..."). It now tries each subagent's task after its name, then the finished-line and tray-line buttons by selector; when nothing matches, the open's reply carries a probe of which subagent selectors the page shows and its chat state, so the next failure names its cause. Bench script only โ€” no app behavior changes.

Tests

  • SubagentClickTests in test_chat_open_bench.py failed at base and pass at head; tests cover task-named lines, selector fallback, and the no-match probe.