Repository navigation
test(node-host): split runner tests under the max-lines limit - #137149
Conversation
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.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 3, 2026, 3:46 AM ET / 07:46 UTC. ClawSweeper reviewWhat this changesThe 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 Review scores
Verification
How this fits togetherThe 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
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +30. Total +30 across 3 files. View PR surface stats
Review metrics
Technical reviewBest 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. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…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.
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]>
…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]>
…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]>
What Problem This Solves
Resolves a problem where
check-lint-core-4fails on main and every affected PR becausesrc/node-host/runner.test.tshas 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 intorunner.inventory.test.ts. Both suites use the existing mock factories and reset statements fromrunner.test-support.ts, registeringbeforeEachindependently. 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
node scripts/run-oxlint.mjs src/node-hostreproducedeslint(max-lines): File has too many lines (1006)atrunner.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.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.