Repository navigation
fix(cli): defer inference runtimes until command execution - #158624
Merged
Merged
Conversation
Contributor
|
🦞👀 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. |
steipete
enabled auto-merge (squash)
September 26, 2026 03:39
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Sep 26, 2026
…158624) * fix(cli): defer inference runtimes until command execution * test(cli): extract inference command test harness
This was referenced Oct 7, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Inference help and shell completion load provider execution, authentication, configuration, and Gateway runtimes while building the command tree. That makes discovery depend on code needed only when an inference command actually runs.
User Impact
Parent help, detailed subcommand help, the
capabilityalias, and shell completion retain their command and option inventory without initializing inference execution runtimes. Existing command execution and provider-selection behavior is preserved.Why This Change Was Made
Move execution imports into their owning command actions and runners. Extract the existing provider-command registration into a lightweight module so listing the command tree does not import provider configuration. Keep the current main branch's consolidated image registrations, model-provider helper, model catalog handling, account-secret preparation, asynchronous resource disposal, and web exit behavior.
This replays campaign batch p007 (
bb21ea50e874af2246183bc5948c5f5420bc1590) onto current main. The related lazy-domain selection change in #140327 does not address eager imports inside domain registrars. Conflicts in audio, image, model, shared, video, and web were resolved toward current main's implementation, then the equivalent import deferral was applied. The retired model-reference wrapper and duplicated image registrations were not restored; current provider-environment APIs were retained. The regression guard also covers the newer account-secret, configuration, and prepared-catalog imports.The initial changed-file gate caught one counted line of growth in the oversized execution test. Its existing invocation helpers and collection-time subprocess setup now live in a small test harness; helper bodies and all assertions are preserved, and the original file shrinks.
No changed paths match
.github/CODEOWNERS.Evidence
7fc19c549b8040f8e1416fe3467bb84d234637e4: 320 tests passed across 10 owner and sibling files, covering command execution, help/completion, account-secret preparation, and resource cleanup. The wrapper verified the source SHA and tree before execution. Vitest wall time: 45.38 seconds across three shards with one worker.da49c7e45c4cbc65642911ebaf05b4b46b0371aemade all 10 guards fail for forbidden runtime imports. Restoring the candidate made all 10 pass; the standalone passing invocation took 1.57 seconds wall time (748 ms in Vitest).pnpm buildpassed in 8m 14.6s. Its non-fatal UI size report listed startup JS at 363.0 KiB against 362.6 KiB; this batch does not change UI source.git diff --checkalso passed locally.Production: +228/-192 lines (net +36). Tests and test support: +154/-30 lines (net +124). Documentation: +4/-0 lines. The production growth comes from moving imports into the execution scopes that own them; no additional execution path is introduced.
Validation commands
Run on Blacksmith Testbox through the repository wrapper:
pnpm install --frozen-lockfile --prefer-offline pnpm test src/cli/capability-cli.help.test.ts src/cli/capability-cli.test.ts src/cli/capability-cli.lazy.test.ts src/cli/capability-cli/shared.test.ts src/cli/capability-cli/local-account-secrets.test.ts src/cli/capability-cli/local-runners.account-secrets.test.ts src/cli/capability-cli/model.account-secrets.provenance.test.ts src/cli/capability-cli/model.account-secrets.runtime.test.ts src/cli/capability-cli/model.resources.test.ts src/cli/completion-command-tree.test.ts --maxWorkers=1 OPENCLAW_TESTBOX=1 OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 node scripts/check-changed.mjs -- docs/cli/infer.md src/cli/capability-cli.help.test.ts src/cli/capability-cli.test.ts src/cli/capability-cli.test-harness.ts src/cli/capability-cli/audio.ts src/cli/capability-cli/embedding.ts src/cli/capability-cli/image.ts src/cli/capability-cli/model.ts src/cli/capability-cli/providers-command.ts src/cli/capability-cli/shared.ts src/cli/capability-cli/tts.ts src/cli/capability-cli/video.ts src/cli/capability-cli/web.ts pnpm buildThe remote-child flag keeps the already remote changed-file check on its owning Testbox.