Skip to content

test(gateway,agents,plugins): remove low-value tests (batch d476) - #182687

Merged
steipete merged 28 commits into
mainfrom
tcr/land-d476-1792855370
Oct 24, 2026
Merged

steipete merged 28 commits into
mainfrom
tcr/land-d476-1792855370

Conversation

@steipete

@steipete steipete commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

This batch removes duplicate assertion layers and consolidates repeated fixtures while retaining distinct authorization, persistence, replay, lifecycle, and transport contracts. It replays the compatible portions of d476 onto pinned main 2084139a66861a40cb11127eff0166d2cf3bba17.

The final diff changes 30 test files and two shrink-only baseline files: +3,774 / -8,271 test lines (net -4,497), plus three obsolete baseline lines removed; production +0 / -0. No public behavior, runtime configuration, dependencies, or changelog changes.

Replay and retained boundaries

26 source commits applied (some partially); four skipped:

  • r0040: 769d2b4940a0, c2ee2d35ac57, 52f685c643a0 skipped. All five provider test files have newer fixture/helper and coverage structure on main; replaying the old helper assumptions would need a fresh audit. The campaign report also notes unavailable helper exports.
  • r0050: 32c27655679a skipped after retaining main's rewritten model-matrix test and richer evidence assertions; no remaining hunk.

Conflict resolutions favor current main:

  • r0041: retained all current config-patch tests. Applied first-pass managed-image fixture simplifications, but omitted later managed-image reductions that conflict with current ticketed-thumbnail and HTTP validator coverage. Kept newer media trust/HTTP tests. Applied session-message event reductions.
  • r0043: retained current schema-policy and conflicted state-ownership fixture changes, including newer authorization/WAL checks. Applied compatible creation-witness, validation-cache, preflight, cleanup, and nonconflicting ownership reductions.
  • r0044: retained async-message tests and their current durable actor/persistence proof. Kept newer normal-run settlement and manual-compaction tests while consolidating compatible compaction scenarios.
  • r0046: retained newer dynamic-tool helpers/typed hook assertions. Omitted later conflicting dynamic-tool and side-question changes, preserving Decision outcome/cancellation and native-hook policy proof. Auth-bridge changes applied.
  • r0047: retained preflight, plugin-dispatch, and model-picker files where old helper APIs or narrower fixtures conflict with main's current routing, dispatch ownership, and Unicode/runtime coverage. Listeners and native model-picker changes applied.
  • r0045: retained image-tool and sessions-spawn files (current fixture/owner APIs differ; old image helper exports are absent). Session and web-fetch reductions applied.
  • r0048: applied without conflicts.
  • r0049: retained current attempt-session and writer-claim files. Kept newer output-limit continuation and retry-evidence cases; omitted conflicting final recovery fixture rewrite. Compatible execution, settlement, transcript-preparation and recovery changes applied.
  • r0050: retained model-matrix and lab-server files, including current live evidence projections and capture-provider/model dimensions. Applied CLI/suite-launch reductions; retained CLI runtime model resets and scorecard checks.

Per-shard accounting

Counts below are the actual changed-file totals against the pinned main, not the original campaign totals. Declarations are static it/test declaration counts, not executed/expanded cases. The supplied reports explicitly say coverage was not run under CI-only mode; no covered-statement/branch totals are claimed.

Shard Test LOC before → after Declarations before → after In-shard coverage totals
r0041 3763 → 2811 (-952) 66 → 54 (-12) Not run (CI-only)
r0043 4531 → 4252 (-279) 96 → 89 (-7) Not run (CI-only)
r0044 4564 → 3975 (-589) 82 → 70 (-12) Not run (CI-only)
r0045 2248 → 1415 (-833) 65 → 41 (-24) Not run (CI-only)
r0046 3384 → 3236 (-148) 69 → 61 (-8) Not run (CI-only)
r0047 1889 → 1773 (-116) 52 → 47 (-5) Not run (CI-only)
r0048 5487 → 4542 (-945) 139 → 123 (-16) Not run (CI-only)
r0049 3653 → 3306 (-347) 59 → 57 (-2) Not run (CI-only)
r0050 3028 → 2740 (-288) 68 → 60 (-8) Not run (CI-only)
r0040 Skipped Skipped Not run (CI-only)
  • r0041: src/gateway/managed-image-attachments.test.ts, src/gateway/session-message-events.test.ts
  • r0043: src/state/agent-deletion-cleanup.test.ts, src/state/openclaw-agent-db-validation-cache.test.ts, src/state/openclaw-agent-execution.creation-witness.test.ts, src/state/openclaw-database-preflight.test.ts, src/state/openclaw-state-ownership.test.ts
  • r0044: src/agents/sessions/agent-session-compaction.test.ts, src/agents/sessions/agent-session-loop-correctness.test.ts, src/agents/sessions/agent-session-loop-next-turn.test.ts, src/agents/sessions/agent-session-models.admission.test.ts, src/agents/sessions/session-manager-model-context.test.ts
  • r0045: src/agents/tools/sessions.test.ts, src/agents/tools/web-tools.fetch.test.ts
  • r0046: extensions/codex/src/app-server/auth-bridge.test.ts, extensions/codex/src/app-server/dynamic-tools.test.ts
  • r0047: extensions/discord/src/monitor/listeners.test.ts, extensions/discord/src/monitor/native-command.model-picker.test.ts
  • r0048: src/plugins/doctor-contract-registry.test.ts, src/plugins/plugin-module-generation.interop.test.ts, src/plugins/provider-hook-runtime.provenance.test.ts, src/plugins/provider-self-hosted-setup.test.ts, src/plugins/registry.runtime-config.test.ts, src/plugins/schema-validator.required.test.ts
  • r0049: src/agents/embedded-agent-runner/run/attempt-execution-phase.test.ts, src/agents/embedded-agent-runner/run/attempt-execution-settle.test.ts, src/agents/embedded-agent-runner/run/attempt-recovery.test.ts, src/agents/embedded-agent-runner/run/attempt-transcript-lifecycle-prepare.test.ts
  • r0050: extensions/qa-lab/src/cli.runtime.test.ts, extensions/qa-lab/src/suite-launch.runtime.test.ts

Evidence

  • pnpm install --frozen-lockfile --prefer-offline: passed.
  • node_modules/.bin/oxfmt --write <all 30 changed files>: exit 0.
  • node_modules/.bin/oxlint -c .oxlintrc.json <all 30 changed files>: exit 0.
  • git diff --check 2084139a66861a40cb11127eff0166d2cf3bba17: exit 0.
  • Per operator CI-only rule, no local Vitest, check-changed, tsgo, builds, coverage, or Testbox runs. Test wall time is unavailable locally; hosted openclaw/ci-gate owns test proof.
  • Independent review completed; the final CI repair delta is scoped-clean through P2. Review dispositions follow below.
  • No changed path matches the current CODEOWNERS entries.
  • Main risk is accidental lost coverage or fixture drift during test consolidation; compatible boundaries are retained and hosted CI must pass.

CI follow-up and review

Initial run 40107335521 exposed six fixture/type issues: numeric presence-frame narrowing, a missing ExtensionFactory import, agent-context typing, renamed fixture manager, a required fixture label, and a removed assertion-helper reference. Commit 072aecdedb45 fixes them while preserving assertions. It also removes the stale max-lines entry and two obsolete mock baseline entries, documenting why the mock boundaries isolate real A2A turns and participant persistence. Local formatting, plain lint, and diff-check pass; hosted CI validates the replacement head. No local tests/typechecks were run.

Independent review completed in two passes. I checked all eight reported coverage concerns against current source and retained owner tests; none requires restoring the removed duplicate layer:

  • Model context: the scenario still carries marked excluded/opaque payloads; retained excluded-payload cases and session-manager-model-context-limits.test.ts cover upstream metadata.
  • SSRF: web-guarded-fetch.ts delegates to the guarded-fetch owner. fetch-guard.ssrf.test.ts retains literal-private and redirect-to-private rejection; web_fetch retains denial propagation without fallback.
  • QA output symlinks: suite-planning.test.ts retains the exact symlink rejection; runUnifiedQaSuite resolves output through that owner before artifacts or runners.
  • Global transcript routing: server-session-events.test.ts retains scoped plus bare global subscribers, configured/explicit ownership, and retired-owner privacy.
  • Schema invalidation: cacheKey is compatibility-only; schema content owns identity. schema-validator.manifest.test.ts retains immutable-equivalence and mutable-descendant invalidation.
  • Native sibling assets: plugin-module-generation.sibling-assets.test.ts retains hoisted, nested, linked, unscoped and generation-replacement asset checks.
  • Discovery bounds: provider-self-hosted-discovery.test.ts retains max-active=8 with out-of-order completion and 201-model/200-probe cap checks.
  • Authored webhook endpoint: doctor-contract-registry.test.ts already retains the explicit:true trusted-owner row.

CI then identified real replay errors: missing import/helper, outdated fixture property/type, and stale baseline entries. The follow-up fixes those without dropping failed tests or weakening assertions. A second review caught an overly permissive numeric-counter fallback; the final repair rejects present nonnumeric values. Static gates pass; hosted CI is the runtime/type proof.

The final targeted repair review is scoped-clean through P2. The initial repair's numeric fallback finding was accepted and fixed. The follow-up cleanup only reuses an existing type alias and equivalent optional cleanup to keep the already-over-cap file from growing; no gate was bypassed.

Consolidate transcript event fixtures and collectors, media request and cleanup setup, and config hash boundary proof.

The subscribed-operator test retains appended-message persistence proof; the committed-turn web/TUI test retains reconnect history proof. Spawn and route fields share the same real transcript projection. Runtime revision proof also rejects the internal config digest.

CI-only: plain oxlint, oxfmt, and diff-check pass. Static expanded cases 117 to 113; test lines 4758 to 4472. Keep distinct auth, lifecycle, recovery, ownership, and ordering paths; 35 percent is not safely attainable in this shard.
Keep socket-specific auth, presence, profile parity, ordered delivery and hidden-message dispatch. Remove replayed invalidation, sequence, global routing, marker and display-cap cases already covered by server-session-events.test.ts and its marker-queue support, chat-display-projection.test.ts, and server.sessions.list-changed.test.ts. Move shared spawn/goal snapshot checks into the retained transcript event case.

Viewer normalization and replace/clear behavior remain in server-methods/sessions-viewers.test.ts and server.auth.presence-modes.test.ts. Profile identity/name detail remains in sessions-history-http.test.ts and chat-display-projection.test.ts; this suite retains same-clock avatar parity for WebSocket, history and message-get.

Media download, promotion, visibility and cross-agent cleanup remain in managed-image-actions.e2e.test.ts, chat-reply-media.large-video.test.ts, managed-image-record-store.test.ts, managed-image-attachments.sqlite-visibility.test.ts and managed-outgoing-gc-availability.test.ts. Config copy-fallback variants remain in io.write-config.test.ts and io.write-reread.test.ts.

CI-only static gates: oxfmt, plain oxlint and diff-check. No test, coverage or build runs. Total shard lines 4758 to 3579; preserve remaining distinct boundaries rather than force the 35 percent target.
Use deterministic scope-owned socket disposal, consolidate subscription and worker metadata assertions, and remove a duplicate delivery-position assertion covered by the retained collector order check.

Share config write-invalidate-read seeding and combine equivalent global-media cleanup fixtures while retaining both explicit and legacy ownership cases. Keep all 91 expanded cases from the prior shard revision.

CI-only: oxfmt, plain oxlint, and diff-check pass; no test, coverage, or build commands run. This pass reduces 3579 to 3463 lines; cumulative reduction is 27.2 percent, short of the requested 35 percent.
Remove creation-witness copies of clean restart refusal, malformed native receipt, and warm-turn admission tests. Identical behavior remains in openclaw-agent-execution.schema-admission.test.ts.

Reuse the existing dangling Workshop index fixture in preflight and ownership tests, retaining both admission and ownership-race assertions. CI-only validation: oxfmt, diff check, and plain oxlint.
Keep migration rollback proof in openclaw-state-db-schema-version.test.ts (publishes migration-owned content markers through rollback and authorizer checks); retain sibling snapshot publication and dropped-table checks in schema-policy.

Consolidate peer revocation into the raced-publication case, WAL inspection into its refusal case, and read-only ownership into maintenance fencing. Remove internal call-shape and duplicate state assertions; reuse typed fixtures and source admission builders. Preserve the remaining distinct authority and durability interleavings.

CI-only validation: oxfmt, git diff --check, and plain oxlint passed. No tests or coverage executed. Original shard 5253 lines to 4885; 35 percent target remains unmet.
Consolidate schema refresh, reader adoption, and additive repair in one retained-reader flow. Consolidate shared-store warm/cold row removal with the archive/no-host-SQL proof; higher-level purge wrapper coverage remains in preserves a survivor handle first opened during cleanup.

Remove preflight replays covered by sqlite-schema-contract.test.ts (accepts a compatible future additive column only when enabled; preserves index issue order when a missing index is allowlisted), memory-schema.test.ts (uses the compound chunk index after opening a database and readmitting it), and openclaw-agent-db.test.ts (repairs every missing or drifted canonical agent-state named index). Remove copied metadata/inventory assertions.

CI-only checks: oxfmt, git diff --check, plain oxlint passed. No tests or coverage run. Original shard 5253 lines to 4778; 35 percent target remains unmet without discarding distinct behavior.
Consolidate queued commit-order proof into confirms identical queued messages only after their own transcript commits, and listener removal into the ordinary listener snapshot case. Keep persistence-before-publication assertions at each queued commit.

Move context invalidation proof into recovers through the overflow limit with context invalidated before every retry. First-overflow success remains covered by strips stale thinking signatures before continuing after auto-compaction. Remove only the successful caller-owner duplicate; explicit caller overflow recovery remains covered.

Reuse local stream fixtures, retain same-run next-turn message identity, and trim repeated frozen graph checks; FIFO remains covered by commits user and custom messages in FIFO order. Preserve distinct authority, custody, cancellation, durability and context traversal cases.

CI-only campaign: plain oxlint, oxfmt and diff checks passed. No tests, coverage, builds or Testbox commands run. Honest reduction is below target because remaining cases protect distinct boundaries.
Share high-usage and summary-policy scenarios while retaining each success, failure, cancellation and terminal branch. Manual short-history compaction remains covered by caps extension summaries before persistence and manual return. Unobserved extension delivery remains covered by observes live handler registration and awaits handlers inside write settlement.

Remove JSON normalization replays covered by src/config/sessions/transcript-json.test.ts: retains ordinary shared JSON and unchanged frozen containers, copies changed frozen containers without changing the source, and matches native JSON bytes. Keep async capture and serialization integration assertions.

Remove duplicate FIFO and host-write checks covered by session-manager-async-entries.test.ts. Keep fresh-message and stale-keyed-replay admission checks. Drop repeated context matrix payloads covered by dedicated pairing and checkpoint cases and session-manager-model-context-limits.test.ts.

Remove repeated sender/timestamp rendering assertions covered by attempt.llm-boundary.cache-stability.test.ts and attempt.llm-boundary.test.ts while retaining steering admission timestamps and persisted/runtime content ownership. Preserve compaction item correlation, aborted accounting, stale authority and durable recovery boundaries.

CI-only: plain oxlint, oxfmt and diff checks pass; no tests, builds or coverage run. Combined shard reduction remains below the requested 35 percent; no further safe duplicate layer was identified.
Use one context-mutation setup for the existing nine admitted and unadmitted cases. Preserve independent expected context, exact admission typing, and append/rewrite/delete/branch/compaction/reset/cross-session behaviors.

Share pending-input staging, out-of-turn rejection assertions, and abortable queued-run startup. Reuse the canonical zero-usage fixture and trim unused summary fixture text.

Plain oxlint, formatting and diff checks pass. CI-only: no tests, builds or coverage were run. No cases or production files removed in this round. The shard still cannot meet the 35 percent target without removing distinct boundary proof identified in the retained cases.
Remove the middleware-ordering replay covered by openclaw-owned-tool-runtime-contract.test.ts: wraps dynamic tools with hooks and runs result middleware before the after hook. Consolidate result-only bridge fixtures and repeated diagnostic/requester context.

Keep auth-bridge and side-question unchanged: remaining cases exercise distinct credential authority, policy, and lifecycle boundaries. Static lint/format/diff gates only; tests and coverage deferred to hosted CI per campaign instructions.
Keep side-question flow checks while removing repeated config and context inventories. Native-hook-relay disabled config, turn-params timezone, side-question.model-selection reasoning, config network proxy, and plugin-thread-config ask-policy tests retain their owner contracts. Fold disabled-relay flow into the ephemeral fork case.

Consolidate auth fallback and workspace-rejection setup without deleting branch cases. Remove dynamic MCP delegation, disabled-catalog, async replay, and Decision cancellation replays covered by dynamic-tools.gateway-policy, run-attempt-tools, event-projector.dynamic-tools, generic per-call cancellation, and src/decisions/runtime tests.

CI-only campaign: plain oxlint, oxfmt, and diff-check passed. No tests or coverage run. Original shard 5290 lines to 4895; the 35 percent target remains unmet because remaining distinct authority, lifecycle, and schema behavior has no demonstrated replacement.
Replace repeated scoped and persisted auth setup with a typed fixture. Reuse screenshot/schema fixtures and remove mocked Decision and memory-reply replays covered by openclaw-tools.decision and tool-terminal-outcome owner tests.

Drop side-question copies of model selection covered by run-attempt and thread-lifecycle binding tests, domain enforcement covered by dynamic-tool-build.web-search and web-tools.fetch, and disconnect coverage held by ephemeral-turn plus retained side cleanup cases. Remove nonexistent registerSideQuestionForkTests registration; standalone side-question.fork.test.ts owns those cases.

No test runs per CI-only instructions. Plain oxlint, oxfmt, and diff-check pass. Original shard 5290 lines to 4548; remaining unique credential, lifecycle, and schema cases prevent a justified 35 percent cut.
Remove duplicate guild authorization/arguments and direct-status layers covered by native-command.commands-allowfrom.test.ts and native-command.status-direct.test.ts. Keep bot-owned thread admission and schema coverage in message-handler.preflight-owned-threads.test.ts.

The authoritative runtime verification table retains default-runtime dispatch assertions. Reuse local session, notice, delivery, binding, and route fixtures while preserving distinct ownership and lifecycle cases.

CI-only validation: plain oxlint, oxfmt, and diff check. No tests or coverage run. Known baseline issue: native-command.plugin-dispatch.test.ts imports missing native-command.test-support.js.
Consolidate hidden model dispatch outcomes and presence retry branches. Remove self-proving plugin command-name wrapper and redundant helper-call assertions, while preserving model scope, component-document admission, and post-unbind echo proof.

Remaining concurrency owner proof: extensions/discord/src/monitor.test.ts durable handler handoff and subsequent concurrent events, plus internal/client.test.ts listener-slot lifetime. Embed text fallback remains in message-text.test.ts and threading.starter.test.ts; retained mention cases cover the same preflight decision branches.

CI-only: oxfmt, plain oxlint, and diff-check pass. No tests or coverage run. Original shard 4437 lines to 3806; 35 percent target remains unmet because further identified cuts lose distinct authority or lifecycle behavior.
Fold code-point label truncation into the native picker identity round-trip; remove the duplicate renderer case. Share picker invocation, attachment, binding, PluralKit, and batch fixtures. Centralize monitor cleanup and remove redundant implementation counts while preserving visible outcomes and ordering.

Preserve all distinct admission, runtime identity, and lifecycle cases. CI-only static gates: oxfmt, plain oxlint, and diff-check pass; no tests or coverage run. Original shard 4437 lines to 3701 (16.6 percent); the 35 percent target remains unmet under the distinct-behavior retention constraint.
Share image, session-send and web-fetch fixtures while retaining all 173 statically expanded cases. Keep distinct authorization, sandbox, incarnation, delivery and cancellation paths; this shard is already largely branch-consolidated.

CI-only validation: oxfmt, plain oxlint and diff checks. Runtime tests and coverage intentionally deferred. Baseline image support exports are missing and require coordinator follow-up.
Remove stale mock machinery, ineffective probes, copied schema inventories and sibling-covered helper replays. Keep image reasoning at image-tool.response, compression facts at model generation/static-catalog and clawrouter-native-model-facts, spawn capability schemas at openclaw-tools session-context/thread-binding, and fetch JSON/guard behavior at the existing extraction and network owner suites.

Retain distinct resolver-absent delivery, visible-producer capacity, incarnation, sandbox, cancellation and cache-policy boundaries. Consolidate repeated request/error fixtures and preserve zero/default timeout registration assertions.

CI-only: oxfmt, plain oxlint and diff checks passed; no tests or coverage run. Cumulative line reduction remains below 35 percent because distinct boundary proof is retained.
Share auth, RPC, cancellation and no-reply fixtures while retaining distinct safety branches. Remove repeated wiring and schema inventories. Keep real image loading and scoped auth isolation.

Duplicate owner proof remains in web-fetch.provider-fallback.test.ts (preserves wrappers in a char budget; unread-error fallback cleanup), sessions-resolution.test.ts (failed custom-key lookup), sessions-access.test.ts (transient tree visibility), subagent-spawn.production-boundary.test.ts (managed worktrees), acp-spawn.test.ts (resume and lineage), and provider-runtime.test.ts (owner failover).

CI-only: no tests or coverage run. Plain oxlint, oxfmt and diff-check passed. Shard LOC 4888 -> 3235 (33.8%); below the 35% target because remaining cases guard distinct auth, sandbox, lifecycle and cancellation paths.
Share repeated schema, provider request, credential, registry and Doctor fixtures while preserving distinct cases and assertions. Keep module interop unchanged: its loader formats, captured generations, resolver conditions and lifecycle paths are independent contracts. CI-only shard; no test or coverage runs.
Discovery concurrency, probe caps and context precedence remain covered by provider-self-hosted-discovery.test.ts. Doctor artifact selection remains covered by doctor-contract-artifact.test.ts. Keep warning-only candidate isolation in the normalizer table and combine full/touched collector fixtures.

Module generation keeps scoped assets and distinct interop paths; sibling-assets tests cover unscoped nested installs, and selected-dependency promotion plus first-demand generation tests cover captured dependency bytes. Retain exact generation provider assertions in config-refresh/workspace cases. Schema tests share source fixtures, consolidate required diagnostics, and drop repeated default applications; reverse dependency convergence remains covered by json-schema-defaults.test.ts.

CI-only: plain oxlint, oxfmt and diff checks pass. No tests or coverage run. Cumulative shard reduction is 5487 to 4740 lines, below the 35 percent target; remaining unique behavior is preserved.
Keep historical authored endpoints in the deferred trusted-owner row and per-account inheritance in legacy-webhook-listener-migration tests. Remove internal loader/cache inventories and duplicate physical-manifest lookup proof already exercised by real provider/hook source rejection cases. Fold catalog field priority into the mixed catalog test.

Share tuple fixtures and remove unused schema cache-key labels. Keep the unique unserializable-schema error path; content-key invalidation remains covered by schema-validator.manifest.test.ts immutable and mutable schema cases. Preserve all remaining source-default, authority, generation and lifecycle boundaries.

CI-only: formatting, plain oxlint and diff checks passed; no tests or coverage run. This additional 198-line reduction brings the original 5487-line shard to 4542 lines. The 35 percent target remains unmet.
Remove lifecycle cases duplicated in lane-controller.lifecycle.test.ts and rate-limit cases retained in attempt-recovery.per-day-rate-limit.test.ts. Keep the cron output-limit route while removing redundant budget variants.

Reuse the existing SQL observation helper and local transcript setup; retain authority, persistence, cancellation, and ordering cases. Terminal receipt merging remains covered by terminal-preparation.run-stats.test.ts.

CI-only validation: plain oxlint, oxfmt, and diff check. Runtime tests and coverage intentionally deferred. Reduction is below the requested target because remaining cases protect distinct lifecycle and durability behavior.
Drop actor append ordering replay covered by session-manager-async-message.test.ts (lets another session write between actor appends while retaining manager order), retaining replaced-writer rejection in the persisted tool-result acknowledgement test.

Drop unchanged capture replay covered by session-actor-message-rewrite.test.ts (commits prompt capture and its carrier together) and attempt-prompt-submit.projections.test.ts serialized-prefix cases. Drop terminal-error settlement replay covered by session-tool-result-guard.transcript-events.test.ts (keeps one original terminal error without splitting text, tool facts, or usage).

Consolidate output-limit continuation and progress assertions, delegate cap policy to failover-retry-controller.test.ts, and remove execution wiring snapshots while retaining generation, compaction, cancellation, and settlement boundary proofs.

CI-only: plain oxlint, oxfmt, and diff check passed; no tests or coverage run. Remains below the requested line target because the remaining initial-writer, permission, proposal, and image-note cases have distinct authority or durability behavior.
Separate pre-install admission refusals from real compaction races. Share image-note scope, publication, and canonical transcript assertions while retaining dirty-tail replay, nonempty replacement preservation, commit-loss handling, and cleanup on failed assertions.

Consolidate repeated recovery error/timeout fixtures and remove same-branch retry combinations covered by retained parked-work, failed-batch, idle-timeout, and rate-limit cases. Reuse writer claim and seed helpers without changing authority ordering.

CI-only static validation: plain oxlint, oxfmt, and diff check passed. No tests or coverage run. All distinct authority/durability cases retained; cumulative line reduction remains below 35 percent.
Keep lifecycle and evidence-custody cases while removing internal launch dumps, repeated catalog inventories, and duplicate planner and artifact assertions. Reduce profile and capture fixtures to their owning behavior.

Duplicate boundary proof remains in run-config.test.ts (explicit channel conflicts), suite-summary.test.ts (skipped and zero-execution summaries), suite-planning.test.ts (symlink output rejection), suite-artifacts.test.ts (Crabline artifact rebasing), and lab-server-capture.test.ts (capture metadata mapping). CI-only: oxfmt, diff check, and plain oxlint pass; no tests or coverage run. Shard remains below the requested 35 percent reduction because distinct lifecycle, routing, and custody proof remains.
Share self-check and suite admission/drain proof across the same HTTP lifecycle, retaining both modes and concurrent suite admission. Share abort fixtures and command-path dispatch. Keep planner semantics in run-config tests and malformed summary validation in suite-summary and Telegram runtime tests.

CI-only: oxfmt, diff check and plain oxlint pass; no tests or coverage run. Cumulative shard LOC is 5177 to 4244. The 35 percent target remains unmet; unique custody, atomic publication, credential and shutdown cases remain.
@clawsweeper

clawsweeper Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete enabled auto-merge (squash) October 24, 2026 15:31
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T15:46:00.068990Z 072aecd New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added the channel: discord Channel integration: discord label Oct 24, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 293bb45115

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 74 to 76
}

it("keeps package schema support metadata aligned", () => {
expect(packageJson.openclaw.schemaVersions).toEqual(supportedVersions);
});

it("keeps restart discovery off the caller thread and observes changed retained-deletion facts", async () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Retain the package/runtime schema-version contract test

Removing this test drops the independent check that the actual package.json.openclaw.schemaVersions matches the runtime schema constants. The remaining preflight tests use supportedVersions, and the node-update tests generate their manifests from those same constants (src/node-host/auto-update.test-support.ts), so neither detects a forgotten package-metadata update after a schema bump. That mismatch matters: assertNodeRuntimeSchemaVersions rejects it in src/node-host/auto-update-compatibility.ts:35–42, deferring otherwise compatible node updates. Retain this inexpensive package contract, or move it to a dedicated package-level suite rather than deleting it.

Useful? React with 👍 / 👎.

@steipete
steipete disabled auto-merge October 24, 2026 15:36
@steipete
steipete enabled auto-merge (squash) October 24, 2026 15:43
@steipete
steipete disabled auto-merge October 24, 2026 15:49
@steipete

Copy link
Copy Markdown
Contributor Author

Follow-up CI repair: the settlement test now expects the current exact exec-tool metadata, including replaySafe: false (commit bd3396ee2633). The previous expectation omitted that field; exact equality remains intact. Formatting, plain oxlint, diff-check, and a fresh scoped P0–P2 review pass. No local tests or typechecks ran. Fresh hosted CI owns runtime proof.

@steipete
steipete enabled auto-merge (squash) October 24, 2026 15:52
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 Oct 24, 2026
@clawsweeper

clawsweeper Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR consolidates fixtures and removes repeated tests across Gateway, agents, plugins, and state storage.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Hosted tests support the consolidation, but two independent contracts need restoration.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR changes tests and shrinking baselines only; runtime media proof is not required.
Patch quality 🦐 gold shrimp (3/6) 2 actionable review findings remain.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
Reason: The maintainer-directed cleanup reduces repeated maintenance work, subject to preserving distinct contract coverage.

Merge readiness

⛔ Needs changes before merge - 4 items remain

Keep open: this maintainer-directed cleanup is useful, but two deletions remove independent regression contracts.

Priority: P3
Reviewed head: bd3396ee2633ec10eb9cbc5e1b136acf7f43523e

Before merge

  • Retain the independent package schema-version contract (P2) - Deleting the real package.json comparison leaves manifest drift undetected. Both supportedVersions and the node-update candidate fixtures derive their values from runtime constants, so they still pass if a schema constant changes without the corresponding package metadata update. assertNodeRuntimeSchemaVersions then rejects the published candidate. Restore this inexpensive guard here or move it to a package-contract suite, as the existing review comment also requests.
  • Preserve permissive-to-strict web-fetch cache isolation coverage (P2) - The reduction deletes the cases that fetch http://198.18.0.153/file or an IPv6 ULA target with an explicit opt-in, then require a strict caller to reject the same cached URL. fetch-guard.ssrf.test.ts cannot replace this contract: web-fetch.ts returns cache hits before reaching that guard. The retained hostname-allowlist case would also pass if cache identity preserved hostnameAllowlist but omitted the range opt-ins. Keep a focused regression covering permissive cache population followed by strict rejection.
  • Explain or restore the original intent of Package schema support metadata - a89f01a: Published schema metadata protects updater compatibility, with an independent package/constants drift guard.
  • Explain or restore the original intent of Web-fetch network-policy cache isolation - d77f79c: The prior consolidation retained strict rejection after permissive-policy cache population; network-owner tests do not exercise that cache.

Findings

  • [P2] Retain the independent package schema-version contract — src/state/openclaw-database-preflight.test.ts:76
  • [P2] Preserve permissive-to-strict web-fetch cache isolation coverage — src/agents/tools/web-tools.fetch.test.ts:632-636

Provenance

  • Package schema support metadata changes intended behavior without addressing why it exists (a89f01a: Published schema metadata protects updater compatibility, with an independent package/constants drift guard.)
  • Web-fetch network-policy cache isolation changes intended behavior without addressing why it exists (d77f79c: The prior consolidation retained strict rejection after permissive-policy cache population; network-owner tests do not exercise that cache.)
Agent review details

How this fits together

Vitest fixtures exercise Gateway, agent, plugin, and storage owners, then compare their outputs and persisted effects against contract assertions.

flowchart TD
A[Vitest fixtures] --> B[Gateway and agent owners]
A --> C[Plugin and storage owners]
B --> D[Contract assertions]
C --> D
D --> E[CI results]
Loading

Technical review

Best possible solution:

Keep the consolidations and restore the package metadata guard and a permissive-to-strict cache-policy regression.

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

The pinned diff and retained suites establish the coverage losses directly; no target code or tests were executed during this review.

Is this the best way to solve the issue?

Consolidating fixtures and duplicate owner tests is appropriate, provided independent package metadata and cache-policy contracts remain covered.

Full review comments:

  • [P2] Retain the independent package schema-version contract — src/state/openclaw-database-preflight.test.ts:76
    Deleting the real package.json comparison leaves manifest drift undetected. Both supportedVersions and the node-update candidate fixtures derive their values from runtime constants, so they still pass if a schema constant changes without the corresponding package metadata update. assertNodeRuntimeSchemaVersions then rejects the published candidate. Restore this inexpensive guard here or move it to a package-contract suite, as the existing review comment also requests.
    Confidence: 0.99
    Late finding: first raised on code an earlier review cycle already covered.
  • [P2] Preserve permissive-to-strict web-fetch cache isolation coverage — src/agents/tools/web-tools.fetch.test.ts:632-636
    The reduction deletes the cases that fetch http://198.18.0.153/file or an IPv6 ULA target with an explicit opt-in, then require a strict caller to reject the same cached URL. fetch-guard.ssrf.test.ts cannot replace this contract: web-fetch.ts returns cache hits before reaching that guard. The retained hostname-allowlist case would also pass if cache identity preserved hostnameAllowlist but omitted the range opt-ins. Keep a focused regression covering permissive cache population followed by strict rejection.
    Confidence: 0.93
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is incorrect
Overall confidence: 0.95

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 9c491b3d2094.

Provenance checked

  • Gateway transcript event consolidation keeps the original intent (fix: keep shared web and TUI chats synchronized #115066: Shared web and TUI sessions require ordered durable events, replay suppression, and reconnect history; the retained combined socket scenario preserves those contracts.)
  • Agent session and embedded-attempt fixtures keeps the original intent (8fe652f: Native resource-loader fixtures and owner-level lifecycle tests support consolidation while retaining cancellation, persistence, and admission cases.)
  • Codex tool middleware keeps the original intent (d569803: The bridge lives inside the Codex extension; its dedicated runtime-contract suite retains adjusted arguments and middleware-before-after-hook ordering.)
  • Plugin discovery and schema validation keeps the original intent (300695c: Existing owner suites retain schema-content invalidation, discovery concurrency and probe limits, and native sibling-generation behavior.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test src/state/openclaw-database-preflight.test.ts src/agents/tools/web-tools.fetch.test.ts --maxWorkers=1
  • pnpm check:test-types
  • git diff --check
  • Current-head PR CI

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 12bba71 adds src/state/openclaw-database-preflight.test.ts:50 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 12bba710ede8; files: src/state/openclaw-database-preflight.test.ts)

PR surface

Tests -4497, Other -3. Total -4500 across 32 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 30 3758 8255 -4497
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 0 3 -3
Total 32 3758 8258 -4500

Review metrics

Metric Value Why it matters
Production versus test LOC Production +0/-0; tests +3,758/-8,255, net -4,497. Fixture consolidation reduces maintenance cost without production growth, but independent contracts must survive the reduction.

Labels

Label changes:

  • add P3: This is test maintenance with no introduced runtime behavior change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: This is test maintenance with no introduced runtime behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 24, 2026, 12:09 PM ET / 16:09 UTC.

@steipete
steipete merged commit 31cc9ae into main Oct 24, 2026
128 checks passed
@steipete
steipete deleted the tcr/land-d476-1792855370 branch October 24, 2026 16:19
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 25, 2026
…enclaw#182687)

* test(gateway): deslop r0041 tests

Consolidate transcript event fixtures and collectors, media request and cleanup setup, and config hash boundary proof.

The subscribed-operator test retains appended-message persistence proof; the committed-turn web/TUI test retains reconnect history proof. Spawn and route fields share the same real transcript projection. Runtime revision proof also rejects the internal config digest.

CI-only: plain oxlint, oxfmt, and diff-check pass. Static expanded cases 117 to 113; test lines 4758 to 4472. Keep distinct auth, lifecycle, recovery, ownership, and ordering paths; 35 percent is not safely attainable in this shard.

* test(gateway): remove redundant r0041 coverage layers

Keep socket-specific auth, presence, profile parity, ordered delivery and hidden-message dispatch. Remove replayed invalidation, sequence, global routing, marker and display-cap cases already covered by server-session-events.test.ts and its marker-queue support, chat-display-projection.test.ts, and server.sessions.list-changed.test.ts. Move shared spawn/goal snapshot checks into the retained transcript event case.

Viewer normalization and replace/clear behavior remain in server-methods/sessions-viewers.test.ts and server.auth.presence-modes.test.ts. Profile identity/name detail remains in sessions-history-http.test.ts and chat-display-projection.test.ts; this suite retains same-clock avatar parity for WebSocket, history and message-get.

Media download, promotion, visibility and cross-agent cleanup remain in managed-image-actions.e2e.test.ts, chat-reply-media.large-video.test.ts, managed-image-record-store.test.ts, managed-image-attachments.sqlite-visibility.test.ts and managed-outgoing-gc-availability.test.ts. Config copy-fallback variants remain in io.write-config.test.ts and io.write-reread.test.ts.

CI-only static gates: oxfmt, plain oxlint and diff-check. No test, coverage or build runs. Total shard lines 4758 to 3579; preserve remaining distinct boundaries rather than force the 35 percent target.

* test(gateway): consolidate remaining r0041 fixtures

Use deterministic scope-owned socket disposal, consolidate subscription and worker metadata assertions, and remove a duplicate delivery-position assertion covered by the retained collector order check.

Share config write-invalidate-read seeding and combine equivalent global-media cleanup fixtures while retaining both explicit and legacy ownership cases. Keep all 91 expanded cases from the prior shard revision.

CI-only: oxfmt, plain oxlint, and diff-check pass; no test, coverage, or build commands run. This pass reduces 3579 to 3463 lines; cumulative reduction is 27.2 percent, short of the requested 35 percent.

* test(state): deslop r0043 tests

Remove creation-witness copies of clean restart refusal, malformed native receipt, and warm-turn admission tests. Identical behavior remains in openclaw-agent-execution.schema-admission.test.ts.

Reuse the existing dangling Workshop index fixture in preflight and ownership tests, retaining both admission and ownership-race assertions. CI-only validation: oxfmt, diff check, and plain oxlint.

* test(state): consolidate r0043 boundary proof and fixtures

Keep migration rollback proof in openclaw-state-db-schema-version.test.ts (publishes migration-owned content markers through rollback and authorizer checks); retain sibling snapshot publication and dropped-table checks in schema-policy.

Consolidate peer revocation into the raced-publication case, WAL inspection into its refusal case, and read-only ownership into maintenance fencing. Remove internal call-shape and duplicate state assertions; reuse typed fixtures and source admission builders. Preserve the remaining distinct authority and durability interleavings.

CI-only validation: oxfmt, git diff --check, and plain oxlint passed. No tests or coverage executed. Original shard 5253 lines to 4885; 35 percent target remains unmet.

* test(state): remove redundant r0043 validation layers

Consolidate schema refresh, reader adoption, and additive repair in one retained-reader flow. Consolidate shared-store warm/cold row removal with the archive/no-host-SQL proof; higher-level purge wrapper coverage remains in preserves a survivor handle first opened during cleanup.

Remove preflight replays covered by sqlite-schema-contract.test.ts (accepts a compatible future additive column only when enabled; preserves index issue order when a missing index is allowlisted), memory-schema.test.ts (uses the compound chunk index after opening a database and readmitting it), and openclaw-agent-db.test.ts (repairs every missing or drifted canonical agent-state named index). Remove copied metadata/inventory assertions.

CI-only checks: oxfmt, git diff --check, plain oxlint passed. No tests or coverage run. Original shard 5253 lines to 4778; 35 percent target remains unmet without discarding distinct behavior.

* test(agents): deslop r0044 tests

Consolidate queued commit-order proof into confirms identical queued messages only after their own transcript commits, and listener removal into the ordinary listener snapshot case. Keep persistence-before-publication assertions at each queued commit.

Move context invalidation proof into recovers through the overflow limit with context invalidated before every retry. First-overflow success remains covered by strips stale thinking signatures before continuing after auto-compaction. Remove only the successful caller-owner duplicate; explicit caller overflow recovery remains covered.

Reuse local stream fixtures, retain same-run next-turn message identity, and trim repeated frozen graph checks; FIFO remains covered by commits user and custom messages in FIFO order. Preserve distinct authority, custody, cancellation, durability and context traversal cases.

CI-only campaign: plain oxlint, oxfmt and diff checks passed. No tests, coverage, builds or Testbox commands run. Honest reduction is below target because remaining cases protect distinct boundaries.

* test(agents): consolidate r0044 boundary fixtures

Share high-usage and summary-policy scenarios while retaining each success, failure, cancellation and terminal branch. Manual short-history compaction remains covered by caps extension summaries before persistence and manual return. Unobserved extension delivery remains covered by observes live handler registration and awaits handlers inside write settlement.

Remove JSON normalization replays covered by src/config/sessions/transcript-json.test.ts: retains ordinary shared JSON and unchanged frozen containers, copies changed frozen containers without changing the source, and matches native JSON bytes. Keep async capture and serialization integration assertions.

Remove duplicate FIFO and host-write checks covered by session-manager-async-entries.test.ts. Keep fresh-message and stale-keyed-replay admission checks. Drop repeated context matrix payloads covered by dedicated pairing and checkpoint cases and session-manager-model-context-limits.test.ts.

Remove repeated sender/timestamp rendering assertions covered by attempt.llm-boundary.cache-stability.test.ts and attempt.llm-boundary.test.ts while retaining steering admission timestamps and persisted/runtime content ownership. Preserve compaction item correlation, aborted accounting, stale authority and durable recovery boundaries.

CI-only: plain oxlint, oxfmt and diff checks pass; no tests, builds or coverage run. Combined shard reduction remains below the requested 35 percent; no further safe duplicate layer was identified.

* test(agents): share r0044 lifecycle scenario fixtures

Use one context-mutation setup for the existing nine admitted and unadmitted cases. Preserve independent expected context, exact admission typing, and append/rewrite/delete/branch/compaction/reset/cross-session behaviors.

Share pending-input staging, out-of-turn rejection assertions, and abortable queued-run startup. Reuse the canonical zero-usage fixture and trim unused summary fixture text.

Plain oxlint, formatting and diff checks pass. CI-only: no tests, builds or coverage were run. No cases or production files removed in this round. The shard still cannot meet the 35 percent target without removing distinct boundary proof identified in the retained cases.

* test(codex): deslop r0046 tests

Remove the middleware-ordering replay covered by openclaw-owned-tool-runtime-contract.test.ts: wraps dynamic tools with hooks and runs result middleware before the after hook. Consolidate result-only bridge fixtures and repeated diagnostic/requester context.

Keep auth-bridge and side-question unchanged: remaining cases exercise distinct credential authority, policy, and lifecycle boundaries. Static lint/format/diff gates only; tests and coverage deferred to hosted CI per campaign instructions.

* test(codex): consolidate r0046 owner coverage

Keep side-question flow checks while removing repeated config and context inventories. Native-hook-relay disabled config, turn-params timezone, side-question.model-selection reasoning, config network proxy, and plugin-thread-config ask-policy tests retain their owner contracts. Fold disabled-relay flow into the ephemeral fork case.

Consolidate auth fallback and workspace-rejection setup without deleting branch cases. Remove dynamic MCP delegation, disabled-catalog, async replay, and Decision cancellation replays covered by dynamic-tools.gateway-policy, run-attempt-tools, event-projector.dynamic-tools, generic per-call cancellation, and src/decisions/runtime tests.

CI-only campaign: plain oxlint, oxfmt, and diff-check passed. No tests or coverage run. Original shard 5290 lines to 4895; the 35 percent target remains unmet because remaining distinct authority, lifecycle, and schema behavior has no demonstrated replacement.

* test(codex): remove redundant r0046 layers and fixtures

Replace repeated scoped and persisted auth setup with a typed fixture. Reuse screenshot/schema fixtures and remove mocked Decision and memory-reply replays covered by openclaw-tools.decision and tool-terminal-outcome owner tests.

Drop side-question copies of model selection covered by run-attempt and thread-lifecycle binding tests, domain enforcement covered by dynamic-tool-build.web-search and web-tools.fetch, and disconnect coverage held by ephemeral-turn plus retained side cleanup cases. Remove nonexistent registerSideQuestionForkTests registration; standalone side-question.fork.test.ts owns those cases.

No test runs per CI-only instructions. Plain oxlint, oxfmt, and diff-check pass. Original shard 5290 lines to 4548; remaining unique credential, lifecycle, and schema cases prevent a justified 35 percent cut.

* test(discord): deslop r0047 tests

Remove duplicate guild authorization/arguments and direct-status layers covered by native-command.commands-allowfrom.test.ts and native-command.status-direct.test.ts. Keep bot-owned thread admission and schema coverage in message-handler.preflight-owned-threads.test.ts.

The authoritative runtime verification table retains default-runtime dispatch assertions. Reuse local session, notice, delivery, binding, and route fixtures while preserving distinct ownership and lifecycle cases.

CI-only validation: plain oxlint, oxfmt, and diff check. No tests or coverage run. Known baseline issue: native-command.plugin-dispatch.test.ts imports missing native-command.test-support.js.

* test(discord): reduce r0047 branch and fixture duplication

Consolidate hidden model dispatch outcomes and presence retry branches. Remove self-proving plugin command-name wrapper and redundant helper-call assertions, while preserving model scope, component-document admission, and post-unbind echo proof.

Remaining concurrency owner proof: extensions/discord/src/monitor.test.ts durable handler handoff and subsequent concurrent events, plus internal/client.test.ts listener-slot lifetime. Embed text fallback remains in message-text.test.ts and threading.starter.test.ts; retained mention cases cover the same preflight decision branches.

CI-only: oxfmt, plain oxlint, and diff-check pass. No tests or coverage run. Original shard 4437 lines to 3806; 35 percent target remains unmet because further identified cuts lose distinct authority or lifecycle behavior.

* test(discord): consolidate r0047 fixture and outcome proof

Fold code-point label truncation into the native picker identity round-trip; remove the duplicate renderer case. Share picker invocation, attachment, binding, PluralKit, and batch fixtures. Centralize monitor cleanup and remove redundant implementation counts while preserving visible outcomes and ordering.

Preserve all distinct admission, runtime identity, and lifecycle cases. CI-only static gates: oxfmt, plain oxlint, and diff-check pass; no tests or coverage run. Original shard 4437 lines to 3701 (16.6 percent); the 35 percent target remains unmet under the distinct-behavior retention constraint.

* test(agents): deslop r0045 tests

Share image, session-send and web-fetch fixtures while retaining all 173 statically expanded cases. Keep distinct authorization, sandbox, incarnation, delivery and cancellation paths; this shard is already largely branch-consolidated.

CI-only validation: oxfmt, plain oxlint and diff checks. Runtime tests and coverage intentionally deferred. Baseline image support exports are missing and require coordinator follow-up.

* test(agents): consolidate r0045 owner-boundary coverage

Remove stale mock machinery, ineffective probes, copied schema inventories and sibling-covered helper replays. Keep image reasoning at image-tool.response, compression facts at model generation/static-catalog and clawrouter-native-model-facts, spawn capability schemas at openclaw-tools session-context/thread-binding, and fetch JSON/guard behavior at the existing extraction and network owner suites.

Retain distinct resolver-absent delivery, visible-producer capacity, incarnation, sandbox, cancellation and cache-policy boundaries. Consolidate repeated request/error fixtures and preserve zero/default timeout registration assertions.

CI-only: oxfmt, plain oxlint and diff checks passed; no tests or coverage run. Cumulative line reduction remains below 35 percent because distinct boundary proof is retained.

* test(agents): consolidate r0045 fixtures and boundary assertions

Share auth, RPC, cancellation and no-reply fixtures while retaining distinct safety branches. Remove repeated wiring and schema inventories. Keep real image loading and scoped auth isolation.

Duplicate owner proof remains in web-fetch.provider-fallback.test.ts (preserves wrappers in a char budget; unread-error fallback cleanup), sessions-resolution.test.ts (failed custom-key lookup), sessions-access.test.ts (transient tree visibility), subagent-spawn.production-boundary.test.ts (managed worktrees), acp-spawn.test.ts (resume and lineage), and provider-runtime.test.ts (owner failover).

CI-only: no tests or coverage run. Plain oxlint, oxfmt and diff-check passed. Shard LOC 4888 -> 3235 (33.8%); below the 35% target because remaining cases guard distinct auth, sandbox, lifecycle and cancellation paths.

* test(plugins): deslop r0048 tests

Share repeated schema, provider request, credential, registry and Doctor fixtures while preserving distinct cases and assertions. Keep module interop unchanged: its loader formats, captured generations, resolver conditions and lifecycle paths are independent contracts. CI-only shard; no test or coverage runs.

* test(plugins): remove redundant r0048 test layers

Discovery concurrency, probe caps and context precedence remain covered by provider-self-hosted-discovery.test.ts. Doctor artifact selection remains covered by doctor-contract-artifact.test.ts. Keep warning-only candidate isolation in the normalizer table and combine full/touched collector fixtures.

Module generation keeps scoped assets and distinct interop paths; sibling-assets tests cover unscoped nested installs, and selected-dependency promotion plus first-demand generation tests cover captured dependency bytes. Retain exact generation provider assertions in config-refresh/workspace cases. Schema tests share source fixtures, consolidate required diagnostics, and drop repeated default applications; reverse dependency convergence remains covered by json-schema-defaults.test.ts.

CI-only: plain oxlint, oxfmt and diff checks pass. No tests or coverage run. Cumulative shard reduction is 5487 to 4740 lines, below the 35 percent target; remaining unique behavior is preserved.

* test(plugins): consolidate remaining r0048 fixture duplication

Keep historical authored endpoints in the deferred trusted-owner row and per-account inheritance in legacy-webhook-listener-migration tests. Remove internal loader/cache inventories and duplicate physical-manifest lookup proof already exercised by real provider/hook source rejection cases. Fold catalog field priority into the mixed catalog test.

Share tuple fixtures and remove unused schema cache-key labels. Keep the unique unserializable-schema error path; content-key invalidation remains covered by schema-validator.manifest.test.ts immutable and mutable schema cases. Preserve all remaining source-default, authority, generation and lifecycle boundaries.

CI-only: formatting, plain oxlint and diff checks passed; no tests or coverage run. This additional 198-line reduction brings the original 5487-line shard to 4542 lines. The 35 percent target remains unmet.

* test(agents): deslop r0049 tests

Remove lifecycle cases duplicated in lane-controller.lifecycle.test.ts and rate-limit cases retained in attempt-recovery.per-day-rate-limit.test.ts. Keep the cron output-limit route while removing redundant budget variants.

Reuse the existing SQL observation helper and local transcript setup; retain authority, persistence, cancellation, and ordering cases. Terminal receipt merging remains covered by terminal-preparation.run-stats.test.ts.

CI-only validation: plain oxlint, oxfmt, and diff check. Runtime tests and coverage intentionally deferred. Reduction is below the requested target because remaining cases protect distinct lifecycle and durability behavior.

* test(agents): prune r0049 duplicate owner proof

Drop actor append ordering replay covered by session-manager-async-message.test.ts (lets another session write between actor appends while retaining manager order), retaining replaced-writer rejection in the persisted tool-result acknowledgement test.

Drop unchanged capture replay covered by session-actor-message-rewrite.test.ts (commits prompt capture and its carrier together) and attempt-prompt-submit.projections.test.ts serialized-prefix cases. Drop terminal-error settlement replay covered by session-tool-result-guard.transcript-events.test.ts (keeps one original terminal error without splitting text, tool facts, or usage).

Consolidate output-limit continuation and progress assertions, delegate cap policy to failover-retry-controller.test.ts, and remove execution wiring snapshots while retaining generation, compaction, cancellation, and settlement boundary proofs.

CI-only: plain oxlint, oxfmt, and diff check passed; no tests or coverage run. Remains below the requested line target because the remaining initial-writer, permission, proposal, and image-note cases have distinct authority or durability behavior.

* test(agents): consolidate r0049 lifecycle fixtures

Separate pre-install admission refusals from real compaction races. Share image-note scope, publication, and canonical transcript assertions while retaining dirty-tail replay, nonempty replacement preservation, commit-loss handling, and cleanup on failed assertions.

Consolidate repeated recovery error/timeout fixtures and remove same-branch retry combinations covered by retained parked-work, failed-batch, idle-timeout, and rate-limit cases. Reuse writer claim and seed helpers without changing authority ordering.

CI-only static validation: plain oxlint, oxfmt, and diff check passed. No tests or coverage run. All distinct authority/durability cases retained; cumulative line reduction remains below 35 percent.

* test(qa-lab): consolidate r0050 assertion layers

Keep lifecycle and evidence-custody cases while removing internal launch dumps, repeated catalog inventories, and duplicate planner and artifact assertions. Reduce profile and capture fixtures to their owning behavior.

Duplicate boundary proof remains in run-config.test.ts (explicit channel conflicts), suite-summary.test.ts (skipped and zero-execution summaries), suite-planning.test.ts (symlink output rejection), suite-artifacts.test.ts (Crabline artifact rebasing), and lab-server-capture.test.ts (capture metadata mapping). CI-only: oxfmt, diff check, and plain oxlint pass; no tests or coverage run. Shard remains below the requested 35 percent reduction because distinct lifecycle, routing, and custody proof remains.

* test(qa-lab): consolidate r0050 lifecycle and routing fixtures

Share self-check and suite admission/drain proof across the same HTTP lifecycle, retaining both modes and concurrent suite admission. Share abort fixtures and command-path dispatch. Keep planner semantics in run-config tests and malformed summary validation in suite-summary and Telegram runtime tests.

CI-only: oxfmt, diff check and plain oxlint pass; no tests or coverage run. Cumulative shard LOC is 5177 to 4244. The 35 percent target remains unmet; unique custody, atomic publication, credential and shutdown cases remain.

* test: repair d476 replay fixtures and shrink stale baselines

* test: retain replay safety in settlement expectation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: discord Channel integration: discord extensions: codex extensions: qa-lab gateway Gateway runtime 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