Repository navigation
test(agents): remove aggregate-lane noise from src/agents suites - #122432
Conversation
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.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 12, 2026, 12:54 AM ET / 04:54 UTC. ClawSweeper reviewWhat this changesThe 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 readinessKeep 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 Review scores
Verification
How this fits togetherAgent-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
Before merge
Agent review detailsSecurityNone. PR surfaceTests +20. Total +20 across 3 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest 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 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. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…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.
What Problem This Solves
Aggregate directory-level vitest runs of
src/agentsshowed noise that focused runs hide, documented in PR #122164's body during its validation: 12 failures insrc/agents/cli-runner/execute.supervisor-capture.test.tsand 4 failures from a stale hard-coded/tmp/openclaw.sqliteartifact in the embeddedrun/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/slackchannel 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.tsactually 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 existingtest/helpers/temp-dir.tsuseAutoCleanupTempDirTracker(realpath'd mkdtemp roots, afterEach cleanup).rg "tmp/openclaw\.sqlite" src/agentsnow returns nothing.User Impact
None at runtime; test-only. Production LOC: 0. Tests: +53/-33. Aggregate and shuffled-order runs of
src/agentssuites are now deterministic regardless of stale/tmpstate or lane plugin selection.Evidence
Pre-fix captures (stale artifact in place):
node scripts/run-vitest.mjs src/agents/cli-runner12 failed / 1190 passed; embeddedrun/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.sqliterecreated. 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.tstimeout.