Repository navigation
test(agents,cli-runner): remove low-value tests (batch d170) - #164248
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed October 3, 2026, 6:37 AM ET / 10:37 UTC. ClawSweeper reviewWhat this changesConsolidates agent and CLI-runner test fixtures and scenarios, removes redundant cases, and moves overlapping compaction watchdog coverage into one retained suite. Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this is a useful, administrator-authored cleanup that current main has not absorbed. No concrete introduced correctness defect was identified; historical shard validation remains distinct from current-head CI. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw’s agent runtime selects models, executes tools, streams replies, and recovers interrupted work. These tests guard its authority, ordering, timeout, and recovery contracts without changing production behavior. flowchart TD
A[Conversation and configuration] --> B[Agent runtime]
B --> C[Model and tool execution]
C --> D[Reply delivery]
C --> E[Timeout and recovery decisions]
F[Consolidated regression scenarios] --> B
F --> E
E --> C
Before merge
Agent review detailsSecurityNone. PR surfaceTests -3458. Total -3458 across 56 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep one focused test owner per contract while retaining distinct authority, lifecycle, ordering, and recovery regressions. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR consolidates tests and reports no production defect; no tests were executed in this read-only review. Is this the best way to solve the issue? Yes: consolidating fixtures and moving overlapping coverage to the retained execution boundary is a maintainable approach, with no concrete introduced defect identified. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 10bddffa349e. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
…w#164248) * test(agents): deslop u0096 tests * test(agents): deslop u0098 tests * test(cli-runner): deslop u0093 tests * test(agents): deslop u0099 tests * test(agents): deslop u0100 tests * test(agents): deslop u0103 tests * test(agents): deslop u0102 tests * test(agents): deslop u0101 tests * test(agents): deslop u0106 tests * test(agents): deslop u0109 tests * test(agents): retain distinct coverage and settle watchdog fixtures * test(agents): update terminal lifecycle fixture result reader
What Problem This Solves
Agent and CLI-runner tests repeat fixtures, equivalent inputs, and overlapping compaction checks, increasing maintenance cost without distinct behavior coverage.
User Impact
No user-visible or production behavior changes. This batch reduces test duplication while retaining authority, security, lifecycle, recovery, and ordering regressions.
Why This Change Was Made
Replay the ten validated campaign shards in batch d170 onto current main. Consolidate related scenarios at their owning boundaries, remove redundant executions, and fold duplicate compaction watchdog suites into the retained execution suite.
All ten commits applied; no commit was skipped. One conflicting file was preserved from main: the u0101 cleanup of tool-result cache tests predated main's prepared-result lifecycle and was dropped. No production seams, configuration, or baselines change. The terminal lifecycle test fixture also follows the current sanitized-result reader contract. No touched path matches the current CODEOWNERS rules.
Evidence
CI=1 pnpm testover the 54 retained touched test files, thenOPENCLAW_TESTBOX=1 OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 CI=1 node scripts/check-changed.mjs --base f46b6ead95ec3a5e279816cafc172e6ee8252e6b -- <55 changed TS paths>. AWS leasecbx_6fc30ffb0a87, runrun_51c21d2b95c2336d4f264c0585b81d08, exit 0. The PR head and the fixture-patch hash were checked before validation.git diff --check: passed.records one accepted terminal factcases becausecreateCatalogSubscriptiondid not providereadSanitizedResult. Current main had the same stale fixture. The fixture now supplies the productionprepareToolResultreader for both success and error outcomes; production behavior and assertions are unchanged. AWS reproduced the four failures before the repair and passed them afterward.tbx_01m40jzxd1vy55ya30s0cfw1wzremained queued without a runner for over 15 minutes and was stopped. AWS leasecbx_f4933a58a523hitsync-quietduring local source synchronization and was released. Fetching the published PR directly on the subsequent AWS lease completed the required proof.Shard files, reduction counts, coverage totals, and replay decisions
Scope and replay
All ten campaign commits were applied to current main. The final replay changes 56 test files (54 retained files and two deletions) plus one test-support file: tests +3,939 / −7,397 LOC; test support +8 / −2 LOC; combined net −3,452; production +0 / −0 LOC. The test-support change supplies the current terminal result reader.
The replay dropped only the
src/agents/embedded-agent-tool-results.cache.test.tshunk from u0101 because main changed the prepared-result lifecycle. Main's current lifecycle coverage is retained. No other conflicts occurred. Independent review also led to restoring both settlement-sanitization backend cases and separating successful-progress from elapsed-time output-limit recovery again. The consolidated watchdog case now releases and settles its work after assertion failures. The direct generation failure and published text-only capability rows were also retained after review. Historical u0101 metrics include that dropped hunk; u0098/u0099/u0109 counts also predate the review corrections. The historical metrics therefore do not describe the final replay exactly.Historical in-shard evidence
These counts and coverage totals come from the original shard result reports. They describe the independently validated campaign shards before replay, not fresh coverage measurements against current main. Historical aggregate counts were 30,748 → 27,252 test LOC (−3,496), 701 → 470 declarations (−231), and 1,280 → 1,116 executed cases (−164). Every shard reported passing focused tests, coverage comparison, remote changed-file checks, formatting, diff checks, and plain Oxlint. u0099 and u0109 did not reach the declaration-reduction target; all shards preserved valuable distinct cases rather than reaching the original 50% execution/LOC target.
u0096
Historical test LOC: 3,142 → 2,857 (−285). Declarations: 77 → 53 (−24). Consolidated repeated fixtures and related cases, removing eight redundant executions while retaining authority, race, and Markdown regressions.
Current replay files:
src/agents/command/attempt-execution.cli.completion-tools.test.tssrc/agents/command/model-selection.configured.test.tssrc/agents/cron-creator-authority-context.test.tssrc/agents/decision-assistance.test.tssrc/agents/embedded-agent-block-chunker.test.tsExact reported coverage totals:
u0098
Historical test LOC: 2,996 → 2,846 (−150). Declarations: 71 → 47 (−24). Consolidated repeated setup/assertions and redundant variant rows while retaining authority boundaries, recovery regressions, and lifecycle proof.
Current replay files:
src/agents/embedded-agent-runner/run/attempt-decision-context.test.tssrc/agents/embedded-agent-runner/run/attempt-decision-diagnostics.test.tssrc/agents/embedded-agent-runner/run/attempt-decision-prefilter.test.tssrc/agents/embedded-agent-runner/run/attempt-history-prepare.test.tssrc/agents/embedded-agent-runner/run/attempt-prompt-build.decision.test.tssrc/agents/embedded-agent-runner/run/attempt-prompt-build.provenance.test.tssrc/agents/embedded-agent-runner/run/attempt-recovery.test.tsExact reported coverage totals:
The summary does not report function totals. No excluded groups or statement losses; the only per-file loss was one branch in
retry-evidence.ts.u0093
Historical test LOC: 2,912 → 1,769 (−1,143). Declarations: 59 → 35 (−24). Removed duplicate compaction layers, repeated event matrices/fixtures, and one duplicate recovery case. Retained history security boundaries, ordering checks, recent regressions, and both liveness owners.
Current replay files:
src/agents/cli-runner/cli-run-recovery.test.tssrc/agents/cli-runner/execute-events.tool-result-args.test.tssrc/agents/cli-runner/execute-plugin.compaction-watchdog.test.ts(deleted)src/agents/cli-runner/execute.compaction-watchdog.owner.test.ts(deleted)src/agents/cli-runner/execute.compaction-watchdog.test.tssrc/agents/cli-runner/no-output-timeout-policy.test.tsExact reported coverage totals:
All coverage groups were included. Per-file losses of six reset statements and eight tool-result statements retain named sibling coverage in the shard report.
u0099
Historical test LOC: 4,567 → 4,317 (−250). Declarations: 92 → 72 (−20). Consolidated 19 declarations, removed one redundant plaintext passthrough case, and pruned duplicate harness variants. Retained authority, cancellation, FIFO, credential, and recent regressions.
Current replay files:
src/agents/embedded-agent-runner/run/attempt-result.test.tssrc/agents/embedded-agent-runner/run/attempt-stream-prepare.test.tssrc/agents/embedded-agent-runner/run/attempt-system-prompt.sandbox-info.test.tssrc/agents/embedded-agent-runner/run/attempt-terminal-anchor.test.tssrc/agents/embedded-agent-runner/run/attempt.model-diagnostic-events.test.tssrc/agents/embedded-agent-runner/run/backend.test.tssrc/agents/embedded-agent-runner/run/failover-retry-controller.inline-auth.worker.test.tsExact reported coverage totals:
No excluded groups. The sole branch loss was in
workspace-access.ts; the removed plaintext passthrough has direct owner coverage.u0100
Historical test LOC: 2,505 → 1,847 (−658). Declarations: 115 → 48 (−67). Consolidated timeout variants, retry-floor fixtures, payload-rejection cases, model attribution, and yield assertions. Retained security boundaries and retry/yield regressions.
Current replay files:
src/agents/embedded-agent-runner/run/failover-retry-controller.test.tssrc/agents/embedded-agent-runner/run/helpers.resolve-reported-model.test.tssrc/agents/embedded-agent-runner/run/llm-idle-timeout.policy.test.tssrc/agents/embedded-agent-runner/run/provider-review-continuation.test.tssrc/agents/embedded-agent-runner/run/terminal-preparation.yield.test.tsExact reported coverage totals:
No per-file drops or excluded groups.
u0103
Historical test LOC: 2,514 → 2,231 (−283). Declarations: 38 → 26 (−12). Consolidated 12 declarations into tables and removed repeated outbox fixtures. Preserved every scenario and assertion, including authority fences, FIFO recovery, matcher selection, and schema-once regressions.
Current replay files:
src/agents/harness/context-engine-turn-outbox.test.tssrc/agents/harness/host-capability.delegation.test.tssrc/agents/harness/host-capability.grant-authority.test.tssrc/agents/harness/host-capability.source-lifetime.test.tssrc/agents/harness/host-model-execution.test.tssrc/agents/harness/native-hook-relay.execution-admission.test.tsExact reported coverage totals:
u0102
Historical test LOC: 2,781 → 2,477 (−304). Declarations: 51 → 35 (−16). Removed 27 equivalent parser variants, consolidated 15 declarations, and absorbed one standalone host-SQL check into retained finalization coverage. Retained provider precedence, retry-window boundaries, cleanup boundaries, deadlines, compaction, ancestry, identity, ordering, recovery, and maintenance-lifetime checks.
Current replay files:
src/agents/failover/provider-429-precedence.test.tssrc/agents/failover/retry-evidence.test.tssrc/agents/github-tool-profile-cleanup.test.tssrc/agents/harness/attempt-deadlines.test.tssrc/agents/harness/context-engine-turn-attempt.test.tsExact reported coverage totals:
All four coverage groups were included.
u0101
Historical test LOC: 2,581 → 2,480 (−101). Declarations: 50 → 35 (−15). Folded 13 declarations into scenario tables and removed two redundant cases while retaining security, ordering, and recent regression checks. These historical metrics include the dropped
embedded-agent-tool-results.cache.test.tshunk; that file is unchanged in the final replay because main changed the prepared-result lifecycle.Current replay files:
src/agents/embedded-agent-runner/tool-result-context-guard.prepared-counts.test.tssrc/agents/embedded-agent-subscribe.before-terminal-delivery.test.tssrc/agents/embedded-agent-subscribe.directive-delivery.test.tssrc/agents/embedded-agent-subscribe.model-state.test.tssrc/agents/embedded-agent-subscribe.subscribe-embedded-agent-session.subscribeembeddedagentsession.deferred-progress.test.tsExact historical coverage totals:
Historical coverage losses were 0.16% statements / 0.19% branches, within the shard gate, with no excluded groups. The sanitizer drop retained sibling coverage in
embedded-agent-tool-results.reuse.test.tsandembedded-agent-subscribe.tools.test.ts.u0106
Historical test LOC: 2,459 → 2,245 (−214). Declarations: 61 → 42 (−19). Folded 14 repetitive declarations and absorbed five overlapping executions while retaining distinct authority, concurrency, persistence, and real-process cleanup regressions.
Current replay files:
src/agents/main-session-recovery/main-session-recovery-store.test.tssrc/agents/main-session-recovery/main-session-restart-dispatch-capacity.test.tssrc/agents/main-session-recovery/main-session-restart-recovery-admission.test.tssrc/agents/mcp-content.test.tssrc/agents/mcp-oauth-provider.preparation.test.tssrc/agents/mcp-stdio-client.cleanup.real.test.tssrc/agents/model-auth-availability.oauth-grants.test.tsExact reported coverage totals:
u0109
Historical test LOC: 4,291 → 4,183 (−108). Declarations: 87 → 77 (−10). Consolidated passive-read, owner-selection, and recovery declarations and removed four repeated executions. Retained distinct regression, authority, and concurrency checks.
Current replay files:
src/agents/prepared-model-catalog.scoped-thinking.test.tssrc/agents/prepared-model-runtime.auth-recovery.test.tssrc/agents/prepared-model-runtime.owner-selection.test.tsExact reported coverage totals:
No per-file drops or excluded groups.