fix(daemon): lead the wait timeout surface summary with static text

Merged
ST
3d ago
+224-6

Summary

A wait timeout's "Current surface" summary ranked every labeled node equally, so header controls filled the four slots before the status line an agent was waiting for (#5332).

  • surfacePriority leads with static text (normalized statictext/textview roles, excluding edit/autocomplete) and labeled containers, so a modal's title still leads its question text. Chrome never leads.
  • CHROME_ROLE_MARKERS gains toolbar, navigationbar, navigation-bar, bottomnavigation; bar chrome stops consuming slots.
  • Cap, ref lifetime, and details.buttons unchanged; a modal's buttons stay in the payload.

Before / after

maybeWaitTimeoutSurfaceResponse on #5332's chat-list tree (Toolbar, Notifications, Search field, All/Unread/Groups tabs, "Could not load chats" text, "Try Again"):

  • base 7c6ef4a2e: Current surface: Toolbar, Notifications, Search for Chats, All.
  • head b24d29c05: Current surface: Could not load chats, Notifications, Search for Chats, All.

The added regression test fails on base with the base summary and passes on head.

Value

The timeout message names what the screen is saying — the error the agent waited for — instead of the chrome above it. Reporter measured 421 of 1008 s lost in one run.

Validation

  • tested at b24d29c05
  • vitest run src/execution/wait-current-surface.test.ts src/sessions/handlers/snapshot-handler-wait.test.ts: 14 passed (3 added; the modal-summary pin survives via the container tier)
  • pnpm gate fallow --base 7c6ef4a2e: dead 0 Ā· complexity 0 Ā· duplication 0; pnpm typecheck clean
  • CI runs the full lane set, including the Coverage suite
  • Unresolved: an editable iOS UITextView still ranks as static text.

šŸ¤– Generated with Claude Code