Skip to content

fix: prevent agents-tools message test timeouts#98701

Merged
steipete merged 1 commit into
mainfrom
codex/fix-message-tool-unit-loader
Jul 1, 2026
Merged

fix: prevent agents-tools message test timeouts#98701
steipete merged 1 commit into
mainfrom
codex/fix-message-tool-unit-loader

Conversation

@steipete

@steipete steipete commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Resolves a problem where the serialized agents-tools CI shard could time out in message-tool.test.ts when its first asynchronous send cold-loaded bundled channel source entries after the heavyweight image-tool tests.

Why This Change Was Made

The message-tool unit suite now disables bundled runtime/setup entry fallback while retaining the real loaded-plugin registry and alias-resolution paths. Tests that need channel behavior already install explicit minimal test plugins, so this keeps integration loading in its dedicated loader suites without changing production code, runner allocation, worker counts, timeouts, or coverage.

User Impact

There is no product/runtime behavior change. Maintainers can expect the main agents-tools shard to complete without the deterministic 2–3 minute message-tool stall that was blocking green-main leases.

Evidence

Root-cause reproduction:

  • Main jobs 84514551065, 84542334833, and 84560888446 all stalled the first asynchronous message-tool row for 157–181 seconds after the image-tool family.
  • Fresh Blacksmith Testbox tbx_01kwf4f5e6dcm6qrw9h2kswchs (Node 24.13) reproduced the exact valid string-timeout row at 132,998 ms.
  • Direct AWS Crabbox cbx_370910f4757b / c7a.8xlarge (Node 24.18, 32 CPUs) reproduced it at 172,451 ms, excluding a Blacksmith-only platform defect.
  • A worker CPU profile attributed 79.945 seconds of self time to Jiti and showed the inclusive path message-tool execute -> resolvePollVoteEchoRoute -> getChannelPlugin -> getBundledChannelPlugin -> source entry loader. The Vitest worker held one CPU while the async resolver awaited its next line.

Exact-head candidate proof:

  • Fresh Blacksmith Testbox tbx_01kwf65hyk9camrztpa05p40qt, Actions run 28530354474, Node 24.13, 8 CPUs: exact row 10 ms; final full message-tool file 111/111 passed in 2.38 seconds.
  • Same Testbox, real serialized agents-tools config/process: image-tool.test.ts ran first in 34.889 seconds, then message-tool.test.ts passed 111/111 in 547 ms; entire shard passed 54 files / 1,040 tests in 70.18 seconds.
  • Direct AWS Crabbox cbx_370910f4757b: exact row 10 ms (run run_29422e57dc4b); full message-tool file passed 111/111 in 3.19 seconds with all formerly displaced fallback rows at 0–2 ms (run run_94e471588c26).
  • corepack pnpm check:changed -- src/agents/tools/message-tool.test.ts: passed conflict, attribution, dependency/patch guards, core-test typecheck, and changed-file lint (0 warnings/errors) on the fresh Testbox.
  • Genuine gpt-5.6-sol xhigh autoreview: no findings; patch correct at 0.97 confidence.

The exact hosted/Testbox/direct-AWS executions are the live boundary for this test-only change; no external product service is involved.

@steipete steipete self-assigned this Jul 1, 2026
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS maintainer Maintainer-authored PR labels Jul 1, 2026
@clawsweeper

clawsweeper Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 1, 2026, 12:15 PM ET / 16:15 UTC.

Summary
Adds a test-local Vitest mock in src/agents/tools/message-tool.test.ts so the message-tool unit suite does not cold-load bundled channel fallback entries.

PR surface: Tests +13. Total +13 across 1 file.

Reproducibility: yes. Main CI logs show the agents-tools shard timing out in src/agents/tools/message-tool.test.ts, and source inspection shows the affected send path can reach bundled channel fallback before dispatch.

Review metrics: none identified.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster ✨ media proof bonus
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

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

Risk before merge

  • [P1] The PR has a protected maintainer label, so the remaining risk is process ownership rather than a code defect: it should stay open for explicit maintainer landing.

Maintainer options:

  1. Decide the mitigation before merge
    Land this narrow test-only isolation through the normal maintainer review path once required checks remain green.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No automated repair is needed; the protected maintainer-labeled PR needs ordinary maintainer review and landing handling.

Security
Cleared: The diff only adds a Vitest mock in a unit test and does not change runtime code, dependencies, workflows, secrets, or package metadata.

Review details

Best possible solution:

Land this narrow test-only isolation through the normal maintainer review path once required checks remain green.

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

Yes. Main CI logs show the agents-tools shard timing out in src/agents/tools/message-tool.test.ts, and source inspection shows the affected send path can reach bundled channel fallback before dispatch.

Is this the best way to solve the issue?

Yes. This is the best fix shape for the PR scope because it blocks only expensive bundled fallback inside the focused unit suite while preserving loaded-plugin registry behavior and leaving bundled runtime coverage in loader/contract suites.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: This fixes a concrete required CI reliability problem in the agents tool shard with limited runtime and user-facing blast radius.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The PR body links after-fix Testbox/Crabbox proof for the exact row, full file, and serialized shard, and the live PR checks include a passing real behavior proof check.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body links after-fix Testbox/Crabbox proof for the exact row, full file, and serialized shard, and the live PR checks include a passing real behavior proof check.
Evidence reviewed

PR surface:

Tests +13. Total +13 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 13 0 +13
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 13 0 +13

What I checked:

Likely related people:

  • steipete: Authored merged PR fix: stop invalid message timeouts from stalling #98652, which changed the same message-tool timeout path shortly before this follow-up CI timeout surfaced, and authored this focused test isolation PR. (role: recent area contributor; confidence: high; commits: 909be7bcbc70, b23698be63ec; files: src/agents/tools/message-tool.test.ts, src/agents/tools/message-tool.ts)
  • vincentkoc: Current blame for the message-tool timeout row, resolvePollVoteEchoRoute, channel registry fallback, and bundled loader path points to the current-main import that introduced these central files. (role: current-main area contributor; confidence: medium; commits: f588a49a3677; files: src/agents/tools/message-tool.test.ts, src/agents/tools/message-tool.ts, src/channels/plugins/registry.ts)
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.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. labels Jul 1, 2026
@steipete

steipete commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready proof for exact head b23698be63ec7526d36bc1a02b4f717a7db0a9e8:

  • Root cause: the message-tool unit suite crossed into bundled channel runtime/setup fallback. In source mode that synchronously loaded the bundled plugin graph through Jiti; the Vitest worker held one CPU there, so the following async row only appeared to stall. The fix is test-only and keeps real loaded-plugin/alias behavior while excluding bundled-loader integration from this unit file.
  • Cross-provider before/after: fresh Blacksmith Testbox reproduced the exact row at 132,998 ms and direct AWS Crabbox cbx_370910f4757b reproduced it at 172,451 ms. After the fix, the exact row is 10 ms on both providers; direct AWS full message-tool.test.ts is 111/111 in 3.19s (run run_94e471588c26).
  • Fresh Blacksmith Testbox tbx_01kwf65hyk9camrztpa05p40qt, run 28530354474, Node 24.13 / 8 CPUs: final message-tool file 111/111 in 2.38s. In the real serialized agents-tools process, image-tool ran first in 34.889s, message-tool followed in 547ms, and the shard passed 54 files / 1,040 tests in 70.18s.
  • Exact-head hosted CI run 28530992214: substantive build, lint, test-type, guard, security, OpenGrep, and agent-runtime quality gates are green. scripts/pr prepare-run completed in hosted_exact_head mode.
  • Path-scoped Testbox check:changed passed typecheck and lint with 0 warnings/errors. Genuine gpt-5.6-sol xhigh autoreview returned no findings and 0.97 confidence.
  • Supplemental local prepare gates: frozen install, full build, and full check passed. The all-project local test sweep reported unrelated provider-catalog/plugin-status/CLI-log baseline failures; none overlap the changed file, and the exact hosted/Testbox shard is green.

No product/runtime code, timeout, worker-count, coverage, workflow, or CHANGELOG change. Ready to merge.

@steipete
steipete merged commit db97bc1 into main Jul 1, 2026
149 of 156 checks passed
@steipete
steipete deleted the codex/fix-message-tool-unit-loader branch July 1, 2026 16:35
@steipete

steipete commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 2, 2026
chenyangjun-xy pushed a commit to chenyangjun-xy/openclaw that referenced this pull request Jul 3, 2026
sheyanmin pushed a commit to sheyanmin/openclaw that referenced this pull request Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant