Skip to content

fix(ci): prevent false lifecycle test failures - #163249

Merged
vincentkoc merged 1 commit into
mainfrom
fix/ci-lifecycle-test-contracts
Oct 2, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/ci-lifecycle-test-contracts

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Scheduled CI reports false lifecycle failures when SQLite maintenance creates another scheduler or periodic work calls a missing logger method in the shared test harness.

User Impact

Maintainers regain reliable lifecycle checks without changing production behavior or increasing runner capacity.

Why This Change Was Made

The CLI cleanup test now observes its actual command-owned scheduler instead of replacing every scheduler constructor. The prepared-runtime mock implements the typed logger contract, preserving its shared warning spy.

Evidence

  • Reproduced both failures from CI run 36961023723: the CLI constructor-count assertion and 16,800 unhandled log.trace is not a function errors in the spawn suite.
  • After the repair: all 54 tests pass across CLI cleanup, prepared runtime, and the full spawn production-boundary suite; no unhandled errors.
  • Formatting and git diff --check pass. Independent review found no actionable findings.
  • Changed cleanup case: 2.343 seconds locally and 1.233 seconds in CI (job 110707089021). The complete local CLI suite took 7.08 seconds; all three local suites including wrapper setup took 213.23 seconds.
  • Exact-head CI run 36965044127 passed in 6m13s. Local check:changed also passed, including all six affected core test type graphs, production types, guards, dead-export scans, and focused lint.

@vincentkoc vincentkoc self-assigned this Oct 2, 2026
@clawsweeper

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

@vincentkoc
vincentkoc marked this pull request as ready for review October 2, 2026 04:33
@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes agents Agent runtime and tooling size: XS labels Oct 2, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 2, 2026
@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 2, 2026, 12:57 AM ET / 04:57 UTC (Revision 3).

ClawSweeper review

What this changes

The PR completes the shared test logger contract and makes CLI cleanup coverage observe the command-owned scheduler instead of replacing every scheduler constructor.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused repair for lifecycle test failures still present on current main. No actionable patch defect or additional merge blocker was found; the member-authored PR should remain open.

Priority: P2
Reviewed head: 38f79ebe0d7fd53f872a1a74af17c71c10549397

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused fixture repair with preserved behavioral assertions, reported failing-before validation, and independently verified successful CI for the pinned head.
Proof confidence 🌊 off-meta tidepool Not applicable: The member-authored PR repairs test fixtures and has no changed production behavior requiring contributor runtime proof. Recorded CLI-entry and spawn-suite validation supports the repair; no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The member-authored PR repairs test fixtures and has no changed production behavior requiring contributor runtime proof. Recorded CLI-entry and spawn-suite validation supports the repair; no stored-data contract changes.
Evidence reviewed 7 items Pinned introduced change: The verified merge-base-to-head delta changes only the logger fixture and CLI cleanup test. It introduces no production implementation, workflow, dependency, or storage-contract changes.
Logger contract repair: The fixture now implements SubsystemLogger, including trace, fatal, raw, and subsystem, while preserving the shared warning spy. The production scheduler calls log.trace for recurring jobs, establishing the concrete failure mechanism in the old mock.
Cleanup coverage preserves the lifecycle contract: The test retrieves the existing bound resource host’s scheduler during command dispatch and retains assertions for an active schedule, command-exit abortion, cleared wakeups, orphan reclamation, and capture deletion. The production cleanup scope binds this scheduler and closeCliResources stops it; SQLite WAL maintenance independently constructs another scheduler.
Findings None None.
Security None None.

How this fits together

OpenClaw’s lifecycle tests exercise command resource cleanup and prepared agent runtime behavior. Their fixtures supply logging and scheduling observations so CI can distinguish resource leaks from test setup failures.

flowchart TD
  A[Lifecycle test scenarios] --> B[Shared test fixtures]
  B --> C[Prepared agent runtime]
  B --> D[CLI command entry]
  C --> E[Typed logger mock]
  D --> F[Command scheduler and captures]
  F --> G[Shutdown and deletion assertions]
  E --> H[Reliable CI results]
  G --> H
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests -1. Total -1 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 19 20 -1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 19 20 -1

Review metrics

Metric Value Why it matters
Cleanup test cost 2.343 seconds locally; 1.233 seconds in CI The PR records the changed scenario’s measured cost without adding a test case or timing wait.

Technical review

Best possible solution:

Keep lifecycle coverage tied to the existing command resource owner and maintain a typed, complete logger fixture.

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

Yes, from source: recurring scheduler jobs call trace on an incomplete logger mock, and SQLite maintenance can invalidate the global constructor-count assertion. This review did not execute the failing suites.

Is this the best way to solve the issue?

Yes. Completing the existing logger contract and observing the actual command scheduler repairs the fixtures while preserving shutdown and capture-cleanup assertions.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This repairs bounded test-fixture defects that undermine lifecycle CI reliability without changing user runtime behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The member-authored PR repairs test fixtures and has no changed production behavior requiring contributor runtime proof. Recorded CLI-entry and spawn-suite validation supports the repair; no stored-data contract changes.

Evidence

What I checked:

  • Pinned introduced change: The verified merge-base-to-head delta changes only the logger fixture and CLI cleanup test. It introduces no production implementation, workflow, dependency, or storage-contract changes. (38f79ebe0d7f)
  • Logger contract repair: The fixture now implements SubsystemLogger, including trace, fatal, raw, and subsystem, while preserving the shared warning spy. The production scheduler calls log.trace for recurring jobs, establishing the concrete failure mechanism in the old mock. (src/agents/prepared-model-runtime.test-harness.ts:434, 38f79ebe0d7f)
  • Cleanup coverage preserves the lifecycle contract: The test retrieves the existing bound resource host’s scheduler during command dispatch and retains assertions for an active schedule, command-exit abortion, cleared wakeups, orphan reclamation, and capture deletion. The production cleanup scope binds this scheduler and closeCliResources stops it; SQLite WAL maintenance independently constructs another scheduler. (src/cli/run-main.cleanup.test.ts:241, 38f79ebe0d7f)
  • Still necessary on fetched main: Comparing the pinned head with fetched main shows main retains the incomplete logger mock and global scheduler replacement with its constructor-count assertion. No equivalent repair is present in these current-main files. (db20d752394f)
  • Recorded validation and verified CI identity: The captured PR body reports both original failures, 54 passing tests after repair, no unhandled errors, and measured cleanup-test cost of 2.343 seconds locally and 1.233 seconds in CI. GitHub independently confirms https://github.com/openclaw/openclaw/actions/runs/36965044127 completed successfully for the exact pinned head. Tests were not executed during this read-only review. (38f79ebe0d7f)
  • Area history and routing: Current-main history includes substantial cleanup-test and prepared-runtime work by Peter Steinberger. GitHub commit metadata verifies the steipete handle for the capture-maintenance change and cold-catalog preparation change; the former patch includes the retained cleanup scenario. (src/cli/run-main.cleanup.test.ts:218, c6d17f6dfec5)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

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-10-02T04:38:13.578Z sha 38f79eb :: needs changes before merge. :: none
  • reviewed 2026-10-02T04:47:58.829Z sha 38f79eb :: needs maintainer review before merge. :: none

@vincentkoc
vincentkoc merged commit 06d2de9 into main Oct 2, 2026
212 checks passed
@vincentkoc
vincentkoc deleted the fix/ci-lifecycle-test-contracts branch October 2, 2026 05:20
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

steipete added a commit that referenced this pull request Oct 2, 2026
Initialize plugin fixtures before observing GatewayScheduler construction
so the process-scoped WAL scheduler stays independent of the command
scheduler. Retain the bound-host coverage from #163249 and require it to
bind the observed scheduler. Restore exactly-once construction and the
one-hour cleanup deadline while preserving reclamation and shutdown checks.

Validation: all 10 CLI cases passed 5x locally (50/50); oxfmt, scoped lint,
and boundary lint passed; P2 review scoped-clean. Testbox was not required
for this one-file test-only change, as explicitly authorized.
steipete added a commit that referenced this pull request Oct 2, 2026
Integrate the shared logger mock repair from #163249. The S24 cleanup diff remains unchanged against the merged main. Validation: 33 session cleanup tests and 2 SDK lifecycle tests passed; fresh isolated review found no actionable P0-P2 findings.
steipete added a commit that referenced this pull request Oct 2, 2026
The complete SubsystemLogger mock from 06d2de9 (#163249) already
provided trace. Merging 40d284f (#159013) added it again and broke
check-test-types-core-4 with TS1117. Keep one trace and every other logger
method; no test case or assertion changes.

Validation: gateway-root tsgo, check-changed, scoped and boundary lint,
and P2 review. Static proof ran locally as authorized for this main repair.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 3, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 3, 2026
Initialize plugin fixtures before observing GatewayScheduler construction
so the process-scoped WAL scheduler stays independent of the command
scheduler. Retain the bound-host coverage from openclaw#163249 and require it to
bind the observed scheduler. Restore exactly-once construction and the
one-hour cleanup deadline while preserving reclamation and shutdown checks.

Validation: all 10 CLI cases passed 5x locally (50/50); oxfmt, scoped lint,
and boundary lint passed; P2 review scoped-clean. Testbox was not required
for this one-file test-only change, as explicitly authorized.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 3, 2026
The complete SubsystemLogger mock from ddd9021 (openclaw#163249) already
provided trace. Merging 69f660d (openclaw#159013) added it again and broke
check-test-types-core-4 with TS1117. Keep one trace and every other logger
method; no test case or assertion changes.

Validation: gateway-root tsgo, check-changed, scoped and boundary lint,
and P2 review. Static proof ran locally as authorized for this main repair.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling cli CLI command changes P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant