Skip to content

test(core,plugins): remove low-value tests (batch d050) - #169092

Merged
steipete merged 11 commits into
mainfrom
tcr/land-d050-1791716064
Oct 11, 2026
Merged

steipete merged 11 commits into
mainfrom
tcr/land-d050-1791716064

Conversation

@steipete

Copy link
Copy Markdown
Contributor

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 with pnpm 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, targeted oxfmt, plain oxlint -c .oxlintrc.json, and git diff --check: passed.
  • Blacksmith Testbox 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> on tbx_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.
  • AWS fallback cbx_c26b64e3bb3f, run run_52e27d9ff1b5f30f35019fa052d3722d: reconstructed the final candidate from the pinned public base plus this exact patch; verified tree e3b4a4db35a85f08138309f4f372ec01541068e6. Node 24.19.0. The three restored suites passed: 68 tests, 60.21s across two Vitest shards.
  • The same AWS run executed CI=1 node --import tsx scripts/check-deadcode-exports.mts on clean detached 30469f450063ebd23e6a731fcc95019a785d28ed and d1618ccd0b276f985711ff297b1b87a77bdad35d. 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.
  • Independent review: three accepted P2 coverage findings, resolved by retaining all three original files; follow-up review returned scoped-clean. No rejected findings.
  • Infrastructure: the initial focused attempt stopped at an invalid commit-ID prerequisite before any tests (the wrapper uses a carrier commit); rerun verified the tree and passed. Final-head Testbox tbx_01m4nb2vvthdw732x4kj1xwshx remained 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.

Shard Declarations before → after Test/support LOC + / - Covered statements; branches
x1161 187 → 134 +194 / -1322 5,807 → 5,796; branches 3,294 → 3,288 (later successful artifact)
x1163 205 → 145 +37 / -1452 12,412 → 12,385; branches 8,078 → 8,060
x1155 198 → 114 +43 / -2632 3,355 → 3,355; branches 2,267 → 2,266
x1157 119 → 101 +69 / -455 6,072 → 6,068; branches 3,689 → 3,684
x1170 179 → 149 +84 / -926 12,866 → 12,866; branches 6,158 → 6,157
x1167 163 → 106 +62 / -1601 7,981 → 7,981; branches 5,351 → 5,350
x1171 181 → 98 +71 / -1399 4,713 → 4,713; branches 3,578 → 3,577
x1169 203 → 148 +342 / -1800 3,172 → 3,172; branches 2,511 → 2,508
x1168 217 → 151 +212 / -1995 5,501 → 5,500; branches 4,962 → 4,958
x1166 215 → 141 +167 / -2694 2,136 → 2,136; branches 1,637 → 1,636

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, and src/gateway/worker-environments/bundle.test.ts were 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.ts
  • src/infra/gateway-suspend-coordinator.handoff.test.ts
  • src/infra/gateway-suspend-coordinator.test.ts
  • src/infra/gateway-watch-tmux.test.ts
  • src/infra/git-commit.test.ts
  • src/infra/git-exec.test.ts
  • src/infra/git-network-retry.test.ts
  • src/infra/git-read-cache.test.ts
  • src/infra/git-root.test.ts
  • src/infra/github-issue.test.ts
  • src/infra/heartbeat-active-hours.test.ts
  • src/infra/heartbeat-cooldown.test.ts
  • src/infra/heartbeat-visibility.test.ts
x1163 — final touched files
  • src/config/sessions/archive-compression.test.ts
  • src/config/sessions/artifacts.test.ts
  • src/config/sessions/combined-store-gateway.worker.test.ts
  • src/config/sessions/context-token-provenance.test.ts
  • src/config/sessions/conversation-delivery-store.test.ts
  • src/config/sessions/conversation-identity.test.ts
  • src/config/sessions/conversation-registry.test.ts
  • src/config/sessions/delivery-info.test.ts
  • src/config/sessions/entry-freshness.test.ts
  • src/config/sessions/goals.test.ts
  • src/config/sessions/group.test.ts
  • src/config/sessions/reset-policy.test.ts
  • src/config/sessions/session-accessor.pending-inputs.test.ts
  • src/config/sessions/session-accessor.sqlite-active-events.test.ts
  • src/config/sessions/session-accessor.sqlite-branches.test.ts
x1155 — final touched files
  • config/max-lines-baseline.txt
  • src/commands/doctor-retired-models.test.ts
  • src/commands/doctor-retired-phone-control.test.ts
  • src/commands/doctor-security.test.ts
  • src/commands/doctor-session-delivery-state.test.ts
  • src/commands/doctor-session-snapshots.test.ts
  • src/commands/doctor-session-sqlite-readers.test.ts
  • src/commands/doctor-session-state-providers.test.ts
  • src/commands/doctor-session-transcript-headers.test.ts
  • src/commands/doctor-session-transcript-health.memory-fixture.test-support.ts
  • src/commands/doctor-session-transcript-health.memory.test-support.ts
  • src/commands/doctor-session-transcript-labels.test.ts
  • src/commands/doctor-skills.test.ts
  • src/commands/doctor-sqlite-maintenance-lock.test.ts
  • src/commands/doctor-stale-runtime-build.test.ts
  • src/commands/doctor-state-migrations.test.ts
  • src/commands/doctor-state-sqlite-compact.test.ts
x1157 — final touched files
  • src/gateway/worker-environments/bootstrap.test.ts
  • src/gateway/worker-environments/desktop-tunnel.test.ts
  • src/gateway/worker-environments/device-placement-demand.test.ts
  • src/gateway/worker-environments/device-provider.test.ts
  • src/gateway/worker-environments/live-chat.test.ts
  • src/gateway/worker-environments/local-workspace-template.test.ts
  • src/gateway/worker-environments/node-bootstrap-artifact.test.ts
  • src/gateway/worker-environments/node-enrollment.test.ts
x1170 — final touched files
  • extensions/bonjour/src/advertiser.test.ts
  • extensions/lmstudio/index.test.ts
  • extensions/workboard/browser/pages/workboard/workboard-page.test.ts
  • src/acp/control-plane/runtime-options.test.ts
  • src/agents/runtime/proxy.test.ts
  • src/auto-reply/reply/queue/drain.client-caps.test.ts
  • src/auto-reply/reply/queue/state.test.ts
  • src/commands/gateway-status/helpers.test.ts
  • src/shared/text/reasoning-tags.test.ts
  • src/shared/text/text-projection.test.ts
  • ui/src/pages/device/device-pages.test.ts
x1167 — final touched files
  • src/infra/outbound/message-action-gateway-reconciliation.test.ts
  • src/infra/outbound/message-action-gateway.test.ts
  • src/infra/outbound/message-action-normalization.test.ts
  • src/infra/outbound/message-action-runner.plugin-dispatch.test.ts
  • src/infra/outbound/message.test.ts
  • src/infra/outbound/outbound-audit.test.ts
  • src/infra/outbound/outbound-policy.test.ts
  • src/infra/outbound/outbound-session.test.ts
  • src/infra/outbound/reply-policy.test.ts
  • src/infra/outbound/runtime-visible-channels.test.ts
  • src/infra/outbound/sanitize-text.test.ts
  • src/infra/outbound/session-context.test.ts
  • src/infra/outbound/source-delivery-plan.test.ts
x1171 — final touched files
  • src/cron/command-output-summary.test.ts
  • src/cron/config-revision.test.ts
  • src/cron/cron-delivery-outcomes.e2e.test.ts
  • src/cron/cron-execution-diagnostics.e2e.test.ts
  • src/cron/delivery-target-validation.test.ts
  • src/cron/delivery.test.ts
  • src/cron/job-session-bindings.test.ts
  • src/cron/maintenance-lifecycle.test.ts
  • src/cron/parse.test.ts
  • src/cron/retry-hint.test.ts
  • src/cron/run-diagnostics.test.ts
  • src/cron/runtime-authority.test.ts
  • src/cron/schedule.test.ts
x1169 — final touched files
  • src/commands/sessions-lifecycle.test.ts
  • src/commands/setup.test.ts
  • src/commands/startup-config-preflight.recovery.test.ts
  • src/commands/status-overview-rows.test.ts
  • src/commands/status-runtime-shared.test.ts
  • src/commands/status.scan.shared.test.ts
  • src/commands/status.scan.test.ts
  • src/commands/status.service-summary.test.ts
  • src/commands/system-agent-with-inference.test.ts
  • src/commands/triage-prompt.test.ts
  • src/commands/triage-recovery.test.ts
  • src/commands/triage-update.test.ts
  • src/commands/triage.test.ts
  • src/commands/uninstall.test.ts
x1168 — final touched files
  • packages/ai/src/transports/anthropic-compaction-replay.test.ts
  • packages/ai/src/transports/anthropic-payload-policy.test.ts
  • packages/ai/src/transports/openai-completions-dsml.recovery.test.ts
  • packages/ai/src/transports/openai-completions-dsml.test.ts
  • packages/ai/src/transports/openai-completions-replay.google-signatures.test.ts
  • packages/ai/src/transports/openai-completions-replay.test.ts
  • packages/ai/src/transports/openai-responses-compaction-replay.test.ts
  • packages/ai/src/transports/openai-responses-prompt-observer.test.ts
  • packages/ai/src/transports/openai-responses-retained-compaction-replay.test.ts
  • packages/ai/src/transports/openai-responses-service-tier.test.ts
  • packages/ai/src/transports/openai-responses-steering.integration.test.ts
  • packages/ai/src/transports/openai-responses-steering.test.ts
  • packages/ai/src/transports/openai-responses-stream-terminal-tools.test.ts
  • packages/ai/src/transports/openai-responses-transport.response-hook.test.ts
  • packages/ai/src/transports/openai-responses-websocket-client.test.ts
  • packages/ai/src/transports/openai-responses-websocket.test.ts
x1166 — final touched files
  • config/max-lines-baseline.txt
  • src/auto-reply/reply/commands-name.test.ts
  • src/auto-reply/reply/commands-plugin.test.ts
  • src/auto-reply/reply/commands-private-route.test.ts
  • src/auto-reply/reply/commands-reset-hooks.test.ts
  • src/auto-reply/reply/commands-session-restart.test.ts
  • src/auto-reply/reply/commands-session-store.test.ts
  • src/auto-reply/reply/commands-session-usage.test.ts
  • src/auto-reply/reply/commands-slash-parse.test.ts
  • src/auto-reply/reply/commands-status.test.ts
  • src/auto-reply/reply/commands-steer.test.ts
  • src/auto-reply/reply/commands-subagents-routing.test.ts
  • src/auto-reply/reply/commands-subagents.test.ts
  • src/auto-reply/reply/commands-system-prompt.test.ts
  • src/auto-reply/reply/commands-tts.test.ts
  • src/auto-reply/reply/commands-update.test.ts
  • src/auto-reply/reply/completion-delivery-policy.test.ts

@steipete
steipete enabled auto-merge (squash) October 11, 2026 12:19
@clawsweeper

clawsweeper Bot commented Oct 11, 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.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime commands Command implementations agents Agent runtime and tooling extensions: lmstudio plugin: bonjour Plugin integration: bonjour plugin: workboard size: XL labels Oct 11, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 11, 2026
@clawsweeper

clawsweeper Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR consolidates tests and removes redundant cases, unused test helpers, and obsolete file-length allowances.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful maintenance, but two independent regression protections remain deleted despite the previous review.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored test cleanup changes no shipped behavior; the inspected historical Daybreak screenshots are context rather than proof of the test reductions.
Patch quality 🦪 silver shellfish (2/6) 2 actionable review findings remain.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Redundant tests increase maintenance and CI work.
Reason: The maintainer-directed cleanup has clear maintenance value once distinct regression contracts are retained.

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
Reviewed head: 2b8e8f691f0cedc214951d7c9289fade04a73763

Before merge

  • Retain the SSE recovery no-replay regressions (P2) - This previously reported finding remains: the diff deletes the SSE cases for text/tool output followed by a service-tier rejection, output embedded in a failed response, and a provider-shaped observer exception. These exercise createResponsesStreamWithRecovery's outputObserved and sourceError guards and assert only one physical provider request. The retained after-output WebSocket case exercises a separate recovery owner, so removing an SSE guard could buy another request without failing that test. Restore these cases or consolidate them within the SSE fixture while retaining the one-request assertions.
  • Preserve the streaming JSONL decoding and EOF regression (P2) - This previously reported finding remains: deleting the legacy-reader block removes the fixture that splits a four-byte UTF-8 character across the 64 KiB read boundary, spans a record across chunks, and ends with a valid record without a newline. It checks both createTranscriptEventReader and countTranscriptEventsForPath. The retained SQLite-statistics case never exercises this scanner, and the memory fixture writes newline-terminated records. Dropping the scanner's final fragments could therefore lose an imported record without this explicit regression failing. Restore the focused fixture.
  • Explain or restore the original intent of Responses SSE no-replay coverage - cc030e6: The original tier-recovery repair explicitly prevented replay after output or provider-shaped observer failures; the cleanup does not identify equivalent remaining SSE coverage.
  • Explain or restore the original intent of Streaming JSONL decoding and EOF coverage - baa7581: The scanner optimization added independent decoding and EOF-flush assertions for import and count-only APIs; retained SQLite-statistics coverage does not replace them.

Findings

  • [P2] Retain the SSE recovery no-replay regressions — packages/ai/src/transports/openai-responses-service-tier.test.ts:155-157
  • [P2] Preserve the streaming JSONL decoding and EOF regression — src/commands/doctor-session-sqlite-readers.test.ts:68-69

Provenance

  • Responses SSE no-replay coverage changes intended behavior without addressing why it exists (cc030e6: The original tier-recovery repair explicitly prevented replay after output or provider-shaped observer failures; the cleanup does not identify equivalent remaining SSE coverage.)
  • Streaming JSONL decoding and EOF coverage changes intended behavior without addressing why it exists (baa7581: The scanner optimization added independent decoding and EOF-flush assertions for import and count-only APIs; retained SQLite-statistics coverage does not replace them.)
Agent review details

How this fits together

Test 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
Loading

Technical review

Best 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:

  • [P2] Retain the SSE recovery no-replay regressions — packages/ai/src/transports/openai-responses-service-tier.test.ts:155-157
    This previously reported finding remains: the diff deletes the SSE cases for text/tool output followed by a service-tier rejection, output embedded in a failed response, and a provider-shaped observer exception. These exercise createResponsesStreamWithRecovery's outputObserved and sourceError guards and assert only one physical provider request. The retained after-output WebSocket case exercises a separate recovery owner, so removing an SSE guard could buy another request without failing that test. Restore these cases or consolidate them within the SSE fixture while retaining the one-request assertions.
    Confidence: 0.97
  • [P2] Preserve the streaming JSONL decoding and EOF regression — src/commands/doctor-session-sqlite-readers.test.ts:68-69
    This previously reported finding remains: deleting the legacy-reader block removes the fixture that splits a four-byte UTF-8 character across the 64 KiB read boundary, spans a record across chunks, and ends with a valid record without a newline. It checks both createTranscriptEventReader and countTranscriptEventsForPath. The retained SQLite-statistics case never exercises this scanner, and the memory fixture writes newline-terminated records. Dropping the scanner's final fragments could therefore lose an imported record without this explicit regression failing. Restore the focused fixture.
    Confidence: 0.96

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 3a0db8a3a052.

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test packages/ai/src/transports/openai-responses-service-tier.test.ts src/commands/doctor-session-sqlite-readers.test.ts --maxWorkers=1
  • git diff --check

What I checked:

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

Metric Value Why it matters
Production versus test LOC Production +0/-0; tests and test support +1,292/-16,287. The cleanup avoids production churn, but the reduction must preserve independent behavioral contracts.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Two deletions remove independent paid-request and transcript-import regression protection without establishing an urgent runtime incident.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🌊 off-meta tidepool and patch quality is 🦪 silver shellfish.
  • 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 need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-11T12:28:44.547Z sha ef3b81df51fbd8c64fce1d129b02e1ebb1df8f56 :: needs changes before merge. :: [P2] [P2] Retain the SSE recovery no-replay regressions | [P2] [P2] Preserve the streaming JSONL decoding and EOF regression

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.
@steipete
steipete force-pushed the tcr/land-d050-1791716064 branch from ef3b81d to 2b8e8f6 Compare October 11, 2026 12:33
@steipete
steipete merged commit ce34a0f into main Oct 11, 2026
124 checks passed
@steipete
steipete deleted the tcr/land-d050-1791716064 branch October 11, 2026 12:45
DasX added a commit to DasX/openclaw that referenced this pull request Oct 11, 2026
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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 12, 2026
)

* 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
RomneyDa pushed a commit that referenced this pull request Oct 14, 2026
)

* 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.
scribe-dandelion-cult added a commit to karmaterminal/openclaw that referenced this pull request Oct 19, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui commands Command implementations extensions: lmstudio gateway Gateway runtime P2 Normal backlog priority with limited blast radius. plugin: bonjour Plugin integration: bonjour plugin: workboard rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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