Skip to content

improve(swarm): close out wait, phase, and worker follow-ups - #111605

Merged
steipete merged 9 commits into
mainfrom
feat/swarm-followups
Jul 20, 2026
Merged

steipete merged 9 commits into
mainfrom
feat/swarm-followups

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #110325

What Problem This Solves

Closes the remaining #110325 and #111401 Swarm follow-ups found during live end-to-end testing and maintainer review: Codex-harness collector waits could lose the tail of the full 600-second budget, the dots widget did not preserve or chronologically group phase observations, and worker-agent guidance did not make the flat leaf-worker safety model concrete.

Why This Change Was Made

This completes three bounded closeout improvements. Codex-harness agents_wait now gives the inner wait budget a completion grace window while preserving per-call and operator-configured timeout priority. The Swarm widget groups children into phase buckets ordered by phase-observation rank, assigns implicit phases only when children are created, and shows the latest log() narrator line across canonical session refreshes. The docs now spell out the children-are-leaves planner-then-execute idiom, harden dedicated workers with tools.swarm: false, and document the Codex 600-second wait support.

User Impact

Codex-driven Swarms can use the complete bounded wait budget without the outer harness preempting the structured timeout result. Control UI users see stable, chronological phase buckets and the latest progress narration. Operators get a safer, clearer worker-agent configuration and a concrete flat orchestration pattern.

Evidence

  • node scripts/run-vitest.mjs extensions/codex/src/app-server/dynamic-tool-execution.test.ts ui/src/lib/sessions/index.test.ts ui/src/lib/board/widgets/swarm.test.ts — 66 tests passed across three files under set -o pipefail.
  • pnpm ui:build — production UI build, precompressed-asset verification, and Control UI performance budgets passed.
  • pnpm deadcode:exports — production, full-tree, and script unused-export scans passed with 0 entries.
  • pnpm format on all touched files — clean; no post-format diff.
  • Four maintainer review hardening rounds fixed timeout-priority, grace-at-cap, observation-rank ordering, creation-only phase attribution, and the affected UI test; round 6 was clean at 0.86.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui extensions: codex labels Jul 20, 2026
@steipete steipete self-assigned this Jul 20, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: L maintainer Maintainer-authored PR labels Jul 20, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jul 20, 2026
@clawsweeper

clawsweeper Bot commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 19, 2026, 11:08 PM ET / July 20, 2026, 03:08 UTC.

Summary
The branch extends the Codex agents_wait watchdog, adds transient Swarm phase/log presentation in the Control UI, and documents flat leaf-worker orchestration.

PR surface: Source +220, Tests +278, Docs +43. Total +541 across 11 files.

Reproducibility: no. high-confidence live reproduction was established in this review. The PR supplies targeted tests and CI evidence, but no observed Codex-harness or Control UI after-fix run.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: serialized state: ui/src/lib/sessions/index.ts, serialized state: ui/src/lib/sessions/swarm-activity.integration.test.ts, serialized state: ui/src/lib/sessions/swarm-activity.ts, unknown-data-model-change: ui/src/lib/sessions/index.ts, unknown-data-model-change: ui/src/lib/sessions/swarm-activity.integration.test.ts, unknown-data-model-change: ui/src/lib/sessions/swarm-activity.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🦐 gold shrimp
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P2] Add a redacted live agents_wait transcript or runtime log that demonstrates structured completion or timeout behavior under the changed watchdog.
  • [P1] Add a redacted Control UI screenshot or recording showing chronological phase buckets and the latest narrator line after a canonical session refresh.
  • If a maintainer intends to waive live proof, record that decision after independently inspecting the sibling Codex wait implementation.

Proof guidance:

  • [P1] Needs real behavior proof before merge: Focused tests, UI build output, and CI are useful supplemental evidence, but no redacted after-fix live Codex-harness transcript, runtime log, or Control UI capture demonstrates the changed behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • [P2] Merging without a real Codex-harness run leaves the changed 600-second watchdog behavior unverified against the upstream structured-timeout contract.
  • [P1] Merging without a real Control UI capture leaves phase ordering, refresh persistence, and narrator presentation verified only through unit and integration tests.
  • [P2] The agents_wait timeout change affects an existing operator-configurable execution path, so its compatibility behavior should be observed before landing.

Maintainer options:

  1. Add redacted runtime proof before merge (recommended)
    Show the changed wait behavior from a real Codex harness and the changed Swarm widget state from a real Control UI session, with private session content removed.
  2. Explicitly waive the proof gate
    A maintainer can accept the test-only evidence only after independently checking the Codex wait contract and deciding the remaining runtime risk is acceptable.

Next step before merge

  • [P1] A protected maintainer-labeled PR needs a human proof-sufficiency decision; no narrow code repair is justified from the available evidence.

Maintainer decision needed

  • Question: Should this maintainer-labeled PR merge on deterministic tests and CI alone, or should it provide redacted live Codex-harness and Control UI behavior proof first?
  • Rationale: The branch changes a Codex runtime deadline and transient UI behavior; repository policy requires direct Codex contract inspection and real behavior proof, while the author has explicitly declined to add those artifacts.
  • Likely owner: steipete — They are assigned to the PR and supplied the current-head timeout-contract explanation and validation disposition.
  • Options:
    • Require live proof (recommended): Request redacted terminal or runtime-log evidence for agents_wait and a UI capture or recording showing phase and narrator behavior across a canonical refresh before merge.
    • Accept test-only evidence: A responsible maintainer may explicitly waive the live-proof gate after independently confirming the upstream Codex contract and UI behavior.

Security
Cleared: The reviewed diff changes application code, tests, styles, and documentation without adding dependencies, workflow permissions, package hooks, artifact execution, or secret-handling paths.

Review details

Best possible solution:

Retain the bounded implementation, then add redacted after-fix runtime evidence for a shortened and full-budget-equivalent agents_wait path plus a Control UI Swarm session showing chronological phases and the narrator across refresh.

Do we have a high-confidence way to reproduce the issue?

No high-confidence live reproduction was established in this review. The PR supplies targeted tests and CI evidence, but no observed Codex-harness or Control UI after-fix run.

Is this the best way to solve the issue?

Unclear. The branch is a plausible bounded solution and addresses the earlier resolver assertion, but direct upstream Codex-contract inspection and observed runtime behavior are still required to judge it as the best safe fix.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 3564c1c79545.

Label changes

Label justifications:

  • P2: This is a bounded Swarm runtime and UI improvement with a meaningful but non-emergency compatibility and proof gap.
  • merge-risk: 🚨 compatibility: The PR changes the timeout behavior of an existing configurable agents_wait runtime path, including its maximum deadline and grace handling.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Focused tests, UI build output, and CI are useful supplemental evidence, but no redacted after-fix live Codex-harness transcript, runtime log, or Control UI capture demonstrates the changed behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +220, Tests +278, Docs +43. Total +541 across 11 files.

View PR surface stats
Area Files Added Removed Net
Source 6 245 25 +220
Tests 3 279 1 +278
Docs 2 44 1 +43
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 11 568 27 +541

What I checked:

  • Current-head timeout coverage: The PR adds resolver assertions for default, 120-second, and 600-second agents_wait calls, exercising the intended cap-plus-grace deadline behavior. (extensions/codex/src/app-server/dynamic-tool-execution.test.ts:293, 8dd2e1eb1438)
  • Compatibility-sensitive timeout path: The branch changes the dynamic-tool timeout decision for agents_wait, including call arguments, configured timeout precedence, and a 600-second cap plus completion grace. (extensions/codex/src/app-server/dynamic-tool-execution.ts:491, 8dd2e1eb1438)
  • UI lifecycle surface: The branch introduces a bounded in-memory tracker that decorates canonical session results with phase and narrator annotations across refreshes. (ui/src/lib/sessions/swarm-activity.ts:1, 8dd2e1eb1438)
  • Proof status: The PR body reports focused tests, a UI build, dead-code checks, and formatting, but it provides no after-fix live wait transcript, runtime log, recording, or Control UI capture. (8dd2e1eb1438)
  • Review-policy limitation: A read-only shell command intended to read repository policy and source failed before execution with bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted; therefore no direct ../codex source inspection was possible.

Likely related people:

  • steipete: The PR author is also assigned to this item and authored the related Swarm design and follow-up discussion, making them the clearest available routing candidate despite unavailable local history inspection. (role: likely follow-up owner; confidence: low; commits: 6e14df98f1ec, f320bd00a46b, 8dd2e1eb1438; files: extensions/codex/src/app-server/dynamic-tool-execution.ts, ui/src/lib/sessions/swarm-activity.ts, docs/tools/swarm.md)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (1 earlier review cycle)
  • reviewed 2026-07-20T01:55:37.403Z sha 2587bc4 :: needs real behavior proof before merge. :: [P1] Honor agents_wait timeoutSeconds before applying the grace default

@steipete

Copy link
Copy Markdown
Contributor Author

ClawSweeper rank-up disposition for the exact reviewed head 2587bc4bc54cdd590687c596750dd5a072825900:

  • The reported agents_wait timeout-source mismatch is a false positive. resolveDynamicToolCallTimeoutMs calls readDynamicToolCallTimeoutMs, and that helper reads arguments.timeoutSeconds, converts it to milliseconds, and adds the 30-second outer completion grace (extensions/codex/src/app-server/dynamic-tool-execution.ts:538-549). The direct, unmocked resolver test proves 120s -> 150,000ms and 600s -> 630,000ms (extensions/codex/src/app-server/dynamic-tool-execution.test.ts:293-319). The focused file passed post-rebase (30/30 tests).
  • I also checked the upstream Codex contract directly: ../codex/codex-rs/core/src/tools/handlers/multi_agents_common.rs:27-30, multi_agents/wait.rs:89-97,165-221, multi_agents_v2/wait.rs:50-66,95-117, and multi_agents_spec.rs:848-885. Codex accepts the inner seconds budget and returns a structured timed_out result; OpenClaw's extra 30 seconds belongs only to the outer harness watchdog.
  • I am not adding a ten-minute live wait solely to duplicate the deterministic deadline regression test. It would exercise wall-clock duration rather than a different code path, while the resolver assertions cover both the full-budget and caller-shortened branches exactly.
  • I am not uploading a Control UI session capture. This PR's UI state is transient in-memory decoration, not a stored-data migration, and the behavior is covered by the render/state tests (36/36 across the two UI files) plus a clean production ui:build. A real session capture could expose private session content and is not needed to establish the phase-rank, creation-only attribution, persistence-across-refresh, or narrator-selection invariants.

No code change is needed for these rank-up moves. The validated maintainer review artifact remains READY FOR /prepare-pr, with the behavior sweep passing all three changed decision surfaces.

@steipete
steipete merged commit 7d4dccf into main Jul 20, 2026
110 checks passed
@steipete
steipete deleted the feat/swarm-followups branch July 20, 2026 03:11
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 20, 2026
…w#111605)

* fix(codex): support full swarm wait budgets

* feat(ui): bucket swarm dots by phase

* docs(swarm): document flat worker patterns

* fix(codex): configured per-tool timeout still wins over swarm wait default

* fix(codex): outer swarm-wait watchdog outlives the 600s budget (cap + grace)

* fix(ui): order swarm phase buckets by observation rank

* fix(ui): repair rank-order widget test — proper lit render container, untangle sibling assertions

* fix(ui): implicit swarm phase assignment only on child creation events

* test(ui): split swarm activity integration coverage
zooqueen pushed a commit to zooqueen/openclaw that referenced this pull request Sep 11, 2026
…w#111605)

* fix(codex): support full swarm wait budgets

* feat(ui): bucket swarm dots by phase

* docs(swarm): document flat worker patterns

* fix(codex): configured per-tool timeout still wins over swarm wait default

* fix(codex): outer swarm-wait watchdog outlives the 600s budget (cap + grace)

* fix(ui): order swarm phase buckets by observation rank

* fix(ui): repair rank-order widget test — proper lit render container, untangle sibling assertions

* fix(ui): implicit swarm phase assignment only on child creation events

* test(ui): split swarm activity integration coverage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation extensions: codex maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: L status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant