fix(daemon): lead the wait timeout surface summary with static text
Merged
ST
3d ago+224+224+012345678901234567890123456789-6-6-0123456789
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).
surfacePriorityleads with static text (normalizedstatictext/textviewroles, excludingedit/autocomplete) and labeled containers, so a modal's title still leads its question text. Chrome never leads.CHROME_ROLE_MARKERSgainstoolbar,navigationbar,navigation-bar,bottomnavigation; bar chrome stops consuming slots.- Cap, ref lifetime, and
details.buttonsunchanged; 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 typecheckclean- CI runs the full lane set, including the Coverage suite
- Unresolved: an editable iOS
UITextViewstill ranks as static text.
š¤ Generated with Claude Code