Skip to content

test(doctor,agents,gateway,sessions,cron): remove low-value tests (batch d079) - #160084

Merged
steipete merged 11 commits into
mainfrom
tcr/land-d079-1790561765
Sep 28, 2026
Merged

steipete merged 11 commits into
mainfrom
tcr/land-d079-1790561765

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

This campaign batch removes repeated and implementation-coupled test cases and repeated fixture setup from the Doctor, agent, Gateway, session, and cron suites.

User Impact

No user-visible behavior or production code changes. The batch reduces test maintenance while retaining recovery, authorization, ownership, scheduling, and delivery regressions.

Why This Change Was Made

Ten previously audited shards are replayed onto current main. All ten commits applied cleanly, with no conflicts, skipped commits, or dropped hunks. A follow-up repair asserts that two recorded exec-followup mock calls exist before inspection; the first changed-file gate caught those unchecked accesses as TS2532. Production LOC is unchanged. Test files change by +5,866/-16,074 (net -10,208); test support by +1/-4 (net -3); the max-lines baseline shrinks by one line. Static test declarations decrease by 220; parameterized declarations count once, so this is not an expanded test-case count.

The combined tree retains the staggered-slot and exact-boundary cases in service.jobs.test.ts, and first-second/DST restart cases in service.restart-catchup.test.ts, after removing the duplicate dedicated files. The only support deletion removes an unused post-commit worker-exit fixture mode. No current CODEOWNERS patterns match the changed paths.

Evidence

  • Targeted formatting, plain oxlint, and git diff --check origin/main passed.
  • Fresh combined-tree Blacksmith Testbox focused validation passed: 734 tests, two existing platform skips, seven Vitest groups; wrapper exit 0. All changed-path bytes were verified on the runner before execution. Test command: CI=1 pnpm install --frozen-lockfile --prefer-offline && CI=1 pnpm test <all surviving changed test files>. Testbox run, lease tbx_01m3jx7ta270mvrwp1jbqbgsgm (stopped).
  • Initial delegated changed gate caught two TS2532 errors in bash-tools.exec-host-shared.test.ts. After the explicit call-presence assertions, its focused Testbox rerun passed all 22 tests. Repair test run, lease tbx_01m3jzez88by8sec8bvsra6j7k (stopped). That run's later gate was canceled because a moving shared base ref expanded its path selection; it is not claimed as passing.
  • Final changed gate over exactly the 79 batch paths: all 25 core test typecheck graphs, format, boundary/ratchet guards, and dead-export scans passed. Core lint failed only on untouched ui/src/pages/chat/components/chat-attachments.ts (716 counted lines, limit 700). The file and .oxlintrc.json are byte-identical to the pinned base, and plain lint reproduces the same error. Changed-gate run, lease tbx_01m3k0s00t2ejw8zx5r8977fzb (stopped). This inherited failure is recorded, not claimed as green.
  • The historical per-shard coverage below has no failed or excluded groups. Statement and branch losses are each at most 1%. Four initial shard summaries were stale after sync failures; their later coordinator coverage snapshots and successful recovery logs supply the final totals.
  • Independent autoreview against pinned base 1d7e5b0813d51b7d3e4baeb983064b2a8471e722 completed in three passes: scoped-clean at its default P0 threshold, zero findings. The two-assertion repair also received a scoped-clean review with zero findings. Both ran while Testbox validation was in progress.
Historical shard evidence and changed files

These are historical in-shard coverage totals, not a new aggregate coverage measurement. LOC and declaration deltas are from the source commits; the separate typecheck repair adds two net test lines to the aggregate.

Shard Test LOC delta Declaration delta Covered statements Covered branches Covered functions
s716 -432 -7 1935 → 1935 1285 → 1285 331 → 331
t0026 -1429 -36 3211 → 3201 2197 → 2191 537 → 533
t0033 -398 -5 5337 → 5322 3840 → 3818 829 → 829
t0006 -891 -18 21487 → 21705 12700 → 12777 4174 → 4218
t0011 -858 -20 15522 → 15488 9460 → 9424 2823 → 2820
t0017 -445 -9 9152 → 9089 5655 → 5619 2060 → 2052
t0014 -113 -2 15496 → 15465 7392 → 7324 2905 → 2891
t0040 -651 -13 4078 → 4056 3226 → 3212 752 → 752
t0037 -2677 -66 5717 → 5702 4325 → 4292 1021 → 1020
t0039 -2316 -44 4278 → 4247 3426 → 3392 757 → 754

The original s716 report recorded only baseline coverage (1935 statements / 1285 branches / 331 functions); t0026 recorded 3211 / 2197, t0033 recorded 5337 / 3840, and t0017 had no coverage totals. Successful later coordinator snapshots supersede those incomplete reports. The other six rows reproduce their final shard reports. Historical changed-check failures from the unchanged attachment UI line-cap violation are not represented as passing checks.

s716

  • src/commands/doctor-session-sqlite.manifests.test.ts
  • src/commands/doctor-session-sqlite.publication-recovery.test.ts
  • src/commands/doctor-session-sqlite.receipt-recovery.test.ts
  • src/commands/doctor-session-sqlite.recovery-generations.test.ts
  • src/commands/doctor-session-sqlite.recovery-shared-owners.test.ts
  • src/commands/doctor-session-sqlite.recovery.test.ts
  • src/commands/doctor-session-sqlite.restore-history.test.ts
  • src/commands/doctor-session-sqlite.restore-paths.test.ts

t0026

  • src/agents/bash-tools.exec-host-node.integration.test.ts
  • src/agents/bash-tools.exec-host-node.test.ts
  • src/agents/bash-tools.exec-host-shared.test.ts
  • src/agents/bash-tools.exec-runtime-output.test.ts
  • src/agents/bash-tools.exec-runtime.cleanup.test.ts
  • src/agents/bash-tools.exec-runtime.test.ts

t0033

  • src/agents/embedded-agent-subscribe.model-state.delivery.test.ts
  • src/agents/embedded-agent-subscribe.model-state.test.ts
  • src/agents/embedded-agent-subscribe.partial-reply-lifecycle.test.ts
  • src/agents/embedded-agent-subscribe.raw-stream.test.ts
  • src/agents/embedded-agent-subscribe.reply-tags.test.ts

t0006

  • src/gateway/server.models-auth-order.test.ts
  • src/gateway/server.models-voicewake-misc.test.ts
  • src/gateway/server.node-invoke-approval-bypass.test.ts
  • src/gateway/server.node-pairing-authz.test.ts
  • src/gateway/server.node-pairing-auto-approve.test.ts
  • src/gateway/server.node-pairing-diagnostics-authz.test.ts
  • src/gateway/server.node-pairing-memo.test.ts
  • src/gateway/server.node-pairing-ssh-verify.test.ts

t0011

  • src/gateway/server.sessions.list-store-materialization.test.ts
  • src/gateway/server.sessions.patch-expected-identity.test.ts
  • src/gateway/server.sessions.permissions-hooks.test.ts
  • src/gateway/server.sessions.placement-projection.test.ts
  • src/gateway/server.sessions.plugin-ownership.test.ts
  • src/gateway/server.sessions.preview-resolve.test.ts
  • src/gateway/server.sessions.reclamation.test.ts
  • src/gateway/server.sessions.recover.test.ts

t0017

  • src/config/sessions/session-accessor.sqlite-handle-lifecycle.test.ts
  • src/config/sessions/session-accessor.sqlite-history-events.test.ts
  • src/config/sessions/session-accessor.sqlite-import.test.ts
  • src/config/sessions/session-accessor.sqlite-lifecycle-admission.test.ts
  • src/config/sessions/session-accessor.sqlite-maintenance-writer.test.ts
  • src/config/sessions/session-accessor.sqlite-message-cut.test.ts
  • src/config/sessions/session-accessor.sqlite-owner.test.ts
  • src/config/sessions/session-accessor.sqlite-participants.test.ts
  • src/config/sessions/session-accessor.sqlite-reclamation-admission-race.test.ts
  • src/config/sessions/session-accessor.sqlite-reclamation-commit.test-support.ts
  • src/config/sessions/session-accessor.sqlite-reclamation-commit.test.ts
  • src/config/sessions/session-accessor.sqlite-reclamation.test.ts

t0014

  • src/gateway/server.tools-effective.global-agent-gateway.test.ts
  • src/gateway/server.worker-desktop-advertisement.test.ts

t0040

  • src/cron/service.trigger-eval.test.ts
  • src/cron/service.unresolved-next-run.test.ts
  • src/cron/service.unresolved-owner.test.ts
  • src/cron/service.update-recompute-drops-due-every.test.ts
  • src/cron/service.wake-now-real-heartbeat.test.ts
  • src/cron/service.webhook-empty-summary.test.ts

t0037

  • config/max-lines-baseline.txt
  • src/cron/service.failure-alert.test.ts
  • src/cron/service.get-job.test.ts
  • src/cron/service.heartbeat-ok-summary-suppressed.test.ts
  • src/cron/service.heartbeat-payload.test.ts
  • src/cron/service.jobs.test.ts
  • src/cron/service.jobs.top-of-hour-stagger.test.ts
  • src/cron/service.list-page-sort-guards.test.ts
  • src/cron/service.list-past-due.test.ts
  • src/cron/service.main-job-passes-heartbeat-target-last.test.ts
  • src/cron/service.manual-delivery.test.ts
  • src/cron/service.one-shot-schedule-ownership.test.ts

t0039

  • src/cron/service.restart-catchup-subsecond.test.ts
  • src/cron/service.restart-catchup.test.ts
  • src/cron/service.runs-one-shot-main-job-disables-it.test.ts
  • src/cron/service.scheduler-regressions.test.ts
  • src/cron/service.session-reaper-in-finally.test.ts
  • src/cron/service.skips-main-jobs-empty-systemevent-text.test.ts
  • src/cron/service.startup-overflow-clobber.test.ts
  • src/cron/service.store-load-invalid-main-job.test.ts
  • src/cron/service.stream-trigger.test.ts
  • src/cron/service.stream-validation.test.ts
  • src/cron/service.test-harness.test.ts
  • src/cron/service.timer-maintenance.test.ts

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime commands Command implementations agents Agent runtime and tooling size: XL labels Sep 28, 2026
@steipete
steipete enabled auto-merge (squash) September 28, 2026 03:58
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 28, 2026, 12:07 AM ET / 04:07 UTC.

ClawSweeper review

What this changes

The branch consolidates and removes Doctor, agent, Gateway, session, and cron tests and shrinks a test-size baseline without changing production code.

Merge readiness

⛔ Blocked before merge - 6 items remain

Keep open. The focused suite passed, but the branch removes three distinct regression checks that neighboring tests do not fully replace.

Priority: P3
Reviewed head: 3beeeb4e99a421a2617c0362886451d68ca3f07b

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The cleanup has focused validation, but three independently meaningful regression checks need to remain before the patch is ready.
Proof confidence 🌊 off-meta tidepool Not applicable: The host records a MEMBER author and this test-only patch changes no production or stored-data contract, so the contributor runtime-proof gate does not apply. The reported focused Testbox pass supports retained tests but does not exercise the deleted edge cases; data-model compatibility is not applicable.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The host records a MEMBER author and this test-only patch changes no production or stored-data contract, so the contributor runtime-proof gate does not apply. The reported focused Testbox pass supports retained tests but does not exercise the deleted edge cases; data-model compatibility is not applicable.
Evidence reviewed 9 items Nondefault agent case removed: The introduced hunk replaces the real Gateway RPC matrix for main and work with a main-only case. The work case had checked selected-agent storage, the shared order, the sibling order, and Reset.
Agent-specific write path: The Gateway handler resolves the requested agent, obtains its prepared snapshot, and writes provider priority to that snapshot’s agent directory. This makes the nondefault agent an independent storage boundary.
Provider tool timing case removed: The introduced hunk drops the provider-event row and retains only the nested-tool case with a stalled partial-reply callback.
Findings 3 actionable findings [P2] Restore nondefault agent priority coverage
[P2] Keep provider tool timing coverage
[P2] Retain the Gateway default-deny pairing case
Security Needs attention Default-deny pairing loses connection-level regression coverage: The current guard still rejects absent CIDRs, but the deleted LAN test was the only full-connection assertion that such a node remains pending and unpaired.

How this fits together

These suites exercise OpenClaw’s Doctor recovery, agent streaming, Gateway requests, session storage, and cron scheduling. Test harnesses send requests and events through those owners, then turn observed results into CI regression signals.

flowchart LR
A[Requests and events] --> B[Production owners]
B --> C[Test harnesses]
C --> D[Behavior assertions]
D --> E[CI regression signal]
Loading

Before merge

  • Restore nondefault agent priority coverage (P2) - Changing the real WebSocket RPC test from main and work to main alone removes the selected nondefault-agent storage check. A write or Reset incorrectly targeting main when work is selected would pass the retained case and the mocked handler tests; retain the work-agent case and its shared/sibling assertions.
  • Keep provider tool timing coverage (P2) - The deleted provider row checked that an unresolved partial-reply send cannot delay a provider tool-start event. The retained nested case calls a different lifecycle path and cannot catch a stall in the provider event scheduler; restore the provider scenario.
  • Retain the Gateway default-deny pairing case (P2) - Deleting the real-LAN case removes the only full Gateway check that an unset trusted-CIDR allowlist leaves a new node pending and unpaired. The pure policy test and the post-revocation case cannot catch initial connection wiring that skips the default-deny policy; retain one real-connection negative case.
  • Resolve security concern: Default-deny pairing loses connection-level regression coverage - The current guard still rejects absent CIDRs, but the deleted LAN test was the only full-connection assertion that such a node remains pending and unpaired.
  • Resolve merge risk (P1) - Removing the real Gateway default-deny pairing case leaves an initial unconfigured LAN connection untested at the final pairing boundary; the current production guard remains intact.
  • Complete next step (P2) - Restore the three distinct boundary cases, run their focused suites, and obtain security-aware review before merge.

Findings

  • [P2] Restore nondefault agent priority coverage — src/gateway/server.models-auth-order.test.ts:20-25
  • [P2] Keep provider tool timing coverage — src/agents/embedded-agent-subscribe.partial-reply-lifecycle.test.ts:165-169
  • [P2] Retain the Gateway default-deny pairing case — src/gateway/server.node-pairing-auto-approve.test.ts:55-56
  • [low] Default-deny pairing loses connection-level regression coverage — src/gateway/server.node-pairing-auto-approve.test.ts:56
Agent review details

Security

Needs attention: No production authorization code changes, but the patch removes a real-Gateway test of the documented default-deny node-pairing boundary.

PR surface

Tests -7620, Other -1. Total -7621 across 79 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 78 4280 11900 -7620
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 1 -1
Total 79 4280 11901 -7621

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Retain the Gateway default-deny check (recommended)
    Restore one real-LAN connection case that proves an unconfigured node remains pending and unpaired, then review its focused result before merge.

Technical review

Best possible solution:

Keep the smaller suites while retaining one representative check for explicit agent targeting, provider-event ordering under a stalled send, and default-deny LAN pairing.

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

Not applicable: this PR changes test coverage rather than reporting a product bug. The lost cases are identifiable by comparing the pinned introduced diff with retained tests.

Is this the best way to solve the issue?

No. Most consolidation is useful, but the three distinct boundary cases should remain because the surviving tests exercise different agents, dispatch paths, or pairing states.

Full review comments:

  • [P2] Restore nondefault agent priority coverage — src/gateway/server.models-auth-order.test.ts:20-25
    Changing the real WebSocket RPC test from main and work to main alone removes the selected nondefault-agent storage check. A write or Reset incorrectly targeting main when work is selected would pass the retained case and the mocked handler tests; retain the work-agent case and its shared/sibling assertions.
    Confidence: 0.93
  • [P2] Keep provider tool timing coverage — src/agents/embedded-agent-subscribe.partial-reply-lifecycle.test.ts:165-169
    The deleted provider row checked that an unresolved partial-reply send cannot delay a provider tool-start event. The retained nested case calls a different lifecycle path and cannot catch a stall in the provider event scheduler; restore the provider scenario.
    Confidence: 0.86
  • [P2] Retain the Gateway default-deny pairing case — src/gateway/server.node-pairing-auto-approve.test.ts:55-56
    Deleting the real-LAN case removes the only full Gateway check that an unset trusted-CIDR allowlist leaves a new node pending and unpaired. The pure policy test and the post-revocation case cannot catch initial connection wiring that skips the default-deny policy; retain one real-connection negative case.
    Confidence: 0.82

Overall correctness: patch is incorrect
Overall confidence: 0.86

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is test-maintenance cleanup with no production-code change or observed user regression.
  • add merge-risk: 🚨 security-boundary: The patch removes the only full-Gateway default-deny check for trusted-CIDR node pairing, reducing regression protection at a documented security boundary.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: The host records a MEMBER author and this test-only patch changes no production or stored-data contract, so the contributor runtime-proof gate does not apply. The reported focused Testbox pass supports retained tests but does not exercise the deleted edge cases; data-model compatibility is not applicable.

Label justifications:

  • P3: This is test-maintenance cleanup with no production-code change or observed user regression.
  • merge-risk: 🚨 security-boundary: The patch removes the only full-Gateway default-deny check for trusted-CIDR node pairing, reducing regression protection at a documented security boundary.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: The host records a MEMBER author and this test-only patch changes no production or stored-data contract, so the contributor runtime-proof gate does not apply. The reported focused Testbox pass supports retained tests but does not exercise the deleted edge cases; data-model compatibility is not applicable.

Evidence

Security concerns:

  • [low] Default-deny pairing loses connection-level regression coverage — src/gateway/server.node-pairing-auto-approve.test.ts:56
    The current guard still rejects absent CIDRs, but the deleted LAN test was the only full-connection assertion that such a node remains pending and unpaired.
    Confidence: 0.82

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Jesse Merhi: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

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

  • Restore the nondefault-agent RPC, provider stalled-send, and default-off LAN cases, then report focused results for those suites.

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 f446771 into main Sep 28, 2026
128 of 130 checks passed
@steipete
steipete deleted the tcr/land-d079-1790561765 branch September 28, 2026 04:09
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 28, 2026
…tch d079) (openclaw#160084)

* test(doctor): deslop s716 tests

* test(agents): deslop t0026 tests

* test(agents): deslop t0033 tests

* test(gateway): deslop t0006 tests

* test(gateway): deslop t0011 tests

* test(sessions): deslop t0017 tests

* test(gateway): deslop t0014 tests

* test(cron): deslop t0040 tests

* test(cron): deslop t0037 tests

* test(cron): deslop t0039 tests

* test(agents): assert exec followup calls before inspection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling commands Command implementations gateway Gateway runtime merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant