Skip to content

test(node-host): split runner tests under the max-lines limit - #137149

Merged
steipete merged 1 commit into
mainfrom
test/node-host-runner-test-split
Sep 3, 2026
Merged

steipete merged 1 commit into
mainfrom
test/node-host-runner-test-split

Conversation

@steipete

@steipete steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Resolves a problem where check-lint-core-4 fails on main and every affected PR because src/node-host/runner.test.ts has 1,006 lint-counted lines, exceeding the 1,000-line limit.

Failing job: https://github.com/openclaw/openclaw/actions/runs/33727613551/job/100560316555

Related: #137081 (hardware model identifiers) and #137045 (password-missing supervisor exit coverage).

Why This Change Was Made

Split the existing tests by topic: keep startup, connection configuration, and lifecycle coverage in runner.test.ts; move capability discovery and inventory publication into runner.inventory.test.ts. Both suites use the existing mock factories and reset statements from runner.test-support.ts, registering beforeEach independently. The support module registers mocks before loading the runner and MCP bindings.

All 28 test declarations, including parameter tables and assertions, are byte-identical to the originals. No test deletions, production changes, suppressions, or baseline edits. Resulting files contain 453, 436, and 244 physical lines respectively. Production LOC delta: 0; test and support delta: +30 lines.

User Impact

Restores the node-host lint gate so this shared main failure no longer blocks PR validation. No runtime behavior changes.

Evidence

  • Before split: node scripts/run-oxlint.mjs src/node-host reproduced eslint(max-lines): File has too many lines (1006) at runner.test.ts:1103:4.
  • pnpm test src/node-host/: before 565 passed, 4 skipped (569 total), 48 files; after 565 passed, 4 skipped (569 total), 49 files.
  • pnpm test src/node-host/runner.test.ts: 29 passed independently.
  • pnpm test src/node-host/runner.inventory.test.ts: 12 passed independently; combined runner count remains 41.
  • AST-based comparison confirmed all 28 test declarations are byte-identical; mock factories and reset statements match modulo whitespace.
  • pnpm check:changed: passed formatting, core test typechecking, guards, dead-export scans, and changed-file lint.
  • node scripts/run-oxlint.mjs src/node-host: passed after the split and rebase.
  • git diff --check: passed.
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main --max-priority P2: scoped-clean, no accepted/actionable P0–P2 findings. Pre-commit local review was also clean.

The rebase onto current main left all node-host file contents unchanged. Final commit: f3856a112ef9eabaf08963add2279000d9e8eb60.

Separate lifecycle and connection tests from capability and inventory tests
so runner.test.ts stays below the max-lines gate blocking main CI. Share
the existing mocks and reset helper without changing tests or assertions.

Node-host before: 565 passed, 4 skipped (569 total), 48 files.
Node-host after: 565 passed, 4 skipped (569 total), 49 files.
Runner coverage remains 41 tests: 29 lifecycle/connection and 12 inventory.
@clawsweeper

clawsweeper Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@clawsweeper

clawsweeper Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 3, 2026, 3:46 AM ET / 07:46 UTC.

ClawSweeper review

What this changes

The PR separates node-host runner lifecycle tests, capability/inventory tests, and their shared mock setup so each file stays below the test max-lines limit.

Merge readiness

✅ Ready for maintainer review

Keep open. The PR cleanly splits the current oversized runner test suite without changing node-host runtime code, restoring the lint constraint that current main still violates.

Priority: P3
Reviewed head: f3856a112ef9eabaf08963add2279000d9e8eb60

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused, policy-aligned test refactor that preserves the runner test declarations and introduces no runtime behavior change.
Proof confidence 🌊 off-meta tidepool Not applicable: This member-authored PR changes only tests and test support, with no changed user-facing or production runtime behavior requiring external contributor proof.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This member-authored PR changes only tests and test support, with no changed user-facing or production runtime behavior requiring external contributor proof.
Evidence reviewed 7 items Lint contract: Test files under src are limited to 1,000 nonblank, noncomment lines; the PR uses a split rather than a suppression.
Introduced test-only split: The introduced diff adds the inventory suite and shared test support while removing 659 lines from the original suite; no production runtime path is introduced.
Mock initialization remains ordered: The shared support module registers mocks before dynamically loading the runner and MCP bindings, preserving the prior Vitest mock-before-import boundary for both suites.
Findings None None.
Security None None.

How this fits together

The node-host runner starts a local node process and connects it to the Gateway, where it publishes capabilities and inventory. These tests mock that runner boundary to preserve lifecycle and publication coverage.

flowchart LR
  A[Node CLI] --> B[Node-host runner]
  B --> C[Gateway connection]
  B --> D[Capability inventory]
  C --> E[Gateway]
  F[Shared mock setup] --> G[Lifecycle tests]
  F --> H[Inventory tests]
  G --> B
  H --> B
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +30. Total +30 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 3 689 659 +30
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 689 659 +30

Review metrics

Metric Value Why it matters
Production versus test LOC production +0/-0; tests and test support +689/-659 (net +30) The small test-support increase replaces one over-limit suite with three independently lintable test files and does not alter runtime code.

Technical review

Best possible solution:

Retain the focused split and shared mock module so runner coverage stays intact without a max-lines exception or runtime change.

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

Yes, from source: the checked lint configuration caps test files at 1,000 lines and current main's runner suite has 1,103 physical lines; the PR distributes its declarations across smaller files.

Is this the best way to solve the issue?

Yes. Splitting the test suite and sharing the existing mocks is the maintainable remedy required by repository policy, unlike adding a max-lines suppression.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 7b67c28e2e96.

Labels

Label changes:

  • add P3: This is a bounded test-maintenance repair for a lint gate, with no intended user-visible runtime change.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.

Label justifications:

  • P3: This is a bounded test-maintenance repair for a lint gate, with no intended user-visible runtime change.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.

Evidence

What I checked:

  • Lint contract: Test files under src are limited to 1,000 nonblank, noncomment lines; the PR uses a split rather than a suppression. (.oxlintrc.json:383, f3856a112ef9)
  • Introduced test-only split: The introduced diff adds the inventory suite and shared test support while removing 659 lines from the original suite; no production runtime path is introduced. (src/node-host/runner.test-support.ts:202, f3856a112ef9)
  • Mock initialization remains ordered: The shared support module registers mocks before dynamically loading the runner and MCP bindings, preserving the prior Vitest mock-before-import boundary for both suites. (src/node-host/runner.test-support.ts:202, f3856a112ef9)
  • Coverage retained: Current main has 28 direct test declarations in the original runner suite, and the two split suites also contain 28 direct declarations. (src/node-host/runner.test.ts:14, 7b67c28e2e96)
  • Runtime boundary: The CLI invokes runNodeHost, while the PR introduction set contains only tests and test support; runner and connection production code are unchanged. (src/cli/connect-cli.ts:246, f3856a112ef9)
  • Codex boundary check: The locally available Codex checkout identifies itself as the separate Codex monorepo; the introduced OpenClaw paths neither import nor exercise its runtime or protocol, so no dependency-specific Codex contract applies. (package.json:2, 41e22fee981a63b3698df7ed36bad393cda24715)

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)

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.

@steipete
steipete merged commit 7aff510 into main Sep 3, 2026
173 checks passed
@steipete
steipete deleted the test/node-host-runner-test-split branch September 3, 2026 07:53
@steipete

steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 4, 2026
…aw#137149)

Separate lifecycle and connection tests from capability and inventory tests
so runner.test.ts stays below the max-lines gate blocking main CI. Share
the existing mocks and reset helper without changing tests or assertions.

Node-host before: 565 passed, 4 skipped (569 total), 48 files.
Node-host after: 565 passed, 4 skipped (569 total), 49 files.
Runner coverage remains 41 tests: 29 lifecycle/connection and 12 inventory.
Ram-G added a commit to Ram-G/openclaw that referenced this pull request Sep 22, 2026
stream-runtime.test.ts is already over the max-lines cap, and the PR
line-cap ratchet rejects any growth, so the native thinking table and
the configured params.thinking cases move verbatim into
stream-runtime.thinking.test.ts. The fetch mocks and request helpers
they share with the remaining cases move into
stream-runtime.test-support.ts, the shape openclaw#137149 and openclaw#145632 used.
No test or assertion changes; the live proof in the PR body was run on
the previous head, whose plugin code this commit does not touch.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
RomneyDa added a commit that referenced this pull request Oct 3, 2026
…ls (#155640)

* fix(ollama): /think max falls back to high on newer Ollama Cloud models

Native think: "max" is gated by supportsOllamaCloudFullThinkingEffort,
a list of hosted ids that predates glm-5.3, glm-5.3-flash, kimi-k3, and
deepseek-v4.1-flash. Replace the regex with an explicit set of seven ids,
each verified against the thinking descriptor https://ollama.com/api/show
returns (values lists "max" for every one), and state that check as the
bar for adding an id. Docs naming the verified families now name these.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* test(ollama): move the thinking wire cases under the max-lines cap

stream-runtime.test.ts is already over the max-lines cap, and the PR
line-cap ratchet rejects any growth, so the native thinking table and
the configured params.thinking cases move verbatim into
stream-runtime.thinking.test.ts. The fetch mocks and request helpers
they share with the remaining cases move into
stream-runtime.test-support.ts, the shape #137149 and #145632 used.
No test or assertion changes; the live proof in the PR body was run on
the previous head, whose plugin code this commit does not touch.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* chore(ollama): keep the release-owned changelog untouched

CONTRIBUTING.md reserves CHANGELOG/** for release work; the note stays
in the PR body.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

---------

Co-authored-by: Claude Fable 5.1 <[email protected]>
Co-authored-by: Dallin Romney <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 4, 2026
…ls (openclaw#155640)

* fix(ollama): /think max falls back to high on newer Ollama Cloud models

Native think: "max" is gated by supportsOllamaCloudFullThinkingEffort,
a list of hosted ids that predates glm-5.3, glm-5.3-flash, kimi-k3, and
deepseek-v4.1-flash. Replace the regex with an explicit set of seven ids,
each verified against the thinking descriptor https://ollama.com/api/show
returns (values lists "max" for every one), and state that check as the
bar for adding an id. Docs naming the verified families now name these.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* test(ollama): move the thinking wire cases under the max-lines cap

stream-runtime.test.ts is already over the max-lines cap, and the PR
line-cap ratchet rejects any growth, so the native thinking table and
the configured params.thinking cases move verbatim into
stream-runtime.thinking.test.ts. The fetch mocks and request helpers
they share with the remaining cases move into
stream-runtime.test-support.ts, the shape openclaw#137149 and openclaw#145632 used.
No test or assertion changes; the live proof in the PR body was run on
the previous head, whose plugin code this commit does not touch.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* chore(ollama): keep the release-owned changelog untouched

CONTRIBUTING.md reserves CHANGELOG/** for release work; the note stays
in the PR body.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

---------

Co-authored-by: Claude Fable 5.1 <[email protected]>
Co-authored-by: Dallin Romney <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant