Skip to content

test(agents,config,codex): remove low-value tests (batch d084) - #160308

Merged
steipete merged 12 commits into
mainfrom
tcr/land-d084-1790582035
Sep 28, 2026
Merged

steipete merged 12 commits into
mainfrom
tcr/land-d084-1790582035

Conversation

@steipete

@steipete steipete commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

This maintainer-authorized test-audit batch removes repetitive test matrices, duplicate replays, and unused fixtures from config, agent, managed-worktree, and Codex plugin tests.

User Impact

No production source or user-visible behavior changes. Distinct privacy, configuration, authority, lifecycle, and recovery contracts remain covered.

Why This Change Was Made

Replay all ten d084 campaign commits onto current main, consolidate equivalent scenarios, remove dead test support, and shrink three max-lines entries plus four obsolete test-routing entries. No whole commit was skipped.

Preserve main's entire source-reply-suppression test file where the campaign depended on a conflicting prerequisite assertion repair, and preserve node-skills config validation because no equivalent keeper was found. The Codex context-engine conflict keeps main's new shared fixture and history-tail, prefix-exclusion, and size-bound assertions. The final rebase includes #160349, which routes the unrelated hot-reload fixture through its correct database-worker owner.

Independent review retained ten specific protections: commentary opt-out through terminal flush, post-hook MCP diagnostics, independent redaction metadata, explicit tool-history inclusion, setup-script opt-out, exact retained-source identity, destructive-policy schema validation, browser network/bind isolation, restored Doctor hash, and pruning opt-out. Other findings were rejected only after locating concrete owner tests or checking the actual protocol/fixture contract. The repair also removes an unused test-only helper and an unnecessary default reported by hosted CI.

Final split: production +0/-0; tests +7,387/-23,927 (net -16,540); test support +97/-258 (net -161); baseline/routing +0/-7. Overall -16,708 LOC. Direct test declarations 1,264 → 822 (-442); table rows and helper-registered cases are not expanded.

No changed path matches current CODEOWNERS rules. The operator-approved campaign workflow uses exact-head squash auto-merge with hosted CI as the merge gate.

Evidence

  • Pre-rebase Blacksmith proof: 80 files / 1,107 tests passed, with source SHA-256 verification. Run.
  • Final affected-file validation and focused repair rerun: 12 files / 208 distinct tests passed. This includes main's hot-reload routing fix, restored checkpoint/MCP contracts, canonical session-history assertions, worktree setup/custody, and config policy/rollback cases. A restored rollback row initially had the compacted missing-file expectation; it was corrected to assert the original file and its Doctor hash, and the rerun passed. Testbox run.
  • node_modules/.bin/oxfmt --write <changed paths>, git diff --check, and plain node_modules/.bin/oxlint -c .oxlintrc.json <changed TS/JS paths> passed. The final staged repair delta received a clean P0–P2 autoreview after the complete PR review and finding-by-finding owner-test verification.
  • OPENCLAW_TESTBOX=1 node scripts/check-changed.mjs -- <102 changed paths> passed its preceding guards and reached the core TypeScript graph boundary, then failed on ui-other: 721 test roots exceeds 720. The same exact node --import ./scripts/tsx.mjs scripts/check-tsgo-core-boundary.mts command failed identically, exit 1, in a freshly installed clean detached checkout of plain main 6dd3011e9f56118d09aa562ee49d7fbcd75e99bc on the same Testbox. The diff has no UI files or TypeScript graph guard/config changes. Typecheck and later checks were not reached by this changed-file invocation; hosted CI remains the merge gate.
  • Earlier changed-file/post-rebase attempts were stopped during slow cold source preparation, before remote checks. The final attempts used the campaign mirror pool and reached real validation; the baseline failure above is recorded as pre-existing, not green.
  • All task-owned Testbox leases are stopped. Original per-shard coverage evidence below remains explicitly historical; combined current-main coverage was not remeasured.
Review findings rejected after checking stronger existing evidence

The protocol literal is accepted by the actual notification JSON type; retained native-app tests take the same forced-disabled policy path. Passive settlement timeout remains covered in run-attempt.turn-watches.test.ts; untagged terminal suppression remains in the message lifecycle tests; both approval activity projections remain in the retained tools test. Completion-disabled resume is enforced at the Gateway owner, active-owner protection is exercised through real GC CLI/service tests, and hostile agent IDs are covered at the canonical validator plus the surviving integration gate. The removed wait/delete assertion was implemented by its mock, while real registry wait-to-cleanup wiring remains covered. Direct and runtime same-byte rollback fencing share the exact captured-identity closure and retain owner-level mutation tests. Ten substantive boundary findings were addressed, including narrower metadata/positive-option gaps where the broader claim was already covered.

Per-shard files, final LOC and declaration deltas, and original coverage

Counts below describe the final replay against 6dd3011e9f56. Coverage quotes are historical in-shard measurements; combined current-main coverage was not remeasured. Static declarations count outermost TypeScript it/test calls without expanding table rows or helper registrations.

Shard Test LOC delta Test declarations
t0065 -74 4 → 4 (+0)
t0032 -3,153 239 → 146 (-93)
t0060 -752 109 → 81 (-28)
t0061 -577 109 → 100 (-9)
t0051 -687 63 → 51 (-12)
t0062 -647 56 → 35 (-21)
t0049 -3,016 180 → 114 (-66)
t0054 -2,321 193 → 138 (-55)
t0034 -3,683 162 → 91 (-71)
t0057 -1,630 149 → 62 (-87)

t0065 — f59bd86b6fd6

  • Coverage: statements 2864 → 2864; branches 1654 → 1654; functions 502 → 502. No per-file drops or excluded groups.

Final touched files:

  • src/config/io.write-reread.test.ts

t0032 — d4e8f7a232f8

  • Coverage: statements 8,027 → 7,995 (−0.40%); branches 6,485 → 6,431 (−0.83%); functions 1,325 → 1,323. Both groups included; no file lost more than five statements.

Final touched files:

  • src/agents/embedded-agent-subscribe.compaction-test-helpers.ts
  • src/agents/embedded-agent-subscribe.handlers.compaction.test.ts
  • src/agents/embedded-agent-subscribe.handlers.lifecycle.test.ts
  • src/agents/embedded-agent-subscribe.handlers.messages.lifecycle.test.ts
  • src/agents/embedded-agent-subscribe.handlers.messages.test-helpers.ts
  • src/agents/embedded-agent-subscribe.handlers.messages.update-commentary.test.ts
  • src/agents/embedded-agent-subscribe.handlers.messages.update-source.test.ts
  • src/agents/embedded-agent-subscribe.handlers.messages.update-stream-items.test.ts
  • src/agents/embedded-agent-subscribe.handlers.messages.update-stream-phases.test.ts
  • src/agents/embedded-agent-subscribe.handlers.tools.media.test.ts
  • src/agents/embedded-agent-subscribe.handlers.tools.progress.test-support.ts
  • src/agents/embedded-agent-subscribe.handlers.tools.test.ts
  • src/agents/embedded-agent-subscribe.lifecycle-billing-error.test.ts

t0060 — 91a68d5edc05

  • Coverage: statements 2903 → 2896 (−7); branches 1606 → 1599 (−7); functions 498 → 498. Both losses below 1%; no file lost more than four statements.

Final touched files:

  • src/agents/worktrees/service.acceleration.test.ts
  • src/agents/worktrees/service.canonical-paths.test.ts
  • src/agents/worktrees/service.capacity.test.ts
  • src/agents/worktrees/service.configured-root.test.ts
  • src/agents/worktrees/service.diagnostics.test.ts
  • src/agents/worktrees/service.gc-cli.test.ts
  • src/agents/worktrees/service.gc.test.ts
  • src/agents/worktrees/service.hooks.test.ts

t0061 — 957ed218a13c

covered statements 2723 -> 2724 (+1)
branches 1456 -> 1456 (0)
functions 445 -> 445 (0)

Final touched files:

  • src/agents/worktrees/service.input-files.test.ts
  • src/agents/worktrees/service.naming.test.ts
  • src/agents/worktrees/service.orphans.test.ts
  • src/agents/worktrees/service.profiles.test.ts
  • src/agents/worktrees/service.provisioned.test.ts
  • src/agents/worktrees/service.removal-recovery.test.ts
  • src/agents/worktrees/service.removal-recovery.windows.test.ts
  • src/agents/worktrees/service.removal-safety.test.ts
  • src/agents/worktrees/service.remove-lease.test.ts
  • src/agents/worktrees/service.restore-source.test.ts
  • src/agents/worktrees/service.retire-snapshot.test.ts
  • test/vitest/vitest.database-worker-core-paths.mjs
  • Shared shrink-only maintenance: test/vitest/vitest.database-worker-core-paths.mjs.

t0051 — 725db433315c

covered statements 9695 -> 9667 (-28);
branches 7333 -> 7289 (-44);
functions 1833 -> 1823 (-10)

Final touched files:

  • config/max-lines-baseline.txt
  • extensions/codex/src/app-server/run-attempt.activation.test.ts
  • extensions/codex/src/app-server/run-attempt.agent-end-context.test.ts
  • extensions/codex/src/app-server/run-attempt.auth-context.test.ts
  • extensions/codex/src/app-server/run-attempt.bounded-continuity.test.ts
  • extensions/codex/src/app-server/run-attempt.channel-tool-progress.test.ts
  • extensions/codex/src/app-server/run-attempt.checkpoint.test.ts
  • extensions/codex/src/app-server/run-attempt.compaction-closeout.test.ts
  • extensions/codex/src/app-server/run-attempt.computer-use.test.ts
  • extensions/codex/src/app-server/run-attempt.configured-mcp-authority.test.ts
  • extensions/codex/src/app-server/run-attempt.configured-mcp.test-support.ts
  • extensions/codex/src/app-server/run-attempt.configured-mcp.test.ts
  • extensions/codex/src/app-server/run-attempt.context-engine-overflow.test.ts
  • extensions/codex/src/app-server/run-attempt.context-engine.test.ts
  • extensions/codex/src/app-server/run-attempt-test-harness.ts
  • Shared shrink-only maintenance: config/max-lines-baseline.txt.

t0062 — 4035b1599de3

covered statements 1993 -> 1987 (-6)
branches 1005 -> 1000 (-5)
functions 344 -> 341 (-3)

Final touched files:

  • test/vitest/vitest.database-worker-core-paths.mjs
  • src/agents/worktrees/service.run-end-cleanup.test.ts
  • src/agents/worktrees/service.snapshot-index.test.ts
  • src/agents/worktrees/service.source-only-filters.test.ts
  • src/agents/worktrees/service.sparse-isolation.test.ts
  • src/agents/worktrees/service.stale-probe.test.ts
  • src/agents/worktrees/service.submodules.test.ts
  • src/agents/worktrees/service.test.ts
  • Shared shrink-only maintenance: test/vitest/vitest.database-worker-core-paths.mjs.

t0049 — 1c43b0a61ba7

  • Coverage: statements 13,253 → 13,221 (−0.24%); branches 9,278 → 9,197 (−0.87%); functions 2,407 → 2,405. Gate passed, no excluded groups or statement drops over five per file.

Final touched files:

  • src/agents/openclaw-tools.session-status.gateway-model.test.ts
  • src/agents/openclaw-tools.session-status.model-policy.test.ts
  • src/agents/openclaw-tools.session-status.test.ts
  • src/agents/openclaw-tools.sessions-participants.test-support.ts
  • src/agents/openclaw-tools.sessions-resume.test-support.ts
  • src/agents/openclaw-tools.sessions-send-child-coordination.test.ts
  • src/agents/openclaw-tools.sessions-steering.test.ts
  • src/agents/openclaw-tools.sessions-timeout.test-support.ts
  • src/agents/openclaw-tools.sessions-visibility.test.ts
  • src/agents/openclaw-tools.sessions.test.ts
  • src/agents/openclaw-tools.subagents.scope.test.ts
  • src/agents/openclaw-tools.subagents.sessions-spawn.allowlist.test.ts
  • src/agents/openclaw-tools.subagents.sessions-spawn.lifecycle.test.ts
  • src/agents/openclaw-tools.subagents.sessions-spawn.plan.test.ts
  • src/agents/openclaw-tools.swarm.test.ts
  • src/agents/tools/sessions-history-tool.test.ts

t0054 — a6348ab102aa

covered statements 12302 -> 12209 (-93);
branches 9861 -> 9778 (-83);
functions 2360 -> 2345 (-15)

Final touched files:

  • config/max-lines-baseline.txt
  • extensions/codex/src/app-server/run-attempt.settled-finalization.test-support.ts
  • extensions/codex/src/app-server/run-attempt.steering-authority.test.ts
  • extensions/codex/src/app-server/run-attempt.steering-media.test.ts
  • extensions/codex/src/app-server/run-attempt.steering.test.ts
  • extensions/codex/src/app-server/run-attempt.test.ts
  • extensions/codex/src/app-server/run-attempt.turn-watches.test.ts
  • extensions/codex/src/app-server/run-attempt.usage-limits.test.ts
  • extensions/codex/src/app-server/run-attempt.vision-tools.test.ts
  • Shared shrink-only maintenance: config/max-lines-baseline.txt.

t0034 — 352675cb5f69

  • Coverage: statements 7,931 → 7,920 (−0.14%); branches 6,306 → 6,265 (−0.65%); functions 1,286 → 1,286. No excluded groups; largest per-file statement drop was 3.

Final touched files:

  • config/max-lines-baseline.txt
  • src/agents/embedded-agent-subscribe.subscribe-embedded-agent-session.block-reply-flushing.test.ts
  • src/agents/embedded-agent-subscribe.subscribe-embedded-agent-session.chunking-fences.test.ts
  • src/agents/embedded-agent-subscribe.subscribe-embedded-agent-session.compaction-and-tool-summaries.test.ts
  • src/agents/embedded-agent-subscribe.subscribe-embedded-agent-session.final-answer-delivery.test.ts
  • src/agents/embedded-agent-subscribe.subscribe-embedded-agent-session.final-tag-streaming.test.ts
  • src/agents/embedded-agent-subscribe.subscribe-embedded-agent-session.reasoning-delivery.test.ts
  • src/agents/embedded-agent-subscribe.subscribe-embedded-agent-session.subscribeembeddedagentsession.deferred-progress.test.ts
  • src/agents/embedded-agent-subscribe.subscribe-embedded-agent-session.subscribeembeddedagentsession.test.ts
  • src/agents/embedded-agent-subscribe.subscribe-embedded-agent-session.text-end-reconciliation.test.ts
  • src/agents/embedded-agent-subscribe.tool-result-ordering.test.ts
  • Shared shrink-only maintenance: config/max-lines-baseline.txt.

t0057 — 4fd44e8efdc0

covered statements 2736 -> 2730 (-6); branches 1668 -> 1660 (-8); functions 484 -> 481 (-3)

Final touched files:

  • src/config/config.legacy-config-detection.accepts-imessage-dmpolicy.test.ts
  • src/config/config.legacy-config-detection.rejects-routing-allowfrom.test.ts
  • src/config/config.legacy-config-provider-shapes.test.ts
  • src/config/config.meta-timestamp-coercion.test.ts
  • src/config/config.model-ref-validation.test.ts
  • src/config/config.multi-agent-agentdir-validation.test.ts
  • src/config/config.nix-integration-u3-u5-u9.test.ts
  • src/config/config.node-agent-runs.test.ts
  • src/config/config.plugin-validation.test.ts
  • src/config/config.pruning-defaults.test.ts
  • src/config/config.sandbox-docker.test.ts
  • src/config/legacy-config-detection.test-support.ts

Main’s source-reply-suppression and node-skills validation files are retained unchanged. Review repairs in the canonical sessions-history tests are attributed to t0049, and dead test-harness cleanup to t0051. Shared baseline/routing deletions total seven lines and are counted once.

@clawsweeper

clawsweeper Bot commented Sep 28, 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 docker Docker and sandbox tooling agents Agent runtime and tooling extensions: codex size: XL labels Sep 28, 2026
@steipete
steipete enabled auto-merge (squash) September 28, 2026 08:57
@steipete
steipete disabled auto-merge September 28, 2026 09:00
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 28, 2026, 7:46 AM ET / 11:46 UTC (Revision 3).

ClawSweeper review

What this changes

The branch consolidates and removes tests and test helpers for agent sessions, managed worktrees, configuration, and the Codex plugin, while shrinking related test routing and line baselines.

Merge readiness

⛔ Blocked before merge - 4 items remain

Keep open. This maintainer-authored test audit remains useful, but the reviewed head removes the only direct check that default worktree cleanup reduces 101 live checkouts to 100 while preserving manual worktrees.

Priority: P3
Reviewed head: 97db6f01ce493e2888d1a6e074191bbdc75bd08a

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The audit has substantial focused validation and a coherent test-only scope, but one meaningful default-cleanup regression check was lost.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: This maintainer-authored PR changes no production behavior or stored-data contract. The body records focused Testbox validation of the changed suites and labels broader pre-rebase results as historical; those runs do not replace the missing default-limit assertion. Data-model compatibility is not applicable.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR changes no production behavior or stored-data contract. The body records focused Testbox validation of the changed suites and labels broader pre-rebase results as historical; those runs do not replace the missing default-limit assertion. Data-model compatibility is not applicable.
Evidence reviewed 9 items Introduced coverage deletion: The introduced patch deletes the case that creates 99 manual and two run-owned worktrees, invokes default cleanup, and asserts oldest eviction with 100 live records remaining.
Existing boundary contract: The pinned base has the direct default-limit case, and current main retains it; the verified test merge removes it.
Production default: Cleanup uses a default maximum of 100 when no limits are supplied.
Findings 1 actionable finding [P2] Restore the default-limit worktree cleanup regression
Security None None.

How this fits together

OpenClaw creates managed worktrees for agent runs and later cleans them up using owner protections and a default count limit. The changed suites check those boundaries, alongside agent, config, and Codex behavior, before CI reports results.

flowchart LR
 A[Agent runs and config] --> B[Runtime owners]
 B --> C[Managed worktree cleanup]
 C --> D[Worktree boundary tests]
 B --> E[Agent and Codex tests]
 D --> F[CI results]
 E --> F
Loading

Before merge

  • Restore the default-limit worktree cleanup regression (P2) - The deleted case is the direct check that default gc() evicts the oldest run-owned checkout from 101 live records while preserving 99 manual checkouts. The surviving 101-record capacity test never calls cleanup, and the CLI case does not cross the default count boundary, so a change to default-limit selection would escape these tests. Restore a focused boundary case.
  • Complete next step (P2) - Restore a focused default-limit worktree cleanup test, run its targeted suite, and record the measured cost of the changed test.
  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.

Findings

  • [P2] Restore the default-limit worktree cleanup regression — src/agents/worktrees/service.gc.test.ts:722
Agent review details

Security

None.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

None.

Stored data model

Persistent data-model change detected: unknown-truncated-pull-files. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep the broad test pruning and restore one focused default gc() case with 99 manual and two recent run-owned records, asserting oldest eviction and 100 survivors.

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

Yes, at source level: the base and current main contain the default 101-to-100 cleanup test, while the introduced patch and verified test merge remove it. No test was executed in this read-only review.

Is this the best way to solve the issue?

No. The pruning is useful, but retaining one inexpensive service-boundary case is the narrowest way to protect the documented default cleanup behavior.

Full review comments:

  • [P2] Restore the default-limit worktree cleanup regression — src/agents/worktrees/service.gc.test.ts:722
    The deleted case is the direct check that default gc() evicts the oldest run-owned checkout from 101 live records while preserving 99 manual checkouts. The surviving 101-record capacity test never calls cleanup, and the CLI case does not cross the default count boundary, so a change to default-limit selection would escape these tests. Restore a focused boundary case.
    Confidence: 0.94

Overall correctness: patch is incorrect
Overall confidence: 0.88

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is test-maintenance cleanup with one focused coverage regression to repair before merge.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This maintainer-authored PR changes no production behavior or stored-data contract. The body records focused Testbox validation of the changed suites and labels broader pre-rebase results as historical; those runs do not replace the missing default-limit assertion. Data-model compatibility is not applicable.

Label justifications:

  • P3: This is test-maintenance cleanup with one focused coverage regression to repair before merge.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This maintainer-authored PR changes no production behavior or stored-data contract. The body records focused Testbox validation of the changed suites and labels broader pre-rebase results as historical; those runs do not replace the missing default-limit assertion. Data-model compatibility is not applicable.

Evidence

Acceptance criteria:

  • [P1] node scripts/run-vitest.mjs src/agents/worktrees/service.gc.test.ts.
  • [P1] git diff --check.

What I checked:

Likely related people:

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

Rank-up moves

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

  • Restore a focused default-limit GC case and run the targeted worktree suite.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-28T09:02:52.613Z sha d33ccee0f6cec3cdb37be1d1de3bad0dd4442bfc :: blocked before merge. :: [P2] Keep a default-limit worktree cleanup regression
  • reviewed 2026-09-28T09:35:42.348Z sha 5d29c33 :: blocked before merge. :: [P2] Keep a default-limit worktree cleanup regression

@steipete
steipete force-pushed the tcr/land-d084-1790582035 branch from d33ccee to 5d29c33 Compare September 28, 2026 09:27
@steipete
steipete enabled auto-merge (squash) September 28, 2026 09:28
@steipete
steipete disabled auto-merge September 28, 2026 09:34
Reduce the embedded subscription suite from 318 to 146 cases and 8135 to 4046 test lines. Consolidate event fixtures and retain receipt, media-trust, lifecycle, phase, and reconciliation regressions. Remove the obsolete max-lines baseline entry.

Blacksmith proof: 146 tests passed. Covered statements 7931 -> 7920; branches 6306 -> 6265; functions 1286 -> 1286. Types, dead exports, boundaries, formatting, and changed-file plain lint passed. The broad changed gate hits the pre-existing UI max-lines failure in ui/src/pages/chat/components/chat-attachments.ts (716 > 700); that file is byte-identical to the starting commit.
@steipete
steipete force-pushed the tcr/land-d084-1790582035 branch from 5d29c33 to 97db6f0 Compare September 28, 2026 11:28
@steipete
steipete enabled auto-merge (squash) September 28, 2026 11:29
@steipete
steipete disabled auto-merge September 28, 2026 11:42
@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 Sep 28, 2026
@steipete
steipete enabled auto-merge (squash) September 28, 2026 12:14
@steipete
steipete merged commit fb55609 into main Sep 28, 2026
429 of 431 checks passed
@steipete
steipete deleted the tcr/land-d084-1790582035 branch September 28, 2026 12:23
steipete added a commit that referenced this pull request Sep 28, 2026
#160308 removed src/agents/worktrees/service.run-end-cleanup.test.ts,
but the managed-worktrees-workboard-lifecycle scenario still listed it
in codeRefs, so extensions/qa-lab/src/scenario-catalog.test.ts failed
deterministically on main and on every PR touching that shard. The
remaining refs (service.ts, the Workboard dispatcher, and the e2e
product proof) still cover the scenario.
steipete added a commit that referenced this pull request Sep 28, 2026
…up tests

#160308 deleted src/agents/worktrees/service.run-end-cleanup.test.ts, which the
managed-worktrees-workboard-lifecycle scenario still listed as a codeRef, so
extensions/qa-lab/src/scenario-catalog.test.ts failed on main. The surviving
run-end cleanup outcome coverage lives in service.test.ts (late claims, stale
lifecycle writes) and service.removal-safety.test.ts (dirty retention).
steipete added a commit that referenced this pull request Sep 28, 2026
fb55609 (#160308) consolidated run-end cleanup coverage into the
surviving service tests but left the deleted file in CI policy watches,
the proof inventory, timing metadata, and a QA scenario code reference.

The scenario failure was reported in CI run 36427486045, job 108949566158
on #160224:
https://github.com/openclaw/openclaw/actions/runs/36427486045/job/108949566158

Before: the catalog test failed with the missing worktree cleanup codeRef
(1 failed, 44 passed) in a worktree outside the older parent checkout.
A nested worktree falsely passed because the resolver found the parent's
old test file. Concurrent commit 3a300c6 repaired the scenario reference;
retain that fix and remove the three remaining obsolete script entries.

After: catalog 45/45, inventory/timing/node-plan 225/225, and 29 targeted
changed-plan cases pass. The complete four-file tooling baseline also
passed 550 tests. Scoped oxfmt, oxlint, and git diff --check pass.
Independent review reports no actionable P0-P2 findings.
steipete added a commit that referenced this pull request Sep 28, 2026
…up tests

#160308 deleted src/agents/worktrees/service.run-end-cleanup.test.ts, which the
managed-worktrees-workboard-lifecycle scenario still listed as a codeRef, so
extensions/qa-lab/src/scenario-catalog.test.ts failed on main. The surviving
run-end cleanup outcome coverage lives in service.test.ts (late claims, stale
lifecycle writes) and service.removal-safety.test.ts (dirty retention).

(cherry picked from commit 3a300c6)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 29, 2026
…law#160308)

* test(config): deslop t0065 tests

* test(agents): deslop t0032 tests

* test(worktrees): deslop t0060 tests

* test(worktrees): deslop t0061 tests

* test(codex): deslop t0051 tests

* test(worktrees): deslop t0062 tests

* test(agents): deslop t0049 tests

* test(codex): deslop t0054 tests

* test(agents): deslop t0034 tests

Reduce the embedded subscription suite from 318 to 146 cases and 8135 to 4046 test lines. Consolidate event fixtures and retain receipt, media-trust, lifecycle, phase, and reconciliation regressions. Remove the obsolete max-lines baseline entry.

Blacksmith proof: 146 tests passed. Covered statements 7931 -> 7920; branches 6306 -> 6265; functions 1286 -> 1286. Types, dead exports, boundaries, formatting, and changed-file plain lint passed. The broad changed gate hits the pre-existing UI max-lines failure in ui/src/pages/chat/components/chat-attachments.ts (716 > 700); that file is byte-identical to the starting commit.

* test(config): deslop t0057 tests

* test(config): retain node skill validation contracts

* test: retain audited boundary coverage in d084
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 29, 2026
…up tests

openclaw#160308 deleted src/agents/worktrees/service.run-end-cleanup.test.ts, which the
managed-worktrees-workboard-lifecycle scenario still listed as a codeRef, so
extensions/qa-lab/src/scenario-catalog.test.ts failed on main. The surviving
run-end cleanup outcome coverage lives in service.test.ts (late claims, stale
lifecycle writes) and service.removal-safety.test.ts (dirty retention).
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 29, 2026
196d5db (openclaw#160308) consolidated run-end cleanup coverage into the
surviving service tests but left the deleted file in CI policy watches,
the proof inventory, timing metadata, and a QA scenario code reference.

The scenario failure was reported in CI run 36427486045, job 108949566158
on openclaw#160224:
https://github.com/openclaw/openclaw/actions/runs/36427486045/job/108949566158

Before: the catalog test failed with the missing worktree cleanup codeRef
(1 failed, 44 passed) in a worktree outside the older parent checkout.
A nested worktree falsely passed because the resolver found the parent's
old test file. Concurrent commit f4ed4c2 repaired the scenario reference;
retain that fix and remove the three remaining obsolete script entries.

After: catalog 45/45, inventory/timing/node-plan 225/225, and 29 targeted
changed-plan cases pass. The complete four-file tooling baseline also
passed 550 tests. Scoped oxfmt, oxlint, and git diff --check pass.
Independent review reports no actionable P0-P2 findings.
steipete added a commit that referenced this pull request Sep 29, 2026
…ptures (#159226)

* refactor(infra): share filesystem observation policy

Centralize polling overrides, guarded source admission and metadata sampling. Bound remote file notifications and join accepted output before shutdown.

* refactor: migrate config, skills, memory and dev watchers

Use fs-safe invalidations and scope replacement while keeping source selection, settling, reload and indexing policy with each owner. Remove first-party Chokidar, bespoke native transports and duplicate observation tests. Preserve joined application work and watch-limit degradation; isolate manual Gateway writer fixtures from filesystem readiness.

Supersedes #158182. Thanks @vincentkoc.

Co-authored-by: Vincent Koc <[email protected]>

* fix(memory): use host filesystem observation for captured plugins

Pair watch with SDK Root admission so captured plugin dependencies cannot split
fs-safe's module-local Root registry. Preserve the strong Root check and route
existing watcher tests through the host SDK boundary.

Keep the eager Skills subscriber snapshot with Array.from and remove the new
lint suppression without changing the production suppression allowlist.

* fix: preserve fs-safe fallback for legacy polling overrides

Treat legacy false, zero and empty polling overrides as a native preference
so Bun and installations without the native addon retain working observation.
Capture Config polling-recovery eligibility per observer to preserve the
explicit override retry limit.

Prepare the Skills recovery test through its existing worker owner and load
the real snapshot dependency before cases begin. Keep recovery assertions,
timeouts and artifact verification unchanged.

* test(memory): check resolved observation backend health

* fix(plugins): preserve native capture authority and lifetime

* test(ci): scope native Doctor proof to its runtime owners

* fix(plugins): break capture storage type import cycle

* fix(memory): import observation types through host SDK

* test(gateway): isolate operation journal fixtures

* fix(qa): point worktree lifecycle scenario at surviving run-end cleanup tests

#160308 deleted src/agents/worktrees/service.run-end-cleanup.test.ts, which the
managed-worktrees-workboard-lifecycle scenario still listed as a codeRef, so
extensions/qa-lab/src/scenario-catalog.test.ts failed on main. The surviving
run-end cleanup outcome coverage lives in service.test.ts (late claims, stale
lifecycle writes) and service.removal-safety.test.ts (dirty retention).

(cherry picked from commit 3a300c6)

* test: isolate planner contracts and share installer shell

* refactor(gateway): schedule remote skill refresh (#160318)

## What Problem This Solves

Remote-node skill refresh still kept a private debounce timer and threaded its handle through Gateway startup and shutdown.

## User Impact

Skill changes keep the existing 30-second debounce, now owned by the kernel scheduler. Shutdown joins an active refresh and suppresses late broadcasts. Updating needs no operator action or config, storage, or public SDK migration.

## Why This Change Was Made

Schedule refresh directly with the existing scheduler. Remove the timer getter/setter, delay option, runtime handle, and redundant close hook.

Production **+18/-36/net -18**; tests **+100/-38/net +62**; docs **0**. Production counts use src/** and extensions/** with the work-order test exclusions.

## Evidence

Deslop and Codex autoreview completed with no actionable findings through P2. Focused proof passed on blacksmith-testbox lease `tbx_01m3k4y56rf9r63tzs4hck3pek`, [run 36378613468](https://github.com/openclaw/openclaw/actions/runs/36378613468); unchanged source/test hashes were verified in the later proof. Each command used `pnpm test <file> --maxWorkers=1`:

| File | Tests | Command wall |
|---|---:|---:|
| src/gateway/server-startup-early.test.ts | 14 | 14.763 s |
| src/gateway/server-close.test.ts | 80 | 23.385 s |
| src/gateway/server-startup-lifetime.test.ts | 14 | 37.299 s |

The closeout docs PR will carry the complete census and merged-main sleep/shutdown proof; that live proof is still pending.

Exact-head `node scripts/check-changed.mjs --base 5362ba0 -- <all 6 changed paths>` passed on `4fafc2add7ceeba82307bc25447af0262785364e`: production typecheck, 25 dependent test type graphs, lint (0 warnings/errors), dead-export scans and boundary guards. Check wall **1610.89 s**. Provider blacksmith-testbox, lease `tbx_01m3khvbn4fa9jb0bhe5qqp3we`, [run 36397188865](https://github.com/openclaw/openclaw/actions/runs/36397188865). The candidate was materialized in a clean detached worktree because native sync retained its hydration HEAD.

## Inherited CI failures and landing evidence

Completed exact-head CI [36402003337](https://github.com/openclaw/openclaw/actions/runs/36402003337) has two underlying failures plus its aggregate gate. Both match independent PRs:

- `gateway-agent-skill-refresh.e2e.test.ts:304` (called from line192): expected lifecycle count3, actual2. Identical without this cutover on approval [run36401825740/job108861794753](https://github.com/openclaw/openclaw/actions/runs/36401825740/job/108861794753). The unchanged synchronous `src/skills/runtime/refresh-state.ts` producer invokes the test's earlier registered listener directly. This PR changes a separate downstream remote-bin refresh consumer; the failing lifecycle count precedes the debounce/broadcast assertion.
- `subagent-completion-blocked.e2e.test.ts:78`, ordinary delivery exhaustion: expected suspended, actual pending. Identical on questions [run36403551682/job108867383832](https://github.com/openclaw/openclaw/actions/runs/36403551682/job/108867383832). Neither PR touches that completion owner.

Focused tests and the complete exact-head Testbox gate passed. The maintainer's standing instruction authorizes pinned admin squash over these inherited failures. No CI rerun or weakened assertion was used. The installed wrapper rejects the CLI admin argument shape; the native workflow's protected GraphQL merge route preserves the same squash, message, and expected-head payload used by that CLI operation.

(cherry picked from commit df785c0)

* test(gateway): adapt skills proof to fs-safe lifecycle

* test(skills): normalize Windows observation lookup

* test(memory): isolate guarded reconciliation from native hints

(cherry picked from commit f07aececc0b5641a00adfd0271c89e7c7162d38d)

* test(channels): update Synology context builder inventory

Match the selected builder spelling after the Synology inbound route was inlined in #160639. Preserve the existing caller inventory assertion and production behavior.

* test(skills): assert subscription renewal during recovery

* fix(ci): exchange hybrid parallel groups within the job cap

Reuse the existing bounded exchange optimizer for final hybrid consolidation. Preserve group ownership, child worker limits and admission budgets while reducing the fs-safe composition from 80 to 78 rows. Scope exchange by backend so valid Blacksmith layouts and cap-independent plan identity stay stable.

* fix(test): retire subagent sweepers before SQLite owners

Stop the original subagent registry before non-isolated file cleanup retires
its SQLite owners. Join accepted sweeps and cleanup tails while preserving
synchronous fixture resets, successor scheduling, and the actor path guard.
Await the new reset contract in the concurrency benchmark too.

Baseline controls demonstrate an old registry tick recreating a retired
shared-state owner and premature settlement of three in-flight retirements.
The receiving candidate passes 102 owning/sibling cases, including the
17-case nested fixture (16 passed, one expected skip). The benchmark with
eight child sessions also passes. The owning run took 156.42 seconds.
Types, lint, formatting, export scans, and repository guards were qualified.
The exact historical hosted timer schedule remains unobserved.

* test(ci): isolate worker boundary fixtures from prebuilt mode

Keep synthetic historical runner fixtures in their explicit no-dist mode so
an inherited CI prebuilt flag cannot enter package preparation before the
worker-owner boundary. Preserve all six fixture modes and their assertions.

* test(ci): align runner fixture with canonical main

---------

Co-authored-by: Vincent Koc <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 30, 2026
…ptures (openclaw#159226)

* refactor(infra): share filesystem observation policy

Centralize polling overrides, guarded source admission and metadata sampling. Bound remote file notifications and join accepted output before shutdown.

* refactor: migrate config, skills, memory and dev watchers

Use fs-safe invalidations and scope replacement while keeping source selection, settling, reload and indexing policy with each owner. Remove first-party Chokidar, bespoke native transports and duplicate observation tests. Preserve joined application work and watch-limit degradation; isolate manual Gateway writer fixtures from filesystem readiness.

Supersedes openclaw#158182. Thanks @vincentkoc.

Co-authored-by: Vincent Koc <[email protected]>

* fix(memory): use host filesystem observation for captured plugins

Pair watch with SDK Root admission so captured plugin dependencies cannot split
fs-safe's module-local Root registry. Preserve the strong Root check and route
existing watcher tests through the host SDK boundary.

Keep the eager Skills subscriber snapshot with Array.from and remove the new
lint suppression without changing the production suppression allowlist.

* fix: preserve fs-safe fallback for legacy polling overrides

Treat legacy false, zero and empty polling overrides as a native preference
so Bun and installations without the native addon retain working observation.
Capture Config polling-recovery eligibility per observer to preserve the
explicit override retry limit.

Prepare the Skills recovery test through its existing worker owner and load
the real snapshot dependency before cases begin. Keep recovery assertions,
timeouts and artifact verification unchanged.

* test(memory): check resolved observation backend health

* fix(plugins): preserve native capture authority and lifetime

* test(ci): scope native Doctor proof to its runtime owners

* fix(plugins): break capture storage type import cycle

* fix(memory): import observation types through host SDK

* test(gateway): isolate operation journal fixtures

* fix(qa): point worktree lifecycle scenario at surviving run-end cleanup tests

openclaw#160308 deleted src/agents/worktrees/service.run-end-cleanup.test.ts, which the
managed-worktrees-workboard-lifecycle scenario still listed as a codeRef, so
extensions/qa-lab/src/scenario-catalog.test.ts failed on main. The surviving
run-end cleanup outcome coverage lives in service.test.ts (late claims, stale
lifecycle writes) and service.removal-safety.test.ts (dirty retention).

(cherry picked from commit f4ed4c2)

* test: isolate planner contracts and share installer shell

* refactor(gateway): schedule remote skill refresh (openclaw#160318)

## What Problem This Solves

Remote-node skill refresh still kept a private debounce timer and threaded its handle through Gateway startup and shutdown.

## User Impact

Skill changes keep the existing 30-second debounce, now owned by the kernel scheduler. Shutdown joins an active refresh and suppresses late broadcasts. Updating needs no operator action or config, storage, or public SDK migration.

## Why This Change Was Made

Schedule refresh directly with the existing scheduler. Remove the timer getter/setter, delay option, runtime handle, and redundant close hook.

Production **+18/-36/net -18**; tests **+100/-38/net +62**; docs **0**. Production counts use src/** and extensions/** with the work-order test exclusions.

## Evidence

Deslop and Codex autoreview completed with no actionable findings through P2. Focused proof passed on blacksmith-testbox lease `tbx_01m3k4y56rf9r63tzs4hck3pek`, [run 36378613468](https://github.com/openclaw/openclaw/actions/runs/36378613468); unchanged source/test hashes were verified in the later proof. Each command used `pnpm test <file> --maxWorkers=1`:

| File | Tests | Command wall |
|---|---:|---:|
| src/gateway/server-startup-early.test.ts | 14 | 14.763 s |
| src/gateway/server-close.test.ts | 80 | 23.385 s |
| src/gateway/server-startup-lifetime.test.ts | 14 | 37.299 s |

The closeout docs PR will carry the complete census and merged-main sleep/shutdown proof; that live proof is still pending.

Exact-head `node scripts/check-changed.mjs --base 9cd18e6 -- <all 6 changed paths>` passed on `4fafc2add7ceeba82307bc25447af0262785364e`: production typecheck, 25 dependent test type graphs, lint (0 warnings/errors), dead-export scans and boundary guards. Check wall **1610.89 s**. Provider blacksmith-testbox, lease `tbx_01m3khvbn4fa9jb0bhe5qqp3we`, [run 36397188865](https://github.com/openclaw/openclaw/actions/runs/36397188865). The candidate was materialized in a clean detached worktree because native sync retained its hydration HEAD.

## Inherited CI failures and landing evidence

Completed exact-head CI [36402003337](https://github.com/openclaw/openclaw/actions/runs/36402003337) has two underlying failures plus its aggregate gate. Both match independent PRs:

- `gateway-agent-skill-refresh.e2e.test.ts:304` (called from line192): expected lifecycle count3, actual2. Identical without this cutover on approval [run36401825740/job108861794753](https://github.com/openclaw/openclaw/actions/runs/36401825740/job/108861794753). The unchanged synchronous `src/skills/runtime/refresh-state.ts` producer invokes the test's earlier registered listener directly. This PR changes a separate downstream remote-bin refresh consumer; the failing lifecycle count precedes the debounce/broadcast assertion.
- `subagent-completion-blocked.e2e.test.ts:78`, ordinary delivery exhaustion: expected suspended, actual pending. Identical on questions [run36403551682/job108867383832](https://github.com/openclaw/openclaw/actions/runs/36403551682/job/108867383832). Neither PR touches that completion owner.

Focused tests and the complete exact-head Testbox gate passed. The maintainer's standing instruction authorizes pinned admin squash over these inherited failures. No CI rerun or weakened assertion was used. The installed wrapper rejects the CLI admin argument shape; the native workflow's protected GraphQL merge route preserves the same squash, message, and expected-head payload used by that CLI operation.

(cherry picked from commit fdde317)

* test(gateway): adapt skills proof to fs-safe lifecycle

* test(skills): normalize Windows observation lookup

* test(memory): isolate guarded reconciliation from native hints

(cherry picked from commit f07aececc0b5641a00adfd0271c89e7c7162d38d)

* test(channels): update Synology context builder inventory

Match the selected builder spelling after the Synology inbound route was inlined in openclaw#160639. Preserve the existing caller inventory assertion and production behavior.

* test(skills): assert subscription renewal during recovery

* fix(ci): exchange hybrid parallel groups within the job cap

Reuse the existing bounded exchange optimizer for final hybrid consolidation. Preserve group ownership, child worker limits and admission budgets while reducing the fs-safe composition from 80 to 78 rows. Scope exchange by backend so valid Blacksmith layouts and cap-independent plan identity stay stable.

* fix(test): retire subagent sweepers before SQLite owners

Stop the original subagent registry before non-isolated file cleanup retires
its SQLite owners. Join accepted sweeps and cleanup tails while preserving
synchronous fixture resets, successor scheduling, and the actor path guard.
Await the new reset contract in the concurrency benchmark too.

Baseline controls demonstrate an old registry tick recreating a retired
shared-state owner and premature settlement of three in-flight retirements.
The receiving candidate passes 102 owning/sibling cases, including the
17-case nested fixture (16 passed, one expected skip). The benchmark with
eight child sessions also passes. The owning run took 156.42 seconds.
Types, lint, formatting, export scans, and repository guards were qualified.
The exact historical hosted timer schedule remains unobserved.

* test(ci): isolate worker boundary fixtures from prebuilt mode

Keep synthetic historical runner fixtures in their explicit no-dist mode so
an inherited CI prebuilt flag cannot enter package preparation before the
worker-owner boundary. Preserve all six fixture modes and their assertions.

* test(ci): align runner fixture with canonical main

---------

Co-authored-by: Vincent Koc <[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 docker Docker and sandbox tooling extensions: codex 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