Repository navigation
test(auto-reply): split the thinking directive tests below the line cap - #145632
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 12, 2026, 1:24 AM ET / 05:24 UTC. ClawSweeper reviewWhat this changesSplits thinking-level tests into a separate file so both test files satisfy the existing lint limit without changing assertions or runtime behavior. Merge readiness✅ Ready for maintainer review Keep open: current main still needs this focused test split. All seven original suites remain byte-identical and occur exactly once; no actionable defect was found. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw’s thinking controls derive supported reasoning levels and defaults from model catalogs and provider policies. These tests protect that selection logic and directive normalization. flowchart LR
A[Model catalog] --> C[Thinking controls]
B[Provider policies] --> C
C --> D[Supported levels and defaults]
E[Thinking-level tests] --> C
F[Directive normalization tests] --> C
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +18. Total +18 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Retain the focused test split and unchanged coverage under the existing lint limit. Do we have a high-confidence way to reproduce the issue? Not applicable to runtime behavior: this is test organization. The PR records the lint failure, and source inspection confirms both resulting files fit the unchanged limit. Is this the best way to solve the issue? Yes. Moving a complete suite and its private fixture preserves coverage without weakening assertions, raising limits, or adding shared infrastructure. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b00f036510ad. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Apply the unchanged test-only split from upstream 9ab6ba8 (#145632) to repair the preexisting 1006-line CI failure on the retention candidate. No production behavior changes. Focused 83 tests, scoped lint and formatting pass; independent full-candidate P0 review is clean. Stress acceptance remains outstanding.
* perf(sessions): reduce disk-pressure reclamation overhead Reuse a sweep-owned reclamation Worker while preserving each victim transaction and live authority. Keep archive-only workers off the lifecycle import graph, join before final physical accounting, and preserve current physical-store ownership and per-request worker diagnostics. Focused integration tests, compiled dependency-boundary regression, changed checks, normal build, and independent P0 review passed. Earlier matched-workload checkpoints reduced cleanup from 51.446s to 22.436s, but strict timing and SCALE gates remain unpassed; fresh integrated-head stress proof is still required. * refactor(sessions): keep reclamation contracts acyclic Move shared plan and result types into the existing lifecycle-types owner so the Worker no longer imports its runtime caller. Preserve exact type shapes and runtime behavior. Both cycle checks, focused tests, bootstrap regression, strict build/declarations, and independent P0 review pass. * fix(sessions): preserve current admission during sweep worker reuse Refresh the disk-pressure cleanup optimization in #140897 against current SQLite ownership. Keep per-victim retained claims, authorization and publication ordering while reusing one Worker per sweep. Bind each request to its own async context and preserve the original authority error during cleanup. Focused owner, archive and combined regression tests, classified checks, full build and independent P0 review passed. Full stress acceptance remains blocked by missing original harness inputs; this commit does not claim landing readiness. * test(gateway): align reclamation probe with worker bootstrap Use the current bootstrap database options in the real SQLite validation preload. Both Gateway admission cases failed before this fixture correction and pass afterward, preserving revocation, same-store progress, native checks and lease cleanup assertions. * fix(sessions): preserve cold mutation lifetimes during sweep reuse Integrate the disk-pressure performance follow-up #140897 with cold storage from #145172. Share request admission and authorization while keeping cold mutations one-shot through cleanup and native exit, and retaining one validated reclamation Worker per sweep. Keep restore preparation, synchronous commit checks, publication ordering and final physical accounting intact. Remove inherited dead UI exports and obsolete styles, exercise configuration through its real menu entrypoint, reuse picker test setup, and consolidate duplicate lifecycle notification construction. Preserve the 720-root and file-size limits without suppressions. Focused cold/reclamation/Gateway tests, reset and UI coverage, classified checks, full build and independent P0 review passed. Full stress acceptance remains pending the separately reviewed replacement rig. * test(auto-reply): incorporate canonical thinking test split Apply the unchanged test-only split from upstream 9ab6ba8 (#145632) to repair the preexisting 1006-line CI failure on the retention candidate. No production behavior changes. Focused 83 tests, scoped lint and formatting pass; independent full-candidate P0 review is clean. Stress acceptance remains outstanding. * refactor(sessions): clarify reclamation cleanup handling * test: drain retained database workers before fixture cleanup * test: preserve fixture state through retained worker drainage * test: adapt archive bootstrap proof to tsdown handle * test(sessions): drain archive fixture resources before removal * test(gateway): drain the captured shared-state fixture owner * fix(gateway): yield to I/O between startup phases Retain the complete shutdown graph and lifecycle before yielding. Let queued I/O and close requests run before core runtime startup, and reject canceled startup before it can continue. * perf(sessions): trim archive worker database bootstrap Archive materialization and publication use fresh read-only connections, so avoid loading the writable database runtime to search an isolate-local cache that cannot contain parent handles. Share missing-table adaptation with cached readers while preserving validation, native close, and one-shot Worker exit ordering. Verify the emitted archive bootstrap excludes the writable database module even when built with the parent session-store SDK entry. Preserve archive bytes, failure recovery, and borrowed/fresh reader behavior through focused tests. * perf(sessions): skip artifact preparation without file candidates Use the existing file inventory to avoid resolving every session path when no eligible transcript artifact can be removed, and avoid prompt projection without prompt blobs. Preserve the existing removal rules and validate with the stale-temp regression and 77 artifact/disk-budget cases. * perf(state): keep startup agent integrity scans off the main thread Run the full startup integrity and foreign-key scan against the already-owned private agent snapshot through the existing integrity child. Retain the snapshot and parent reader through native child close, then perform the unchanged schema and migration checks. Preserve fresh admission before the migration lease and before writes, source artifact neutrality, and original-path diagnostics. Keep shared-state scans on their existing connection for the narrow legacy Workshop-index admission. Move the unchanged schema-preflight error class to its existing messages owner while preserving its public export. Update the sole direct native integrity fixture for the diagnostic label. Two real startup regressions fail on the original main-thread scan and pass afterward, including a real foreign-key violation. 107 focused cases across six files, selected repository checks, and independent review through P2 pass. The integrated build and whole-Gateway stress limits remain required; this commit does not claim a stress or runtime-update acceptance result. * perf(sessions): reuse scoped archive workers during cleanup Keep archive execution within cleanup and deletion scopes while closing fresh readers and files for every operation. Preserve per-victim commits and publication, and drain native work on failure or retirement. Narrow singleton reference hydration through the existing parser without a reference cache. Align cold-handle and fixture cleanup proof with their canonical lifecycle owners. * refactor(sessions): isolate archive contracts from execution Move shared archive types into a leaf contract and migrate internal callers to remove the type-only import cycle without changing runtime behavior. Model cold handles through canonical cache eviction in lifecycle fixtures and await native drainage before fixture cleanup. * perf(sessions): yield between cleanup phases Avoid loading the full session store when ordinary cleanup does not use the repair snapshot. Reuse canonical entries already read within the maintenance transaction when writing archive metadata, preserving the original previous entry and all writer guards. Yield outside transactions before lifecycle application and the following snapshot so cleanup preparation, atomic writes, and queued responses do not combine into one long event-loop pause. Repair options, archive ordering, metadata, and transaction atomicity remain unchanged. The original large workload recorded a 664.79 ms gap; a separate CPU profile identified the repeated store load and maintenance transaction as dominant costs. The focused 66-test suite, static checks, and independent P0-P2 review pass. Fresh compiled responsiveness and published-updater acceptance remain required for this source.
…40897) * perf(sessions): reduce disk-pressure reclamation overhead Reuse a sweep-owned reclamation Worker while preserving each victim transaction and live authority. Keep archive-only workers off the lifecycle import graph, join before final physical accounting, and preserve current physical-store ownership and per-request worker diagnostics. Focused integration tests, compiled dependency-boundary regression, changed checks, normal build, and independent P0 review passed. Earlier matched-workload checkpoints reduced cleanup from 51.446s to 22.436s, but strict timing and SCALE gates remain unpassed; fresh integrated-head stress proof is still required. * refactor(sessions): keep reclamation contracts acyclic Move shared plan and result types into the existing lifecycle-types owner so the Worker no longer imports its runtime caller. Preserve exact type shapes and runtime behavior. Both cycle checks, focused tests, bootstrap regression, strict build/declarations, and independent P0 review pass. * fix(sessions): preserve current admission during sweep worker reuse Refresh the disk-pressure cleanup optimization in openclaw#140897 against current SQLite ownership. Keep per-victim retained claims, authorization and publication ordering while reusing one Worker per sweep. Bind each request to its own async context and preserve the original authority error during cleanup. Focused owner, archive and combined regression tests, classified checks, full build and independent P0 review passed. Full stress acceptance remains blocked by missing original harness inputs; this commit does not claim landing readiness. * test(gateway): align reclamation probe with worker bootstrap Use the current bootstrap database options in the real SQLite validation preload. Both Gateway admission cases failed before this fixture correction and pass afterward, preserving revocation, same-store progress, native checks and lease cleanup assertions. * fix(sessions): preserve cold mutation lifetimes during sweep reuse Integrate the disk-pressure performance follow-up openclaw#140897 with cold storage from openclaw#145172. Share request admission and authorization while keeping cold mutations one-shot through cleanup and native exit, and retaining one validated reclamation Worker per sweep. Keep restore preparation, synchronous commit checks, publication ordering and final physical accounting intact. Remove inherited dead UI exports and obsolete styles, exercise configuration through its real menu entrypoint, reuse picker test setup, and consolidate duplicate lifecycle notification construction. Preserve the 720-root and file-size limits without suppressions. Focused cold/reclamation/Gateway tests, reset and UI coverage, classified checks, full build and independent P0 review passed. Full stress acceptance remains pending the separately reviewed replacement rig. * test(auto-reply): incorporate canonical thinking test split Apply the unchanged test-only split from upstream cc071e9 (openclaw#145632) to repair the preexisting 1006-line CI failure on the retention candidate. No production behavior changes. Focused 83 tests, scoped lint and formatting pass; independent full-candidate P0 review is clean. Stress acceptance remains outstanding. * refactor(sessions): clarify reclamation cleanup handling * test: drain retained database workers before fixture cleanup * test: preserve fixture state through retained worker drainage * test: adapt archive bootstrap proof to tsdown handle * test(sessions): drain archive fixture resources before removal * test(gateway): drain the captured shared-state fixture owner * fix(gateway): yield to I/O between startup phases Retain the complete shutdown graph and lifecycle before yielding. Let queued I/O and close requests run before core runtime startup, and reject canceled startup before it can continue. * perf(sessions): trim archive worker database bootstrap Archive materialization and publication use fresh read-only connections, so avoid loading the writable database runtime to search an isolate-local cache that cannot contain parent handles. Share missing-table adaptation with cached readers while preserving validation, native close, and one-shot Worker exit ordering. Verify the emitted archive bootstrap excludes the writable database module even when built with the parent session-store SDK entry. Preserve archive bytes, failure recovery, and borrowed/fresh reader behavior through focused tests. * perf(sessions): skip artifact preparation without file candidates Use the existing file inventory to avoid resolving every session path when no eligible transcript artifact can be removed, and avoid prompt projection without prompt blobs. Preserve the existing removal rules and validate with the stale-temp regression and 77 artifact/disk-budget cases. * perf(state): keep startup agent integrity scans off the main thread Run the full startup integrity and foreign-key scan against the already-owned private agent snapshot through the existing integrity child. Retain the snapshot and parent reader through native child close, then perform the unchanged schema and migration checks. Preserve fresh admission before the migration lease and before writes, source artifact neutrality, and original-path diagnostics. Keep shared-state scans on their existing connection for the narrow legacy Workshop-index admission. Move the unchanged schema-preflight error class to its existing messages owner while preserving its public export. Update the sole direct native integrity fixture for the diagnostic label. Two real startup regressions fail on the original main-thread scan and pass afterward, including a real foreign-key violation. 107 focused cases across six files, selected repository checks, and independent review through P2 pass. The integrated build and whole-Gateway stress limits remain required; this commit does not claim a stress or runtime-update acceptance result. * perf(sessions): reuse scoped archive workers during cleanup Keep archive execution within cleanup and deletion scopes while closing fresh readers and files for every operation. Preserve per-victim commits and publication, and drain native work on failure or retirement. Narrow singleton reference hydration through the existing parser without a reference cache. Align cold-handle and fixture cleanup proof with their canonical lifecycle owners. * refactor(sessions): isolate archive contracts from execution Move shared archive types into a leaf contract and migrate internal callers to remove the type-only import cycle without changing runtime behavior. Model cold handles through canonical cache eviction in lifecycle fixtures and await native drainage before fixture cleanup. * perf(sessions): yield between cleanup phases Avoid loading the full session store when ordinary cleanup does not use the repair snapshot. Reuse canonical entries already read within the maintenance transaction when writing archive metadata, preserving the original previous entry and all writer guards. Yield outside transactions before lifecycle application and the following snapshot so cleanup preparation, atomic writes, and queued responses do not combine into one long event-loop pause. Repair options, archive ordering, metadata, and transaction atomicity remain unchanged. The original large workload recorded a 664.79 ms gap; a separate CPU profile identified the repeated store load and maintenance transaction as dominant costs. The focused 66-test suite, static checks, and independent P0-P2 review pass. Fresh compiled responsiveness and published-updater acceptance remain required for this source.
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]>
Refs #145439
What Problem This Solves
Resolves a problem where unrelated pull requests fail
check-lint-core-4because the thinking directive test file on main exceeds the 1,000-line lint cap (1,006 counted lines).Failing job: https://github.com/openclaw/openclaw/actions/runs/34674400801/job/103501629595
This small test-only repair was explicitly requested by a maintainer to unblock main CI.
Why This Change Was Made
Move the complete
listThinkingLevelsdescribe block and its Qwen catalog fixture tothinking.levels.test.ts. Keep normalization, prepared catalog identity, labels, defaults, and response usage coverage inthinking.test.ts. Both files retain the same per-test provider mock reset and are below the cap (840 and 328 physical lines). The Qwen fixture has no callers in the remaining file, so it needs no shared helper.All seven original describe blocks are preserved byte-for-byte, each exactly once. No production code, assertions, lint configuration, baselines, or dependencies change.
User Impact
Contributors can pass the core lint lane again without changing thinking behavior or reducing test coverage. There is no runtime behavior change.
Evidence
Before the split:
node scripts/run-vitest.mjs src/auto-reply/thinking*.test.tspasses all 91 tests before and after the split (two files before, three after, including the existing empty-profile sibling).The same core lint stripe and
node scripts/check-changed.mjsboth pass after the split. Fresh P1 autoreview is scoped-clean with no actionable findings. Exact-head hosted CI will be checked before native landing. Existing lint provides the failing-before/passing-after regression check; no redundant source-count test is added.Known gaps: no live or release validation is needed for a test-file-only move. Original test coverage and contributor attribution remain in Git history.