Skip to content

test(agents): remove aggregate-lane noise from src/agents suites - #122432

Merged
steipete merged 1 commit into
mainfrom
steipete/wizardly-aryabhata-5b74c5
Aug 12, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/wizardly-aryabhata-5b74c5

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Aggregate directory-level vitest runs of src/agents showed noise that focused runs hide, documented in PR #122164's body during its validation: 12 failures in src/agents/cli-runner/execute.supervisor-capture.test.ts and 4 failures from a stale hard-coded /tmp/openclaw.sqlite artifact in the embedded run/ aggregate.

Why This Change Was Made

The supervisor-capture failures were not cross-file state leakage: the file fails 12/52 in isolation under the unit-fast lane because it asserted real telegram/slack channel ids, coupling pass/fail to which channel plugins the selected vitest lane loads (stub plugins under focused routing, real Telegram/Slack target normalizers under unit-fast). The tests protect supervisor delivery capture, not plugin-owned normalization, so they now use a neutral synthetic channel (test-channel); no assertion shapes changed and no consumer-side resets were added.

The two embedded-runner tests shared the literal storePath /tmp/openclaw.sqlite; attempt-transcript-lifecycle-prepare.test.ts actually opened that real path through the session accessor, colliding with stale artifacts (a schema-16 file from Aug 9 was present on the dev machine) and across parallel runs. Both now build per-test paths via the existing test/helpers/temp-dir.ts useAutoCleanupTempDirTracker (realpath'd mkdtemp roots, afterEach cleanup). rg "tmp/openclaw\.sqlite" src/agents now returns nothing.

User Impact

None at runtime; test-only. Production LOC: 0. Tests: +53/-33. Aggregate and shuffled-order runs of src/agents suites are now deterministic regardless of stale /tmp state or lane plugin selection.

Evidence

Pre-fix captures (stale artifact in place): node scripts/run-vitest.mjs src/agents/cli-runner 12 failed / 1190 passed; embedded run/ aggregate 4 failed / 4746 passed; supervisor-capture isolated under unit-fast 12 failed / 40 passed (proving no predecessor file required).

Post-fix: cli-runner aggregate 1202/1202 in default order AND under the previously-failing shuffle seed 2; embedded aggregate 4750/4750; focused runs of all three touched files green (52/52, 4/4, 1/1); no /tmp/openclaw.sqlite recreated. Codex-backed autoreview on the exact diff: no actionable findings.

Known pre-existing, unrelated shuffle-order defects (not addressed here; follow-ups filed): cli-runner seed 1 -> 3 failures in a prepare test; embedded seeds 2/3 -> attempt.spawn-workspace.context-engine.test.ts timeout.

Supervisor-capture tests asserted real telegram/slack channel ids, so
their pass/fail depended on which channel plugins the selected vitest
lane loads (stubs when focused, real normalizers under unit-fast);
switch to a neutral synthetic channel. Two embedded-runner tests
carried a shared literal /tmp/openclaw.sqlite storePath — one actually
opened it, colliding with stale artifacts across parallel runs; both
now use realpath'd auto-cleaned per-test temp dirs.

Evidence in PR #122164 body; pre-fix aggregates failed 12/1202 (cli)
and 4/4750 (embedded), post-fix green in default and shuffled order.
@clawsweeper

clawsweeper Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete
steipete marked this pull request as ready for review August 12, 2026 04:33
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels Aug 12, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 12, 2026
@clawsweeper

clawsweeper Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 12, 2026, 12:54 AM ET / 04:54 UTC.

ClawSweeper review

What this changes

The PR removes agent-suite test noise by replacing real channel fixtures with a neutral channel and giving two SQLite-backed tests isolated temporary store paths.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep open for normal maintainer merge handling. Current main still contains the flaky test fixtures; this patch isolates only test inputs with the existing cleanup helper, and no blocking correctness or security issue was found.

Priority: P3
Reviewed head: 799e85c2068476edec03f877a13c676873000fbd

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, production-neutral test-isolation patch with source-backed owner-boundary alignment and no actionable findings.
Proof confidence 🌊 off-meta tidepool Not applicable: Not applicable: this is a maintainer-owned test-only PR; the body provides focused post-fix test-run evidence as supplemental validation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Not applicable: this is a maintainer-owned test-only PR; the body provides focused post-fix test-run evidence as supplemental validation.
Evidence reviewed 8 items Current-main baseline: Current main still hard-codes real Telegram channel fixtures in the supervisor-capture test, so the central test-isolation improvement is not already implemented.
Generic delivery boundary: CLI capture derives target evidence from local message arguments and current-channel context; it does not require a loaded channel plugin for the assertion under review.
Patch preserves the test contract: The branch changes fixture channel values and expected provider values together, retaining the delivery-capture assertions while removing plugin-specific normalizer coupling.
Findings None None.
Security None None.

How this fits together

Agent-runner tests feed simulated message tool calls into CLI supervisor capture and session targets into embedded transcript preparation. Those paths produce delivery-capture evidence and SQLite-backed lifecycle state used by the assertions.

flowchart LR
  A[Test runner lane] --> B[Agent test suite]
  B --> C[Supervisor capture input]
  B --> D[Embedded run session input]
  C --> E[Delivery evidence]
  D --> F[SQLite transcript target]
  E --> G[Test assertions]
  F --> G
Loading

Before merge

  • Resolve merge risk (P1) - The branch is behind current main; the local three-way merge is clean, but landing should still use exact merged-head CI.
Agent review details

Security

None.

PR surface

Tests +20. Total +20 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 3 53 33 +20
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 53 33 +20

Review metrics

Metric Value Why it matters
Production vs test LOC production 0; tests +53/-33 All changes are test fixtures and imports; no runtime, configuration, or persisted-state contract changes are introduced.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the isolated fixture changes after exact merged-head validation, while retaining channel-specific normalization coverage in its dedicated extraction tests.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land the isolated fixture changes after exact merged-head validation, while retaining channel-specific normalization coverage in its dedicated extraction tests.

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

Yes. Current source shows real plugin-coupled channel fixture values and two shared /tmp/openclaw.sqlite paths; the PR body supplies focused before/after aggregate-run evidence, though this read-only review did not execute tests.

Is this the best way to solve the issue?

Yes. The tests exercise generic capture and session-target behavior, while channel normalization is owned by dedicated extraction tests; using a neutral channel and the established per-test temp-dir tracker is the narrowest maintainable repair.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a bounded test-determinism cleanup with no claimed runtime user impact.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Not applicable: this is a maintainer-owned test-only PR; the body provides focused post-fix test-run evidence as supplemental validation.

Label justifications:

  • P3: This is a bounded test-determinism cleanup with no claimed runtime user impact.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Not applicable: this is a maintainer-owned test-only PR; the body provides focused post-fix test-run evidence as supplemental validation.

Evidence

What I checked:

Likely related people:

  • Vyctor H. Brzezowski: Current blame attributes the real channel and shared SQLite fixture literals in all three affected tests to the same commit. (role: current test-surface author; confidence: high; commits: bbb5164ec96d; files: src/agents/cli-runner/execute.supervisor-capture.test.ts, src/agents/embedded-agent-runner/run.overflow-compaction.test.ts, src/agents/embedded-agent-runner/run/attempt-transcript-lifecycle-prepare.test.ts)
  • steipete: The related merged agent-runner refactor covers the adjacent CLI and embedded failure-policy surfaces that exposed these aggregate-test failures. (role: recent adjacent area contributor; confidence: medium; commits: b3369840b1f0; files: src/agents/cli-runner/execute-tool-tracking.ts, src/agents/embedded-agent-runner/run/failover-policy.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Confirm exact merged-head CI after the branch is brought forward by the normal landing flow.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

@steipete
steipete merged commit bad4d34 into main Aug 12, 2026
185 checks passed
@steipete
steipete deleted the steipete/wizardly-aryabhata-5b74c5 branch August 12, 2026 05:08
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 13, 2026
…nclaw#122432)

Supervisor-capture tests asserted real telegram/slack channel ids, so
their pass/fail depended on which channel plugins the selected vitest
lane loads (stubs when focused, real normalizers under unit-fast);
switch to a neutral synthetic channel. Two embedded-runner tests
carried a shared literal /tmp/openclaw.sqlite storePath — one actually
opened it, colliding with stale artifacts across parallel runs; both
now use realpath'd auto-cleaned per-test temp dirs.

Evidence in PR openclaw#122164 body; pre-fix aggregates failed 12/1202 (cli)
and 4/4750 (embedded), post-fix green in default and shuffled order.
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 P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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