Repository navigation
test(core,plugins): remove low-value tests (batch d050) - #169092
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: needs changes before merge. What this changesThis PR consolidates tests and removes redundant cases, unused test helpers, and obsolete file-length allowances. Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 4 items remain Keep open: this maintainer-directed cleanup has value, but both previously reported deletions of independent regression coverage remain on the current head. Priority: P2 Before merge
Findings
Provenance
Agent review detailsHow this fits togetherTest fixtures exercise provider transports, session storage, Doctor, commands, worker environments, plugins, and UI components, then assert their observable results. flowchart TD
A[Test fixtures] --> B[Vitest suites]
B --> C[Provider transport owners]
B --> D[Doctor and session owners]
B --> E[Command and plugin owners]
C --> F[Behavioral assertions]
D --> F
E --> F
Technical reviewBest possible solution: Keep the useful consolidations while restoring the independent SSE no-replay cases and the streaming JSONL decoding/EOF fixture. Do we have a high-confidence way to reproduce the issue? The two coverage losses are directly verifiable in the pinned introduction diff and production owners; no runtime reproduction was attempted. Is this the best way to solve the issue? Consolidation is appropriate, but successful retained suites do not establish redundancy when deleted cases protect separate recovery guards or input formats. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3a0db8a3a052. TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfacePR surface statistics unavailable: the file list is incomplete. Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 11, 2026, 8:41 AM ET / 12:41 UTC (Revision 2). |
Port a5378249d76e259c63b6762afdbcccfa8d8820cb onto the campaign lane, preserving the newer cross-realm Uint8Array check and full-text capped chat assertions. Validation: small-delta origin/main proof checkout on Blacksmith Testbox; all 10 files and 181 tests passed with no skips. oxlint, oxfmt --check, git diff --check, and independent autoreview passed.
ef3b81d to
2b8e8f6
Compare
Integrate origin/main 49d2a93 (185 commits after 6e06137) so the PR is tested against current main. Only two test files conflicted. Main's low-value test cleanup (openclaw#169092, openclaw#169218) removed the base cases next to which this branch had added its fallback-policy cases. Keep main's removals and keep the new cases in place: queue/state.test.ts keeps the four queued fallback consent cases, model-overrides.test.ts keeps the policy-only pending-switch case. No production file conflicted; run-entry.ts, attempt-recovery.ts and the database-worker path list merged cleanly with independent hunks.
) * test(infra): deslop x1161 tests * test(config): deslop x1163 tests * test(commands): deslop x1155 tests * test(gateway): deslop x1157 tests Port a5378249d76e259c63b6762afdbcccfa8d8820cb onto the campaign lane, preserving the newer cross-realm Uint8Array check and full-text capped chat assertions. Validation: small-delta origin/main proof checkout on Blacksmith Testbox; all 10 files and 181 tests passed with no skips. oxlint, oxfmt --check, git diff --check, and independent autoreview passed. * test(bonjour): deslop x1170 tests * test(infra): deslop x1167 tests * test(cron): deslop x1171 tests * test(commands): deslop x1169 tests * test(ai): deslop x1168 tests * test(config): deslop x1166 tests * test: retain boundary coverage in batch d050
) * fix(context): context budget falls back to 200k for bundled provider models in cold sessions * fix(context): context budget falls back to 200k for bundled provider models in cold sessions * fix(context): context budget falls back to 200k for bundled provider models in cold sessions * fix(context): preserve discovered context provenance * fix(memory-flush): keep server compaction threshold resolution synchronous * fix(context): keep authored config windows non-sticky on ownership ties * fix(context): drop the test-only parallel budget resolver The exported flush window resolver was reachable only from its own tests, so the bundled cold-budget fallback could regress in production while the suite stayed green. Remove the helper and cover the bundled catalog windows through runMemoryFlushIfNeeded, the actual maintenance boundary that feeds resolveMemoryFlushPlan. * fix(sessions): context window shows 200k for plugin-discovered models Embedded runs labeled every run-level context window as legacy resolved, which cold session projections intentionally distrust, so sessions list and /context fell back to the 200k default when synchronous catalog lookup could not see the model. Carry the resolution source from run preparation and persist model- or config-resolved windows as resolved-v1; the generic default keeps the legacy marker. * fix(sessions): clarify context provenance comment * fix(agents): let accepted discovery replace synthetic context fallback Related: #156635 * test(agents): cast override fixture config through unknown * fix(github-copilot): keep a missing /models native window synthetic When Copilot /models omits or reports an invalid max_context_window_tokens, the mapper filled in the 128k default as if it were a reported native ceiling. With a real max_prompt_tokens present, that fabricated window became authoritative and could both clamp the prompt limit and grant replacement authority over the synthetic fallback. Mark that default with the same contextWindowSource: "synthetic" provenance used by the unknown-model branch, never let the estimate sit below a real prompt limit, and thread the marker through the provider result copy, persisted catalog schema, model registry and config merge. Authored contextWindow/contextTokens clear the marker. Supersession now requires a reported limit: a real prompt limit, or a non-synthetic native window. A genuinely reported 128k window is unchanged. Reported-by: snotty <[email protected]> * fix(sessions): recover synthetic 128k session capacity from its admitted owner An existing session whose persisted telemetry came from the synthetic 128k fallback stayed at 128k after discovery until a later run, because the projector trusted it as runtime telemetry and took min(persisted, resolved). - Embedded runs stamp contextTokensSource: "synthetic" when the prepared budget is exactly a provider unknown-model estimate (no reported prompt limit, authored cap, modelsConfig sizing or narrower caller budget), including failed/cancelled attempt metadata. - Synthetic rows are never trusted telemetry, including locked sessions. - /status and session_status bind the displayed session to its admitted prepared owner (agent + spawned workspace) before choosing capacity. A synthetic row takes that owner's accepted capacity (or an authored cap). An unbound, retired, failed or model-less owner settles as owner-scoped unavailable and renders unknown, never the stale estimate or another owner's process-global cache value. - Genuine (non-synthetic) persisted 128k stays conservative. * test(proof): add redacted patched-Gateway capture for #156636 Adds a human-run procedure and script that capture /status and session_status context lines from a patched scratch Gateway for a fresh session, existing-session recovery and an account switch. Output is redacted (tokens, IPs, phone numbers, emails, private endpoints, paths, account/session ids) and the script never starts a Gateway, writes config or reads credentials. --self-test exercises the redaction rules. * fix(sessions): keep authored context windows out of resolved-v1 Authored models config windows and caller budget caps are removable operator config. Persisting them as resolved-v1 let cold session projection keep publishing a cap after the operator removed it. * fix(sessions): keep selectable context windows out of resolved-v1 A model that declares context-window options sizes its budget from the session's window selection (or the declared default). The cold session reader matches resolved-v1 rows only by provider, model, and harness, so a persisted 200k selection could outlive a later switch to 1m, and the reverse. Keep those budgets on the legacy resolved marker. * test(agents): move context provenance cases to a sibling e2e file embedded-agent-runner.e2e.test.ts is over the line cap, and the line-cap ratchet rejects any growth there. The provenance cases only need the fast-run mocks, so they live in their own e2e file. * fix(status): correct stale context limits after model discovery * test(copilot): use current context cache fixture owner * refactor(copilot): keep context contracts within owner size limits * test(agents): consolidate context provenance coverage * fix: preserve declared provider catalog context windows * fix: separate configured context constraints from runtime capacity * test: diagnose native catalog admission failures * fix: resolve context budgets from current model catalog authority * test: account for context capacity through the published catalog owner * fix(copilot): finish catalog publication caller cutover * fix(context): apply configured budgets across native runtimes * fix(agents): preserve synthetic context provenance in run metadata * fix(context): qualify persisted capacity by runtime and account * test: update media fixture context budget mocks * test(cron): remove duplicate selection coverage * fix(status): project context from current session owners * test(sessions): distinguish unavailable native capacity * fix(agents): preserve authored caps and compaction provenance * fix(status): use discovered capacity for current session reports Keep status, context reports, session listings, and Gateway defaults bound to current model metadata and verified session budgets. Do not clamp admitted display facts to a stale process cache or invent a default denominator when capacity is unknown. Preserve the original discovery/status fix by @snotty while dropping the independent Copilot accounting stack. Co-authored-by: snotty <[email protected]> * fix(sessions): borrow published local gateway capacity Consume the active local Gateway catalog without starting discovery, and resolve automatic runtime selection before matching a verified saved budget. Keep API capability fallback separate from native capacity and include that choice in the Gateway row memo. * test(context): use local model capacity fixtures Keep generic context-report fixtures on the OpenClaw runtime so they do not borrow API metadata for an implicitly selected native harness. * fix(status): preserve runtime choices and scoped report ownership Keep additional Gateway runtime capacities in CLI catalog conversion. Resolve summary defaults only through an available agent owner, and keep namespaced transcript model IDs bound to their current provider catalog. Update neighboring regression fixtures to supply admitted metadata or expect unknown capacity. * fix(sessions): preserve spawned workspace capacity ownership * test(context): cover captured reporting cache isolation * test(context): retain contributor cache-isolation coverage Co-authored-by: Mike <[email protected]> * fix(sessions): retain offline listing when Gateway inspection fails --------- Co-authored-by: zhang-guiping <[email protected]> Co-authored-by: Yigtwxx <[email protected]> Co-authored-by: saju01 <[email protected]> Co-authored-by: Dallin Romney <[email protected]> Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: snotty <[email protected]> Co-authored-by: Mike <[email protected]> (cherry picked from commit 8eefd33) Backport notes (release/2026.10.5): - src/agents/context-resolution.ts: conflict only in the configured-token early returns, which main had collapsed (ea1e27e, #168770 refactor). Kept the branch's two equivalent early returns and took main's allowCacheLookup-gated provider cache lookups unchanged. - src/auto-reply/reply/commands-status.test.ts: main deleted three /status cases in ce34a0f (#169092) before this PR landed, so the PR never updated them. They still exist on this branch and asserted the stale behavior this fix removes. Updated them to the PR's contract, the same way the PR updated src/auto-reply/status.test.ts: unknown capacity renders "?" instead of the 200k default, a provider-local slash transcript model binds to its admitted catalog entry, and an unresolved active fallback no longer reuses the caller's live contextTokens.
First-parent upstream 5ed6a30..cb1b6cd (21 commits, including openclaw#168999 state query reduction and worker moves, openclaw#169075, af03aa0 ACP owner settlement, openclaw#168837 plugin metadata/reload ownership, openclaw#168776, openclaw#168951, openclaw#169039 runtime-only server builds, openclaw#169092 test batch d050, openclaw#168860 memory index publication writes into workers, openclaw#168991 session read lifetimes and reconciliation scheduling, openclaw#169091 tool/replay prompt prefixes, openclaw#168762 Solid chat leaf elements, openclaw#168941). Conflicts: - test/vitest/vitest.unit-fast-paths.mjs: upstream stopped forcing the two ACP translator files into the fast lane; kept that and our reply-turn-admission module-identity entry. - worker-access inventory: regenerated (634 files, 2429 calls). openclaw-state-worker-contract.ts auto-merged: upstream's GitHub publication-source operations next to our continuation custody operations. Refs #1475 Co-Authored-By: Claude Opus 5.5 <[email protected]>
What Problem This Solves
Removes redundant test variants, implementation-mirroring checks, and obsolete test-only helpers from ten audited campaign shards.
User Impact
No production behavior changes. Retains distinct regression, authority, lifecycle, and transport contracts while reducing test maintenance and execution work. No runtime production files change.
Why This Change Was Made
Replays the ten d050 commits in their original order onto main at
30469f450063ebd23e6a731fcc95019a785d28ed. All ten applied; none skipped. A follow-up commit drops the reductions in three files after independent review. This is deletion/consolidation of low-value coverage, not assertion weakening or added skips. Historical shard coverage measurements below are campaign evidence, not a claim that coverage was remeasured after replay.Conflict resolutions:
config/max-lines-baseline.txt: remove the obsolete doctor-state-migrations allowance, preserve main's doctor/repair-sequencing allowance; recomputed withpnpm check:max-lines-ratchet --prune. The later commit also removes the obsolete commands-status allowance.src/gateway/worker-environments/node-bootstrap-artifact.test.ts: apply only the two intended redundant-case deletions; preserve main's current code and its removal of the old retained-entry mutation case.ui/src/pages/device/device-pages.test.ts: delete the redundant permission-order/status case, preserve main's current platform, native-experience, cookie-domain and permission recovery coverage instead of replaying outdated hunks.Production LOC: +0 / -0. Test files: +1,281 / -16,090; deleted test-support helpers: +0 / -186. Baseline: +0 / -2. Total: +1,281 / -16,278 (net -14,997).
No paths match the current CODEOWNERS rules.
Evidence
pnpm install --frozen-lockfile --prefer-offline, targetedoxfmt, plainoxlint -c .oxlintrc.json, andgit diff --check: passed.tbx_01m4n9x1cehf3qj6ht0y57nct1:CI=1 pnpm test <all 136 replay-touched test files>passed (8m52.6s command time, including runtime build). This covers every file in the final narrowed diff. The existing platform skip was retained; no skips were added.OPENCLAW_TESTBOX=1 node scripts/check-changed.mjs -- <replay-changed paths>ontbx_01m4nafx6xd99qp0psvp56he03: ratchets, boundary checks, core test types and extension test types passed; stopped at the inherited dead-export scan after 26m33s. Later lint stages were not reached.cbx_c26b64e3bb3f, runrun_52e27d9ff1b5f30f35019fa052d3722d: reconstructed the final candidate from the pinned public base plus this exact patch; verified treee3b4a4db35a85f08138309f4f372ec01541068e6. Node 24.19.0. The three restored suites passed: 68 tests, 60.21s across two Vitest shards.CI=1 node --import tsx scripts/check-deadcode-exports.mtson clean detached30469f450063ebd23e6a731fcc95019a785d28edandd1618ccd0b276f985711ff297b1b87a77bdad35d. Both failed (exit 1). The original base reproduces the exact unused-export list from the changed check; the newer main fails the same step with newer UI migration leftovers. None of those export names is added or removed by this diff. No baseline suppression or product fix is included here.tbx_01m4nb2vvthdw732x4kj1xwshxremained queued and was stopped. AWS bulk sync was interrupted after slow transfer; the supported no-sync standalone script used fresh independent checkouts and exact tree verification. One pre-dispatch broker timeout cleared after a successful health check. All owned leases are stopped before handoff.Shard measurements
Declaration counts below are recomputed from the final touched test files against the pinned main base; coverage is the original in-shard covered totals (statements, then branches). Shard-wide historical counts can differ because untouched files and newer main are excluded here. LOC includes test support where applicable.
The x1161 summary predates its successful after-coverage run; its later artifact reports all three groups successful (Testbox
tbx_01m4n1y8aveyx5kjmrhnw4wf18). Comparing covered baseline items yields the totals above. The historical x1157 coverage covered only supported groups; the source commit separately records its 10-file, 181-test replay proof. All coverage losses remain below 1%; these measurements do not replace current-head tests.Independent review raised three accepted P2 findings. The reductions in
src/infra/outbound/outbound-send-service.test.ts,src/gateway/worker-environments/inference-store.test.ts, andsrc/gateway/worker-environments/bundle.test.tswere dropped entirely: each file is byte-identical to the pinned main base. This retains requester-identity media authorization, close/reopen inference recovery, and unknown-cache-entry preservation. The follow-up review is clean; no findings were rejected.x1161 — final touched files
src/infra/gateway-supervision.test.tssrc/infra/gateway-suspend-coordinator.handoff.test.tssrc/infra/gateway-suspend-coordinator.test.tssrc/infra/gateway-watch-tmux.test.tssrc/infra/git-commit.test.tssrc/infra/git-exec.test.tssrc/infra/git-network-retry.test.tssrc/infra/git-read-cache.test.tssrc/infra/git-root.test.tssrc/infra/github-issue.test.tssrc/infra/heartbeat-active-hours.test.tssrc/infra/heartbeat-cooldown.test.tssrc/infra/heartbeat-visibility.test.tsx1163 — final touched files
src/config/sessions/archive-compression.test.tssrc/config/sessions/artifacts.test.tssrc/config/sessions/combined-store-gateway.worker.test.tssrc/config/sessions/context-token-provenance.test.tssrc/config/sessions/conversation-delivery-store.test.tssrc/config/sessions/conversation-identity.test.tssrc/config/sessions/conversation-registry.test.tssrc/config/sessions/delivery-info.test.tssrc/config/sessions/entry-freshness.test.tssrc/config/sessions/goals.test.tssrc/config/sessions/group.test.tssrc/config/sessions/reset-policy.test.tssrc/config/sessions/session-accessor.pending-inputs.test.tssrc/config/sessions/session-accessor.sqlite-active-events.test.tssrc/config/sessions/session-accessor.sqlite-branches.test.tsx1155 — final touched files
config/max-lines-baseline.txtsrc/commands/doctor-retired-models.test.tssrc/commands/doctor-retired-phone-control.test.tssrc/commands/doctor-security.test.tssrc/commands/doctor-session-delivery-state.test.tssrc/commands/doctor-session-snapshots.test.tssrc/commands/doctor-session-sqlite-readers.test.tssrc/commands/doctor-session-state-providers.test.tssrc/commands/doctor-session-transcript-headers.test.tssrc/commands/doctor-session-transcript-health.memory-fixture.test-support.tssrc/commands/doctor-session-transcript-health.memory.test-support.tssrc/commands/doctor-session-transcript-labels.test.tssrc/commands/doctor-skills.test.tssrc/commands/doctor-sqlite-maintenance-lock.test.tssrc/commands/doctor-stale-runtime-build.test.tssrc/commands/doctor-state-migrations.test.tssrc/commands/doctor-state-sqlite-compact.test.tsx1157 — final touched files
src/gateway/worker-environments/bootstrap.test.tssrc/gateway/worker-environments/desktop-tunnel.test.tssrc/gateway/worker-environments/device-placement-demand.test.tssrc/gateway/worker-environments/device-provider.test.tssrc/gateway/worker-environments/live-chat.test.tssrc/gateway/worker-environments/local-workspace-template.test.tssrc/gateway/worker-environments/node-bootstrap-artifact.test.tssrc/gateway/worker-environments/node-enrollment.test.tsx1170 — final touched files
extensions/bonjour/src/advertiser.test.tsextensions/lmstudio/index.test.tsextensions/workboard/browser/pages/workboard/workboard-page.test.tssrc/acp/control-plane/runtime-options.test.tssrc/agents/runtime/proxy.test.tssrc/auto-reply/reply/queue/drain.client-caps.test.tssrc/auto-reply/reply/queue/state.test.tssrc/commands/gateway-status/helpers.test.tssrc/shared/text/reasoning-tags.test.tssrc/shared/text/text-projection.test.tsui/src/pages/device/device-pages.test.tsx1167 — final touched files
src/infra/outbound/message-action-gateway-reconciliation.test.tssrc/infra/outbound/message-action-gateway.test.tssrc/infra/outbound/message-action-normalization.test.tssrc/infra/outbound/message-action-runner.plugin-dispatch.test.tssrc/infra/outbound/message.test.tssrc/infra/outbound/outbound-audit.test.tssrc/infra/outbound/outbound-policy.test.tssrc/infra/outbound/outbound-session.test.tssrc/infra/outbound/reply-policy.test.tssrc/infra/outbound/runtime-visible-channels.test.tssrc/infra/outbound/sanitize-text.test.tssrc/infra/outbound/session-context.test.tssrc/infra/outbound/source-delivery-plan.test.tsx1171 — final touched files
src/cron/command-output-summary.test.tssrc/cron/config-revision.test.tssrc/cron/cron-delivery-outcomes.e2e.test.tssrc/cron/cron-execution-diagnostics.e2e.test.tssrc/cron/delivery-target-validation.test.tssrc/cron/delivery.test.tssrc/cron/job-session-bindings.test.tssrc/cron/maintenance-lifecycle.test.tssrc/cron/parse.test.tssrc/cron/retry-hint.test.tssrc/cron/run-diagnostics.test.tssrc/cron/runtime-authority.test.tssrc/cron/schedule.test.tsx1169 — final touched files
src/commands/sessions-lifecycle.test.tssrc/commands/setup.test.tssrc/commands/startup-config-preflight.recovery.test.tssrc/commands/status-overview-rows.test.tssrc/commands/status-runtime-shared.test.tssrc/commands/status.scan.shared.test.tssrc/commands/status.scan.test.tssrc/commands/status.service-summary.test.tssrc/commands/system-agent-with-inference.test.tssrc/commands/triage-prompt.test.tssrc/commands/triage-recovery.test.tssrc/commands/triage-update.test.tssrc/commands/triage.test.tssrc/commands/uninstall.test.tsx1168 — final touched files
packages/ai/src/transports/anthropic-compaction-replay.test.tspackages/ai/src/transports/anthropic-payload-policy.test.tspackages/ai/src/transports/openai-completions-dsml.recovery.test.tspackages/ai/src/transports/openai-completions-dsml.test.tspackages/ai/src/transports/openai-completions-replay.google-signatures.test.tspackages/ai/src/transports/openai-completions-replay.test.tspackages/ai/src/transports/openai-responses-compaction-replay.test.tspackages/ai/src/transports/openai-responses-prompt-observer.test.tspackages/ai/src/transports/openai-responses-retained-compaction-replay.test.tspackages/ai/src/transports/openai-responses-service-tier.test.tspackages/ai/src/transports/openai-responses-steering.integration.test.tspackages/ai/src/transports/openai-responses-steering.test.tspackages/ai/src/transports/openai-responses-stream-terminal-tools.test.tspackages/ai/src/transports/openai-responses-transport.response-hook.test.tspackages/ai/src/transports/openai-responses-websocket-client.test.tspackages/ai/src/transports/openai-responses-websocket.test.tsx1166 — final touched files
config/max-lines-baseline.txtsrc/auto-reply/reply/commands-name.test.tssrc/auto-reply/reply/commands-plugin.test.tssrc/auto-reply/reply/commands-private-route.test.tssrc/auto-reply/reply/commands-reset-hooks.test.tssrc/auto-reply/reply/commands-session-restart.test.tssrc/auto-reply/reply/commands-session-store.test.tssrc/auto-reply/reply/commands-session-usage.test.tssrc/auto-reply/reply/commands-slash-parse.test.tssrc/auto-reply/reply/commands-status.test.tssrc/auto-reply/reply/commands-steer.test.tssrc/auto-reply/reply/commands-subagents-routing.test.tssrc/auto-reply/reply/commands-subagents.test.tssrc/auto-reply/reply/commands-system-prompt.test.tssrc/auto-reply/reply/commands-tts.test.tssrc/auto-reply/reply/commands-update.test.tssrc/auto-reply/reply/completion-delivery-policy.test.ts