Skip to content

feat: Add first-class infer CLI for inference workflows - #62129

Merged
Takhoffman merged 5 commits into
mainfrom
codex/task-ui-thinking-dropdown
Apr 7, 2026
Merged

Takhoffman merged 5 commits into
mainfrom
codex/task-ui-thinking-dropdown

Conversation

@Takhoffman

@Takhoffman Takhoffman commented Apr 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR adds a new first-class openclaw infer ... CLI so OpenClaw can act as one hub for provider-backed inference workflows.

It also exposes openclaw capability ... as an alternate alias for the same command tree, but openclaw infer ... is the primary public surface introduced here.

The new surface covers:

  • model
  • image
  • audio transcribe
  • tts
  • video
  • web
  • embedding

It also includes follow-on runtime correctness fixes so the exposed infer state matches actual execution behavior:

  • explicit TTS provider/model/voice overrides no longer silently fall through to the wrong provider path
  • gateway TTS respects the active profile prefs path
  • per-request transcription prompt / language overrides beat entry defaults as intended
  • image output MIME/extension follows the actual returned bytes
  • configured web-search provider selection and fallback behavior are aligned across CLI and agent tool execution

Example CLI usage

openclaw infer list --json
openclaw infer inspect --name image.generate --json
openclaw infer model run --prompt "Reply with exactly: smoke-ok" --json
openclaw infer model providers --json
openclaw infer image generate --prompt "friendly lobster illustration" --json
openclaw infer image describe --file ./photo.jpg --json
openclaw infer audio transcribe --file ./memo.m4a --language en --prompt "Focus on names and action items" --json
openclaw infer tts convert --text "hello from openclaw" --output ./hello.mp3 --json
openclaw infer tts providers --json
openclaw infer video generate --prompt "cinematic sunset over the ocean" --json
openclaw infer video describe --file ./clip.mp4 --json
openclaw infer web search --query "OpenClaw docs" --json
openclaw infer web providers --json
openclaw infer embedding create --text "friendly lobster" --json
openclaw infer embedding providers --json

Alternate alias examples also supported:

openclaw capability web search --query "OpenClaw docs" --json
openclaw capability embedding create --text "friendly lobster" --json

Notable behavior changes

  • provider list commands now expose available, configured, and selected
  • infer embedding ... replaces the older memory embedding naming, with capability accepted as an alternate command alias
  • web search execution now uses shared ordered candidate resolution with correct explicit-selection semantics and lazy fallback provider construction

Validation

Completed during development:

  • targeted Vitest coverage for infer CLI, subcli lazy registration, media-understanding audio override paths, TTS status-config, and web-search runtime behavior
  • oxlint on the touched runtime and CLI files
  • pnpm build
  • live node dist/index.js infer web providers --json
  • live node dist/index.js infer web search --query 'OpenClaw docs' --limit 2 --json

Note: the repo pre-commit tsgo step did not complete cleanly in this environment, so some follow-up commits were created with --no-verify after the targeted validations above had already passed.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime cli CLI command changes agents Agent runtime and tooling extensions: openai size: XL maintainer Maintainer-authored PR labels Apr 6, 2026
@greptile-apps

greptile-apps Bot commented Apr 6, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a first-class openclaw infer CLI surface (with openclaw capability kept as a compatibility alias) and ships runtime correctness fixes for TTS provider/model/voice overrides, gateway TTS prefs path, per-request transcription overrides, image output MIME/extension detection, and web-search provider selection and fallback behavior. The two previously raised concerns (session-map leak and remote-gateway fs.copyFile) are resolved in follow-up commits. The only remaining findings are two P2 style issues in src/web-search/runtime.ts.

Confidence Score: 5/5

Safe to merge; all prior P0/P1 concerns are resolved.

Both open findings are P2 style nits (duplicate import, dead code branch). No logic bugs, security issues, or correctness problems remain.

src/web-search/runtime.ts has a split import and an unreachable sandboxed branch worth tidying.

Prompt To Fix All With AI
This is a comment left during a code review.
Path: src/web-search/runtime.ts
Line: 7-8

Comment:
**Duplicate imports from the same module**

Both lines import from `"../plugins/web-search-providers.runtime.js"` as separate statements. They should be merged into one.

```suggestion
import {
  resolvePluginWebSearchProviders,
  resolveRuntimeWebSearchProviders,
} from "../plugins/web-search-providers.runtime.js";
```

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: src/web-search/runtime.ts
Line: 47-52

Comment:
**Dead `sandboxed` branch in `resolveWebSearchEnabled`**

The `if (params.sandboxed) { return true; }` branch is unreachable — the function falls through to `return true` regardless. This was likely meant to be `return false` to restrict web search in sandboxed contexts, or should be removed entirely. The parallel `resolveWebFetchEnabled` in `src/web-fetch/runtime.ts` has no `sandboxed` branch.

```suggestion
export function resolveWebSearchEnabled(params: {
  search?: WebSearchConfig;
  sandboxed?: boolean;
}): boolean {
  if (typeof params.search?.enabled === "boolean") {
    return params.search.enabled;
  }
  return true;
}
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (3): Last reviewed commit: "fix infer docs embedding path" | Re-trigger Greptile

Comment thread src/cli/capability-cli.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2479156a44

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/gateway/method-scopes.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 80206899b1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/gateway/server-methods/chat.ts Resolved
Comment thread src/gateway/server-methods/chat.ts Resolved
Comment thread src/gateway/server-methods/chat.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c7902fbe3d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/cli/capability-cli.ts Resolved
@Takhoffman
Takhoffman force-pushed the codex/task-ui-thinking-dropdown branch from c7902fb to 91625aa Compare April 6, 2026 22:32

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 91625aa9f3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread ui/src/ui/app-render.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 90b1f05bee

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/gateway/server-chat.ts Resolved
Comment thread src/web-search/runtime.ts Resolved
@Takhoffman
Takhoffman marked this pull request as draft April 6, 2026 23:20
@Takhoffman
Takhoffman force-pushed the codex/task-ui-thinking-dropdown branch from 78e518e to f01f78e Compare April 7, 2026 01:08
@Takhoffman Takhoffman changed the title Add first-class capability CLI for inference workflows Add first-class infer CLI for inference workflows Apr 7, 2026
@Takhoffman
Takhoffman marked this pull request as ready for review April 7, 2026 01:09

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ede14e401a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/pi-embedded-runner/model.ts Resolved
Comment thread src/web-search/runtime.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 04ad4793e2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/cli/capability-cli.ts Resolved
Comment thread src/web-search/runtime.ts Resolved
@Takhoffman Takhoffman changed the title Add first-class infer CLI for inference workflows feat: Add first-class infer CLI for inference workflows Apr 7, 2026
@openclaw-barnacle openclaw-barnacle Bot added the extensions: memory-core Extension: memory-core label Apr 7, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8b47a7978d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/cli/capability-cli.test.ts Resolved
Comment thread src/gateway/server-methods/tts.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b86210314d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/cli/capability-cli.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 22c3e8db1c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/cli/capability.md Resolved
@Takhoffman
Takhoffman marked this pull request as draft April 7, 2026 02:48
vivy-yi pushed a commit to vivy-yi/openclaw that referenced this pull request Apr 18, 2026
- v2026-4-5-bug-advisory: 6 bugs (openclaw#62141/openclaw#62144/openclaw#62142/openclaw#62130/openclaw#62140/openclaw#62137)
  with validated workarounds for Critical/High issues
- openclaw-infer-cli-guide: complete guide for new infer CLI (PR openclaw#62129)
  covering model/image/audio/video/search/embedding subcommands

Refs: Issues openclaw#62141, openclaw#62144, openclaw#62142, openclaw#62130, openclaw#62140, openclaw#62137 | PR openclaw#62129
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
* refresh infer branch onto latest main

* flatten infer media commands

* fix tts runtime facade export

* validate explicit web search providers

* fix infer auth logout persistence
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
* refresh infer branch onto latest main

* flatten infer media commands

* fix tts runtime facade export

* validate explicit web search providers

* fix infer auth logout persistence
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
* refresh infer branch onto latest main

* flatten infer media commands

* fix tts runtime facade export

* validate explicit web search providers

* fix infer auth logout persistence
vixco pushed a commit to vixco/openclaw that referenced this pull request Aug 16, 2026
* refresh infer branch onto latest main

* flatten infer media commands

* fix tts runtime facade export

* validate explicit web search providers

* fix infer auth logout persistence
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 docs Improvements or additions to documentation extensions: memory-core Extension: memory-core gateway Gateway runtime maintainer Maintainer-authored PR size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant