Repository navigation
test: trim low-value UI and subagent test scaffolding - #198960
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR trims presentation assertions, request-count instrumentation, and optional capture scaffolding while retaining behavioral regression coverage. Example: Archive a conversation containing the draft “Keep this unsent draft,” then select Undo.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR is a useful, focused test cleanup with no actionable findings; the previous conflict is resolved, and exact-head CI is still pending. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe affected tests feed synthetic Gateway responses and agent events into existing UI and subagent owners, then check rendering, mutations, recovery, and settlement. flowchart LR
A[Synthetic Gateway responses] --> B[Control UI owners]
C[Agent lifecycle events] --> D[Subagent registry]
B --> E[Retained behavioral assertions]
D --> E
E --> F[Scoped tests and CI]
Technical reviewBest possible solution: Land the focused test trims once the existing exact-head CI gate passes. Do we have a high-confidence way to reproduce the issue? This is test maintenance rather than a product bug; the read-only review inspected source and supplied validation without executing tests. Is this the best way to solve the issue? The in-place trims satisfy the accepted value rubric without adding machinery, and meaningful lifecycle, authority, recovery, and deletion coverage remains in existing owners. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against fe34585478fd. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests -427. Total -427 across 6 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (7 earlier review cycles)
Reviewed November 23, 2026, 5:20 AM ET / 10:20 UTC (Revision 8). |
e61c177 to
f28a714
Compare
|
@clawsweeper re-review Exact head |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Please review exact head |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Please review exact head The complete final scope passed 166 tests across 9 files, all 5 relevant type graphs, oxlint and formatting. The fresh complete 7-pass P2 review is clean. The body contains the per-file evidence and accurately records the separate, still-unclassified prior attachment timing failure. Net removal remains 427 test lines. |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Please review exact head |
|
🦞👀 Re-review progress:
|
b95c6e8 to
1d2f01e
Compare
|
@clawsweeper re-review Please review exact head |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…203176) ## Problem A requester that calls `sessions_yield` after spawning several completion-mode subagents was woken only when every member of the frozen yield batch was ready. A sibling that keeps running, or that pauses on its own `sessions_yield` while a background command runs, held every finished result back. Production incident (2026-11-21): a dashboard parent spawned 3 children and yielded at 16:20 IST. Two children finished at 16:26:58 and 16:29:41 with reports that needed a decision. The third kept cycling through exec-yield and resume. The Gateway log has no `announce:requester-settle:…` run for that parent. The parent ran again only at 18:32, when the user typed into the chat. A copy of the state database shows why: both finished rows were `terminal`/`ok` with `delivery.status: pending` and a pending `requesterSettleWake` (`batchRunIds` = all 3, `rearmGeneration: 1`). The third row was still `running`. The gate in `subagent-announce.requester-settle-wake.ts` returned `false` unless every frozen member passed `isRequesterSettleMemberReady`. #200967 had already made an exception for siblings that wait for a message. An exec-yielded or running sibling is the same bug class. ## Change Rule: every ready result wakes the yielded parent. Siblings that are still working keep their wake, with the same `rearmGeneration`, and wake the parent again when they finish. Each result is delivered once. - **Settle wake:** removed the all-or-nothing gate and the message-wait exception (`isEndedSubagentMessageWait` is deleted). The wake delivers the ready members of the frozen batch as one partition, and lists the members that are still working. A member whose partition has already started dispatch records its own batch, so a later partition never offers it again. When a partition holds only results that were already delivered and siblings are still pending, it settles without a redundant wake. - **Wake message:** a partition that leaves members pending no longer says "every subagent has settled… do not call sessions_yield again". It names the siblings that are still working (label, task name or run ID, at most 5, each truncated) and tells the parent: if the request needs those results, call `sessions_yield` to wait; otherwise act on the ready results without reporting the batch as finished. - **Lifecycle failure path:** `offeredBatch` now offers only ready members, so failure settlement can never consume the wake of a sibling that is still running or exec-yielded. - **Yield transfer:** when a child ended before the yield and a sibling is still running, `afterRelease` now schedules the settle for the finished child. Before, nothing woke the parent until the sibling ended. - **Followup owners** (`sessions_send` wait-for-reply, `agent-step`, nested `agent-run-subagent`): the caller is waiting for a single reply. Only the partition that leaves no member pending continues the followup. Earlier partitions wake the session as ordinary settle turns. `successor()` accepts that last partition as a subset of its cohort, so it no longer throws and records the result as a permanent failure. - **Automation authority:** a yield that carried cron-management authority keeps it for the partition that leaves no member pending. Earlier partitions run without borrowing it, and settling them shrinks the retained cohort instead of discarding the authority. - **Silent waits:** while siblings are still working, the parent may stay silent (`NO_REPLY`) and wait. Such a turn is not treated as a missing visible reply, so it is not retried. - **Goal return:** an earlier partition leaves the Goal cohort when it settles. The partition that settles the cohort last resumes the Goal once. - `isRequesterSettleMemberReady` moved to `subagent-run-liveness.ts`, its only owner, and replaces the deleted message-wait predicate. - Docs: `tools/subagents/announce.md` and `concepts/subagent-yield-handoff.md`. Product decisions, under the rules "no stranded user" and "no false done": - A stopped child is a settled outcome, so its report now wakes the parent right away instead of waiting for its siblings. - A followup caller gets one reply, after all results are in. The session itself is still woken for each result. ## Evidence **Regression test** (`subagent-registry.requester-wake.e2e.test.ts`, real registry, lifecycle, yield tool and wake entry point): spawn 2 children, yield, finish one, keep the other exec-yielded. The parent is woken with the finished result, and the wake names the working sibling. The sibling's continuation then wakes the parent again with only its own result. A sweep adds no third wake. A second case covers a child that ended before the yield, while the requester's turn held it. - Base `eb7ca3d33375`: both cases red (`expected [] to have a length of 1`: no wake). - Head: both cases green. **Owner tests:** cron authority (`requester-cron-authority.test.ts`: the early partition neither borrows nor consumes the authority, and the last partition is admitted with it), followup partition (`subagent-announce.requester-settle-followup.test.ts`: early partition runs with no followup successor, last partition carries it). Goal partition (`goal-continuation.test.ts`: early partition does not resume the Goal, last partition resumes it once). **Updated tests that asserted the all-at-once rule:** `requester-settle-cross-turn` (paused member), `subagent-control.worker` progress card (one wake per result; the card retires once), `requester-wake-settlement` (stopped child). **Real-Gateway E2E**, incident shape. Scratch `ocx src` Gateway under `env -i`, OpenAI `gpt-5.5` on the OpenClaw runtime. Parent spawns `alpha` (replies at once) and `beta` (`exec` with `background: true` running `sleep 90`, then `sessions_yield`), then yields. | | alpha ended | first parent wake | beta yielded | beta ended | second parent wake | |---|---|---|---|---|---| | base | 19:47:10 | **19:48:53** (one combined run, after beta) | 19:47:13 | 19:48:50 | none | | head | 19:40:08 | **19:40:11** (`announce:requester-settle:…:<alpha>:yield-1`) | 19:40:12 | 19:41:55 | 19:41:59 (`…:<beta>:yield-1`) | The parent's replies on head were `alpha: ALPHA-RESULT-7`, then `alpha: ALPHA-RESULT-7 / beta: BETA-RESULT-9`. The live Peanutto launchd pid and `openclaw.json` hash did not change. **Live sibling suites** (`subagent-yield-pause`, `subagent-followup-yield`, `subagent-yield-resume`, real OpenAI `gpt-5.5`): the same tests fail on base `eb7ca3d33375` and on this branch, with the same assertions (missing `completion.resultText` after a resumed or paused child completes, a Gateway shutdown timeout, an interim reply in the follow-up watch case; follow-up-yield failed 2 of 2 on base). One run of this branch showed a parent that wrote its final report as soon as the first result arrived; the wake message now says to keep waiting when the request needs the remaining results, and that failure no longer appears. The real-Gateway restart e2e files (`test/gateway-*-restart*.e2e.test.ts`) fail locally on base too (11 of 26 on base, 9 of 26 here, same assertions). **Gates:** `pnpm tsgo:core`, `pnpm check:test-types`, oxlint and oxfmt on the changed files. Every test file in `src/agents/subagents` and `goal-continuation.test.ts` was run across the unit-fast, infra, agents-support, spawn-boundary, core-isolated and e2e projects. Two infra tests failed once under host load and passed when run alone, on head and on base. ## Size Production code is +96 / −56. The gate, the message-wait exception and its predicate are deleted. The added lines are the partition support the old gate did not need: pending members in the message, the followup last-partition rule, Goal cohort shrink, and pre-yield scheduling, and cron-authority cohort shrink. A census of `batchRunIds`, `requesterYieldBatch`, the frozen branch and `selectConnectedSettledSubagentWave` found every remaining reader still in use. v8 coverage could not attribute lines under the compiled-worker test runner (0 files collected in two attempts), so the census was done by reading the code. ## Accepted edge cases - If a Goal cohort's last partition is rejected for an unrelated reason (for example, a rearm-generation mismatch), the Goal return stays retained until Stop or a lifecycle rotation. That is the same outcome as a failed final delivery today. - A nested requester whose early partition answers without yielding reports that answer to its parent. The later result wakes it again as a separate completion. ## Merge danger - **Two-way door.** No schema, stored-row or config change: the wake rows keep their existing fields and generation. A revert restores the all-at-once wake for every cohort, including rows written while this change ran. - **Blast radius:** requesters that yield on two or more completion children (dashboard, chat and nested subagent requesters). A defect here would show as an extra or a missing wake for the parent, not as a lost child result: every result stays saved in its child session. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 09d956b) Release adaptation: Kept stable QA Gateway fixture lifecycle; filtered intentionally silent partial-result wakes. Companion audit: #203222 selected. #204249, #204069, #204048, #203892, #202513, #198960 not applicable (refactors/test cleanup); #204260, #204178, #204098, #204089, #203839, #203271 missing in lane and not prerequisites. Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
The original broad deletion removed useful UI and subagent guards alongside low-value checks. This rebuild keeps those guards and trims presentation assertions, request-coalescing instrumentation, and optional screenshot/video scaffolding.
Related: #198737.
User Impact
No production behavior changes. Six existing test suites are trimmed in place; this is 427 net test lines removed (+7/-434), with zero production or inventory changes. Deliberately removed pixel/layout and ordinary display assertions have no claimed replacement oracle.
Why This Change Was Made
Rebuilt from current main
fe34585478fd990308a576e7f1a0a49aa935272f, preserving main's new coverage and restoring the original PR's blanket deletions. The maintainer-approved bar is value, not uniqueness: keep authorization, stale-input, privacy, data-loss, lifecycle and meaningful user-visible regression guards; remove low-value presentation/instrumentation or duplicated journeys.Per-file evidence manifest
src/agents/subagents/registry/subagent-control.worker.test.tssettles the progress card once after %s, committed/rejected stop cases, uninterruptible child, replacement execution, requester re-yield; real persistence, private-result exclusion, and exactly-once retirement remain.ui/src/components/sidebar-attention-store.test.tsui/src/pages/chat/tool-stream.node.test.tsrenders a deferred tool update when its projection flushes, final-result publication, replay fencing, sticky early/out-of-order denials beyond the cap, terminal and sibling-run isolation remain.ui/src/pages/chat/components/chat-message.test.tsxui/src/e2e/model-providers.e2e.test.tsui/src/e2e/session-management.archive.e2e.test.tsui/src/pages/sessions/sessions-page.archived.test.ts:enumerates beyond a deep link and recovers moved rows without double deletionplus incomplete-enumeration refusal. Same E2E suite retains held Undo/banner/draft custody, failed-write retry, route/title stability, stale roster and remote deletion, and expected physical session-ID fencing.The terminal restoration suite and all other former deletion candidates match pinned main. No new test/support files were added.
Evidence
Exact candidate:
1d2f01ed97e741a710934b6783874671dc1c4cd6.git diff --check.1d2f01ed: all three UI shards, UI E2E, required CI gate, and applicable security/dependency gates succeeded. ClawSweeper reported no findings or remaining before-merge actions (review). The raw rollup includes one cancelled dispatch; no required failing check remains.Main convergence and conflict resolution
Main independently fixed both prior failing browser fixtures in #204004. This rebase drops the overlapping toast and attachment commits and keeps both files byte-exact main. The attachment keeper includes the production composer stylesheet, waits for the initial pixel height, grows real menu content through the layout owner, and retains the running-at-pointerdown, close-before-input, input identity and draft assertions. Both fixtures are included in the final nine-file scoped validation.
The final candidate changes only the six trim suites in the table; no browser-fixture repair remains in its diff. Fresh exact-head CI and ClawSweeper review are complete as recorded above.