Skip to content

fix(cli): show actionable inference preflight errors with JSON - #199639

Merged
obviyus merged 3 commits into
openclaw:mainfrom
Leon-SK668:leon/fix-infer-preflight-remedies-20261115
Nov 15, 2026
Merged

obviyus merged 3 commits into
openclaw:mainfrom
Leon-SK668:leon/fix-infer-preflight-remedies-20261115

Conversation

@Leon-SK668

@Leon-SK668 Leon-SK668 commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Current maintainer validation on 08483cd947f1950648f332975bb11392e228634f: before/after receipts. All three CLI preflights preserve stdout, text-mode diagnostics and exit codes, with zero observed network API calls. The aggregate passed 118 tests; baseline had four intended failures. Matching test types, full DTS build and offline packed-entry smoke passed. Both original contributor commits are retained.

Fixes: infer --json directs operators to Doctor instead of showing the existing reason when web fetching is disabled, a pinned fetch provider is unavailable, or embedding provider/model flags conflict.

Why This Change Was Made

Classify three owner-produced preflight guards with the existing expected-error helper, covering both default and pinned fetch branches together. Execution, provider results and arbitrary provider failures retain their current owners and classifications.

Existing-solutions preflight: reuse the established helper and root renderer, as in the merged capability inspection remedy. No new formatting layer. The active query/document-input and per-call fetch-budget proposals concern separate capabilities; their inspected diffs retain these ordinary-error guards.

User Impact

User impact: stderr names the setting or flag to correct. JSON stdout, messages, exit1, provider selection and successful inference semantics retain their existing behavior. No configuration/defaults, protocol/schema, dependency or migration changes.

Scope: 4 files. Production +5/-3 (net +2); tests +20/-21 (net -1). Preflight regressions are consolidated into the existing capability aggregate and embedding support; the new standalone fixture was removed. No generated/lock files or allocation record.

Evidence

Current-head validation and complete stream/network receipts: #199639 (comment)

  • Host ocx tiers: vitest-source, source, and full with extracted packed-entry smoke.
  • Each named preflight ran in text and JSON modes on baseline and candidate; all exited 1, with unchanged stdout and text-mode stderr.
  • Passive observation forwarded actual network APIs; real loopback HTTP positive controls were observed, while inference preflights made no watched network calls. Packed Node proof used no observer preload. No provider credentials or live inference were used.
  • Regression ownership remains in the existing aggregate: default/pinned disabled fetch, unavailable pinned fetch, and embedding provider/model mismatch. Existing success and cleanup coverage remains; tests are net negative.
Historical contributor evidence on 7d0c4ae (retained for provenance)
  • Same six built CLI operations before/after on Linux/Node24.22.1: RED 48b92409887ac4e7b8c67883918a3fee2d9250c9 at 2026-11-15T14:07:06.086Z; GREEN 7d0c4aed09d9f9eaa30b4d07dd680479686a8c0c at 2026-11-15T15:24:03.532Z.
  • All four expected failures preserve parsed JSON and exit1. Before, stderr is generic; after, it shows the existing disabled-setting, provider-inspection or conflicting-flag remedy.
  • Real infer list --json and infer web providers --json controls exit0; isolated config bytes remain unchanged after every command. The frozen native driver only exercises local preflight/catalog paths.
  • OPENCLAW_VITEST_RUNTIME=node node scripts/run-vitest.mjs src/cli/capability-cli.test.ts src/cli/capability-cli/preflight-errors.test.ts src/cli/failure-output.test.ts src/cli/failure-output.contention.test.ts --maxWorkers=1 --reporter=dot: 149 passed, exit0,255.46s wrapper across2shards. This includes the complete capability aggregate, the six focused preflight/identity cases and both root-renderer files.
  • Updated the three old consumer cases that assumed local runtime error/exit handling. They now check the expected error/remedy and retain no-provider/no-output assertions. Removed the duplicate successful-embedding arm; the existing aggregate covers that success, while the distinct unexpected-error identity control remains.
  • The four new classification checks initially failed on unmodified production. The first review correctly identified that the initial focused-only run had missed the old consumer assertions; the complete test group above was run after correcting them.
  • Targeted tsgo, typed oxlint, oxfmt and git diff --check pass. Exact-head native node --import ./scripts/tsx.mjs scripts/build-all.mts sourcePerformance build passes in234.2s, not a full release/package check.

An early focused test attempt exceeded its120s deadline during one-time subprocess compilation. The existing collection-time preparation import moves that setup before test deadlines; timeouts/assertions were not relaxed.

Native baseline48b924 and branch base7d7d86bb have identical touched/shared/root-renderer blobs. The final followup changes tests only; complete native proof was nevertheless rebuilt and rerun on the published candidate above.

Not tested: successful live web/embedding calls, vendor APIs, installed upgrades, macOS/Windows, full release packaging or upstream CI. No live-inference or Codex-runtime claim is made.

Exact-head proof receipt
status: PASS
product_sha: 7d0c4aed09d9f9eaa30b4d07dd680479686a8c0c
base_sha: 48b92409887ac4e7b8c67883918a3fee2d9250c9
claims: C1=known inference preflight failures display their existing recovery reason on stderr in JSON mode; C2=stdout JSON, failure exits, provider inspection and unexpected-error behavior remain intact
covered_by: C1=same native disabled/default/explicit fetch and conflicting embedding inputs before/after; C2=parsed JSON and exit comparison, actual infer list/web providers controls, complete capability consumer and root-renderer tests
entry: node openclaw.mjs infer web fetch --url https://example.invalid --json; explicit unavailable provider; node openclaw.mjs infer embedding create --text probe --provider proof-a --model proof-b/model --json
owner: src/cli/capability-cli/web.ts and embedding.ts classify their own known preflight errors; existing runCapabilityCommand and root failure-output renderer retain output ownership
boundary: subprocess,config-file
readback: native process stdout/stderr and exit codes, independently parsed JSON, provider catalog/list output, isolated config bytes
proof_command: node community-infer-native-proof-20261115.mjs CHECKOUT PHASE; same six CLI operations and fixture bytes, PHASE selects before/after assertions only
harness: frozen SHA256 3b890e8c81d0d86316790db13128413eaa0dfff4272a205ca823aab481abe1c1; complete driver and captured run records embedded in PR body
before: RED 48b92409887ac4e7b8c67883918a3fee2d9250c9 at 2026-11-15T14:07:06.086Z; all4 preflight failures retain the right JSON reason but stderr only suggests Doctor
after: GREEN 7d0c4aed09d9f9eaa30b4d07dd680479686a8c0c at 2026-11-15T15:24:03.532Z; all4 show existing specific stderr reasons, with unchanged JSON and exit1
negative_claim: no
control: native infer list and web providers exit0 with parseable normal output; config bytes unchanged by each command; aggregate suite covers successful embedding dispatch/cleanup and unchanged unexpected failures; focused identity controls retained
consumers: web default and pinned-provider branches covered together; embedding provider/model conflict classified at its owner; old aggregate and embedding-helper assertions updated for shared ExpectedCliError propagation; root renderer/provider implementations untouched
tests: node scripts/run-vitest.mjs src/cli/capability-cli.test.ts src/cli/capability-cli/preflight-errors.test.ts src/cli/failure-output.test.ts src/cli/failure-output.contention.test.ts --maxWorkers=1 --reporter=dot:149passed,exit0; targeted tsgo,typed oxlint,oxfmt,diff pass; exact-head sourcePerformance build exit0
tests_changed: yes
test_cost: final149-test group255.46s wrapper across2shards; native head build234.2s; earlier narrow-test omission and cold preparation timeout disclosed
visual: no
screenshots: N/A: CLI streams only, no GUI layout changes
published: pr-body
not_tested: successful live web/inference calls, upstream vendor API, installed upgrade, macOS/Windows, full release packaging or upstream CI
reuse: baseline48b924 has byte-identical web/embedding/shared/root-output owner blobs to branch base7d7d86bb; native GREEN rebuilt/rerun on committed 7d0c4aed; production diff unchanged by test-only followup
Captured native before/after readback
{
  "before": {
    "status": "PASS",
    "phase": "red",
    "head": "48b92409887ac4e7b8c67883918a3fee2d9250c9",
    "buildCommit": "48b92409887ac4e7b8c67883918a3fee2d9250c9",
    "node": "v24.22.1",
    "capturedAt": "2026-11-15T14:07:06.086Z",
    "driverSha256": "3b890e8c81d0d86316790db13128413eaa0dfff4272a205ca823aab481abe1c1",
    "observations": [
      {
        "args": [
          "infer",
          "web",
          "fetch",
          "--url",
          "https://example.invalid",
          "--json"
        ],
        "exit": 1,
        "stdout": "{\n  \"ok\": false,\n  \"error\": {\n    \"type\": \"cli_error\",\n    \"message\": \"web.fetch is disabled. Set tools.web.fetch.enabled=true to enable it.\"\n  }\n}\n",
        "stderr": "[openclaw] The CLI command failed.\n[openclaw] For help, run `openclaw doctor`.\n",
        "hasActionableStderr": false
      },
      {
        "args": [
          "infer",
          "web",
          "fetch",
          "--url",
          "https://example.invalid",
          "--provider",
          "unavailable-proof-provider",
          "--json"
        ],
        "exit": 1,
        "stdout": "{\n  \"ok\": false,\n  \"error\": {\n    \"type\": \"cli_error\",\n    \"message\": \"web.fetch is disabled. Set tools.web.fetch.enabled=true to enable it.\"\n  }\n}\n",
        "stderr": "[openclaw] The CLI command failed.\n[openclaw] For help, run `openclaw doctor`.\n",
        "hasActionableStderr": false
      },
      {
        "args": [
          "infer",
          "web",
          "fetch",
          "--url",
          "https://example.invalid",
          "--provider",
          "unavailable-proof-provider",
          "--json"
        ],
        "exit": 1,
        "stdout": "{\n  \"ok\": false,\n  \"error\": {\n    \"type\": \"cli_error\",\n    \"message\": \"web.fetch provider \\\"unavailable-proof-provider\\\" is not available; check it with `openclaw infer web providers`.\"\n  }\n}\n",
        "stderr": "[openclaw] The CLI command failed.\n[openclaw] For help, run `openclaw doctor`.\n",
        "hasActionableStderr": false
      },
      {
        "args": [
          "infer",
          "embedding",
          "create",
          "--text",
          "probe",
          "--provider",
          "proof-a",
          "--model",
          "proof-b/model",
          "--json"
        ],
        "exit": 1,
        "stdout": "{\n  \"ok\": false,\n  \"error\": {\n    \"type\": \"cli_error\",\n    \"message\": \"Embedding --provider \\\"proof-a\\\" must match the provider \\\"proof-b\\\" in --model. Model ids that contain a slash need the provider prefix, for example --model proof-a/<model id>.\"\n  }\n}\n",
        "stderr": "[openclaw] The CLI command failed.\n[openclaw] For help, run `openclaw doctor`.\n",
        "hasActionableStderr": false
      },
      {
        "args": [
          "infer",
          "list",
          "--json"
        ],
        "exit": 0,
        "stdout": "[\n  {\n    \"id\": \"model.run\",\n    \"transports\": [\n      \"local\",\n      \"gateway\"\n    ],\n    \"description\": \"Run a one-shot inference turn through the selected model provider.\"\n  },\n  {\n    \"id\": \"model.list\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"List known models from the model catalog.\"\n  },\n  {\n    \"id\": \"model.inspect\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"Inspect one model catalog entry.\"\n  },\n  {\n    \"id\": \"model.providers\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"List model providers discovered from the catalog.\"\n  },\n  {\n    \"id\": \"model.auth.login\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"Run the existing provider auth login flow.\"\n  },\n  {\n    \"id\": \"model.auth.logout\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"Remove saved auth profiles for one provider.\"\n  },\n  {\n    \"id\": \"model.auth.status\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"Show configured model auth state.\"\n  },\n  {\n    \"id\": \"image.generate\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"Generate raster images with configured image providers.\"\n  },\n  {\n    \"id\": \"image.edit\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"Generate edited images from one or more input files.\"\n  },\n  {\n    \"id\": \"image.describe\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"Describe one image file through media-understanding providers.\"\n  },\n  {\n    \"id\": \"image.describe-many\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"Describe multiple image files independently.\"\n  },\n  {\n    \"id\": \"image.providers\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"List image generation providers.\"\n  },\n  {\n    \"id\": \"audio.transcribe\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"Transcribe one audio file.\"\n  },\n  {\n    \"id\": \"audio.providers\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"List audio transcription providers.\"\n  },\n  {\n    \"id\": \"tts.convert\",\n    \"transports\": [\n      \"local\",\n      \"gateway\"\n    ],\n    \"description\": \"Convert text to speech.\"\n  },\n  {\n    \"id\": \"tts.voices\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"List voices for a speech provider.\"\n  },\n  {\n    \"id\": \"tts.providers\",\n    \"transports\": [\n      \"local\",\n      \"gateway\"\n    ],\n    \"description\": \"List speech providers.\"\n  },\n  {\n    \"id\": \"tts.personas\",\n    \"transports\": [\n      \"local\",\n      \"gateway\"\n    ],\n    \"description\": \"List TTS personas.\"\n  },\n  {\n    \"id\": \"tts.status\",\n    \"transports\": [\n      \"gateway\"\n    ],\n    \"description\": \"Show gateway-managed TTS state.\"\n  },\n  {\n    \"id\": \"tts.enable\",\n    \"transports\": [\n      \"local\",\n      \"gateway\"\n    ],\n    \"description\": \"Enable TTS in prefs.\"\n  },\n  {\n    \"id\": \"tts.disable\",\n    \"transports\": [\n      \"local\",\n      \"gateway\"\n    ],\n    \"description\": \"Disable TTS in prefs.\"\n  },\n  {\n    \"id\": \"tts.set-provider\",\n    \"transports\": [\n      \"local\",\n      \"gateway\"\n    ],\n    \"description\": \"Set the active TTS provider.\"\n  },\n  {\n    \"id\": \"tts.set-persona\",\n    \"transports\": [\n      \"local\",\n      \"gateway\"\n    ],\n    \"description\": \"Set the active TTS persona.\"\n  },\n  {\n    \"id\": \"video.generate\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"Generate video files with configured video providers.\"\n  },\n  {\n    \"id\": \"video.describe\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"Describe one video file through media-understanding providers.\"\n  },\n  {\n    \"id\": \"video.providers\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"List video generation and description providers.\"\n  },\n  {\n    \"id\": \"web.search\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"Run provider-backed web search.\"\n  },\n  {\n    \"id\": \"web.fetch\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"Fetch URL content directly or through a selected web fetch provider.\"\n  },\n  {\n    \"id\": \"web.providers\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"List web search and fetch providers.\"\n  },\n  {\n    \"id\": \"embedding.create\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"Create embeddings through embedding providers.\"\n  },\n  {\n    \"id\": \"embedding.providers\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"List embedding providers.\"\n  }\n]\n",
        "stderr": ""
      },
      {
        "args": [
          "infer",
          "web",
          "providers",
          "--json"
        ],
        "exit": 0,
        "stdout": "{\n  \"search\": [\n    {\n      \"available\": true,\n      \"configured\": false,\n      \"selected\": false,\n      \"id\": \"brave\",\n      \"envVars\": [\n        \"BRAVE_API_KEY\"\n      ]\n    },\n    {\n      \"available\": true,\n      \"configured\": false,\n      \"selected\": false,\n      \"id\": \"clawrouter\",\n      \"envVars\": [\n        \"CLAWROUTER_API_KEY\"\n      ]\n    },\n    {\n      \"available\": true,\n      \"configured\": true,\n      \"selected\": false,\n      \"id\": \"codex\",\n      \"envVars\": []\n    },\n    {\n      \"available\": true,\n      \"configured\": false,\n      \"selected\": false,\n      \"id\": \"deepseek\",\n      \"envVars\": [\n        \"DEEPSEEK_API_KEY\"\n      ]\n    },\n    {\n      \"available\": true,\n      \"configured\": true,\n      \"selected\": false,\n      \"id\": \"duckduckgo\",\n      \"envVars\": []\n    },\n    {\n      \"available\": true,\n      \"configured\": false,\n      \"selected\": false,\n      \"id\": \"exa\",\n      \"envVars\": [\n        \"EXA_API_KEY\"\n      ]\n    },\n    {\n      \"available\": true,\n      \"configured\": true,\n      \"selected\": false,\n      \"id\": \"firecrawl-free\",\n      \"envVars\": []\n    },\n    {\n      \"available\": true,\n      \"configured\": false,\n      \"selected\": false,\n      \"id\": \"firecrawl\",\n      \"envVars\": [\n        \"FIRECRAWL_API_KEY\"\n      ]\n    },\n    {\n      \"available\": true,\n      \"configured\": false,\n      \"selected\": false,\n      \"id\": \"gemini\",\n      \"envVars\": [\n        \"GEMINI_API_KEY\"\n      ]\n    },\n    {\n      \"available\": true,\n      \"configured\": false,\n      \"selected\": false,\n      \"id\": \"minimax\",\n      \"envVars\": [\n        \"MINIMAX_CODE_PLAN_KEY\",\n        \"MINIMAX_CODING_API_KEY\",\n        \"MINIMAX_OAUTH_TOKEN\",\n        \"MINIMAX_API_KEY\"\n      ]\n    },\n    {\n      \"available\": true,\n      \"configured\": false,\n      \"selected\": false,\n      \"id\": \"kimi\",\n      \"envVars\": [\n        \"KIMI_API_KEY\",\n        \"MOONSHOT_API_KEY\"\n      ]\n    },\n    {\n      \"available\": true,\n      \"configured\": true,\n      \"selected\": false,\n      \"id\": \"ollama\",\n      \"envVars\": []\n    },\n    {\n      \"available\": true,\n      \"configured\": true,\n      \"selected\": false,\n      \"id\": \"parallel-free\",\n      \"envVars\": []\n    },\n    {\n      \"available\": true,\n      \"configured\": false,\n      \"selected\": false,\n      \"id\": \"parallel\",\n      \"envVars\": [\n        \"PARALLEL_API_KEY\"\n      ]\n    },\n    {\n      \"available\": true,\n      \"configured\": false,\n      \"selected\": false,\n      \"id\": \"perplexity\",\n      \"envVars\": [\n        \"PERPLEXITY_API_KEY\",\n        \"OPENROUTER_API_KEY\"\n      ]\n    },\n    {\n      \"available\": true,\n      \"configured\": true,\n      \"selected\": false,\n      \"id\": \"qa-lab-search\",\n      \"envVars\": []\n    },\n    {\n      \"available\": true,\n      \"configured\": false,\n      \"selected\": false,\n      \"id\": \"searxng\",\n      \"envVars\": [\n        \"SEARXNG_BASE_URL\"\n      ]\n    },\n    {\n      \"available\": true,\n      \"configured\": false,\n      \"selected\": false,\n      \"id\": \"tavily\",\n      \"envVars\": [\n        \"TAVILY_API_KEY\"\n      ]\n    },\n    {\n      \"available\": true,\n      \"configured\": false,\n      \"selected\": false,\n      \"id\": \"grok\",\n      \"envVars\": [\n        \"XAI_API_KEY\"\n      ]\n    }\n  ],\n  \"fetch\": [\n    {\n      \"available\": true,\n      \"configured\": true,\n      \"selected\": false,\n      \"id\": \"firecrawl\",\n      \"envVars\": [\n        \"FIRECRAWL_API_KEY\"\n      ]\n    }\n  ]\n}\n",
        "stderr": ""
      }
    ],
    "configUnchangedByCommands": true,
    "limitations": "Isolated Linux CLI preflight and provider inspection only. No successful inference, live provider, network request or upgrade behavior is claimed."
  },
  "after": {
    "status": "PASS",
    "phase": "green",
    "head": "7d0c4aed09d9f9eaa30b4d07dd680479686a8c0c",
    "buildCommit": "7d0c4aed09d9f9eaa30b4d07dd680479686a8c0c",
    "node": "v24.22.1",
    "capturedAt": "2026-11-15T15:24:03.532Z",
    "driverSha256": "3b890e8c81d0d86316790db13128413eaa0dfff4272a205ca823aab481abe1c1",
    "observations": [
      {
        "args": [
          "infer",
          "web",
          "fetch",
          "--url",
          "https://example.invalid",
          "--json"
        ],
        "exit": 1,
        "stdout": "{\n  \"ok\": false,\n  \"error\": {\n    \"type\": \"cli_error\",\n    \"message\": \"web.fetch is disabled. Set tools.web.fetch.enabled=true to enable it.\"\n  }\n}\n",
        "stderr": "web.fetch is disabled. Set tools.web.fetch.enabled=true to enable it.\n",
        "hasActionableStderr": true
      },
      {
        "args": [
          "infer",
          "web",
          "fetch",
          "--url",
          "https://example.invalid",
          "--provider",
          "unavailable-proof-provider",
          "--json"
        ],
        "exit": 1,
        "stdout": "{\n  \"ok\": false,\n  \"error\": {\n    \"type\": \"cli_error\",\n    \"message\": \"web.fetch is disabled. Set tools.web.fetch.enabled=true to enable it.\"\n  }\n}\n",
        "stderr": "web.fetch is disabled. Set tools.web.fetch.enabled=true to enable it.\n",
        "hasActionableStderr": true
      },
      {
        "args": [
          "infer",
          "web",
          "fetch",
          "--url",
          "https://example.invalid",
          "--provider",
          "unavailable-proof-provider",
          "--json"
        ],
        "exit": 1,
        "stdout": "{\n  \"ok\": false,\n  \"error\": {\n    \"type\": \"cli_error\",\n    \"message\": \"web.fetch provider \\\"unavailable-proof-provider\\\" is not available; check it with `openclaw infer web providers`.\"\n  }\n}\n",
        "stderr": "web.fetch provider \"unavailable-proof-provider\" is not available; check it with `openclaw infer web providers`.\n",
        "hasActionableStderr": true
      },
      {
        "args": [
          "infer",
          "embedding",
          "create",
          "--text",
          "probe",
          "--provider",
          "proof-a",
          "--model",
          "proof-b/model",
          "--json"
        ],
        "exit": 1,
        "stdout": "{\n  \"ok\": false,\n  \"error\": {\n    \"type\": \"cli_error\",\n    \"message\": \"Embedding --provider \\\"proof-a\\\" must match the provider \\\"proof-b\\\" in --model. Model ids that contain a slash need the provider prefix, for example --model proof-a/<model id>.\"\n  }\n}\n",
        "stderr": "Embedding --provider \"proof-a\" must match the provider \"proof-b\" in --model. Model ids that contain a slash need the provider prefix, for example --model proof-a/<model id>.\n",
        "hasActionableStderr": true
      },
      {
        "args": [
          "infer",
          "list",
          "--json"
        ],
        "exit": 0,
        "stdout": "[\n  {\n    \"id\": \"model.run\",\n    \"transports\": [\n      \"local\",\n      \"gateway\"\n    ],\n    \"description\": \"Run a one-shot inference turn through the selected model provider.\"\n  },\n  {\n    \"id\": \"model.list\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"List known models from the model catalog.\"\n  },\n  {\n    \"id\": \"model.inspect\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"Inspect one model catalog entry.\"\n  },\n  {\n    \"id\": \"model.providers\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"List model providers discovered from the catalog.\"\n  },\n  {\n    \"id\": \"model.auth.login\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"Run the existing provider auth login flow.\"\n  },\n  {\n    \"id\": \"model.auth.logout\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"Remove saved auth profiles for one provider.\"\n  },\n  {\n    \"id\": \"model.auth.status\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"Show configured model auth state.\"\n  },\n  {\n    \"id\": \"image.generate\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"Generate raster images with configured image providers.\"\n  },\n  {\n    \"id\": \"image.edit\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"Generate edited images from one or more input files.\"\n  },\n  {\n    \"id\": \"image.describe\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"Describe one image file through media-understanding providers.\"\n  },\n  {\n    \"id\": \"image.describe-many\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"Describe multiple image files independently.\"\n  },\n  {\n    \"id\": \"image.providers\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"List image generation providers.\"\n  },\n  {\n    \"id\": \"audio.transcribe\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"Transcribe one audio file.\"\n  },\n  {\n    \"id\": \"audio.providers\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"List audio transcription providers.\"\n  },\n  {\n    \"id\": \"tts.convert\",\n    \"transports\": [\n      \"local\",\n      \"gateway\"\n    ],\n    \"description\": \"Convert text to speech.\"\n  },\n  {\n    \"id\": \"tts.voices\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"List voices for a speech provider.\"\n  },\n  {\n    \"id\": \"tts.providers\",\n    \"transports\": [\n      \"local\",\n      \"gateway\"\n    ],\n    \"description\": \"List speech providers.\"\n  },\n  {\n    \"id\": \"tts.personas\",\n    \"transports\": [\n      \"local\",\n      \"gateway\"\n    ],\n    \"description\": \"List TTS personas.\"\n  },\n  {\n    \"id\": \"tts.status\",\n    \"transports\": [\n      \"gateway\"\n    ],\n    \"description\": \"Show gateway-managed TTS state.\"\n  },\n  {\n    \"id\": \"tts.enable\",\n    \"transports\": [\n      \"local\",\n      \"gateway\"\n    ],\n    \"description\": \"Enable TTS in prefs.\"\n  },\n  {\n    \"id\": \"tts.disable\",\n    \"transports\": [\n      \"local\",\n      \"gateway\"\n    ],\n    \"description\": \"Disable TTS in prefs.\"\n  },\n  {\n    \"id\": \"tts.set-provider\",\n    \"transports\": [\n      \"local\",\n      \"gateway\"\n    ],\n    \"description\": \"Set the active TTS provider.\"\n  },\n  {\n    \"id\": \"tts.set-persona\",\n    \"transports\": [\n      \"local\",\n      \"gateway\"\n    ],\n    \"description\": \"Set the active TTS persona.\"\n  },\n  {\n    \"id\": \"video.generate\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"Generate video files with configured video providers.\"\n  },\n  {\n    \"id\": \"video.describe\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"Describe one video file through media-understanding providers.\"\n  },\n  {\n    \"id\": \"video.providers\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"List video generation and description providers.\"\n  },\n  {\n    \"id\": \"web.search\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"Run provider-backed web search.\"\n  },\n  {\n    \"id\": \"web.fetch\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"Fetch URL content directly or through a selected web fetch provider.\"\n  },\n  {\n    \"id\": \"web.providers\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"List web search and fetch providers.\"\n  },\n  {\n    \"id\": \"embedding.create\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"Create embeddings through embedding providers.\"\n  },\n  {\n    \"id\": \"embedding.providers\",\n    \"transports\": [\n      \"local\"\n    ],\n    \"description\": \"List embedding providers.\"\n  }\n]\n",
        "stderr": ""
      },
      {
        "args": [
          "infer",
          "web",
          "providers",
          "--json"
        ],
        "exit": 0,
        "stdout": "{\n  \"search\": [\n    {\n      \"available\": true,\n      \"configured\": false,\n      \"selected\": false,\n      \"id\": \"brave\",\n      \"envVars\": [\n        \"BRAVE_API_KEY\"\n      ]\n    },\n    {\n      \"available\": true,\n      \"configured\": false,\n      \"selected\": false,\n      \"id\": \"clawrouter\",\n      \"envVars\": [\n        \"CLAWROUTER_API_KEY\"\n      ]\n    },\n    {\n      \"available\": true,\n      \"configured\": true,\n      \"selected\": false,\n      \"id\": \"codex\",\n      \"envVars\": []\n    },\n    {\n      \"available\": true,\n      \"configured\": false,\n      \"selected\": false,\n      \"id\": \"deepseek\",\n      \"envVars\": [\n        \"DEEPSEEK_API_KEY\"\n      ]\n    },\n    {\n      \"available\": true,\n      \"configured\": true,\n      \"selected\": false,\n      \"id\": \"duckduckgo\",\n      \"envVars\": []\n    },\n    {\n      \"available\": true,\n      \"configured\": false,\n      \"selected\": false,\n      \"id\": \"exa\",\n      \"envVars\": [\n        \"EXA_API_KEY\"\n      ]\n    },\n    {\n      \"available\": true,\n      \"configured\": true,\n      \"selected\": false,\n      \"id\": \"firecrawl-free\",\n      \"envVars\": []\n    },\n    {\n      \"available\": true,\n      \"configured\": false,\n      \"selected\": false,\n      \"id\": \"firecrawl\",\n      \"envVars\": [\n        \"FIRECRAWL_API_KEY\"\n      ]\n    },\n    {\n      \"available\": true,\n      \"configured\": false,\n      \"selected\": false,\n      \"id\": \"gemini\",\n      \"envVars\": [\n        \"GEMINI_API_KEY\"\n      ]\n    },\n    {\n      \"available\": true,\n      \"configured\": false,\n      \"selected\": false,\n      \"id\": \"minimax\",\n      \"envVars\": [\n        \"MINIMAX_CODE_PLAN_KEY\",\n        \"MINIMAX_CODING_API_KEY\",\n        \"MINIMAX_OAUTH_TOKEN\",\n        \"MINIMAX_API_KEY\"\n      ]\n    },\n    {\n      \"available\": true,\n      \"configured\": false,\n      \"selected\": false,\n      \"id\": \"kimi\",\n      \"envVars\": [\n        \"KIMI_API_KEY\",\n        \"MOONSHOT_API_KEY\"\n      ]\n    },\n    {\n      \"available\": true,\n      \"configured\": true,\n      \"selected\": false,\n      \"id\": \"ollama\",\n      \"envVars\": []\n    },\n    {\n      \"available\": true,\n      \"configured\": true,\n      \"selected\": false,\n      \"id\": \"parallel-free\",\n      \"envVars\": []\n    },\n    {\n      \"available\": true,\n      \"configured\": false,\n      \"selected\": false,\n      \"id\": \"parallel\",\n      \"envVars\": [\n        \"PARALLEL_API_KEY\"\n      ]\n    },\n    {\n      \"available\": true,\n      \"configured\": false,\n      \"selected\": false,\n      \"id\": \"perplexity\",\n      \"envVars\": [\n        \"PERPLEXITY_API_KEY\",\n        \"OPENROUTER_API_KEY\"\n      ]\n    },\n    {\n      \"available\": true,\n      \"configured\": true,\n      \"selected\": false,\n      \"id\": \"qa-lab-search\",\n      \"envVars\": []\n    },\n    {\n      \"available\": true,\n      \"configured\": false,\n      \"selected\": false,\n      \"id\": \"searxng\",\n      \"envVars\": [\n        \"SEARXNG_BASE_URL\"\n      ]\n    },\n    {\n      \"available\": true,\n      \"configured\": false,\n      \"selected\": false,\n      \"id\": \"tavily\",\n      \"envVars\": [\n        \"TAVILY_API_KEY\"\n      ]\n    },\n    {\n      \"available\": true,\n      \"configured\": false,\n      \"selected\": false,\n      \"id\": \"grok\",\n      \"envVars\": [\n        \"XAI_API_KEY\"\n      ]\n    }\n  ],\n  \"fetch\": [\n    {\n      \"available\": true,\n      \"configured\": true,\n      \"selected\": false,\n      \"id\": \"firecrawl\",\n      \"envVars\": [\n        \"FIRECRAWL_API_KEY\"\n      ]\n    }\n  ]\n}\n",
        "stderr": ""
      }
    ],
    "configUnchangedByCommands": true,
    "limitations": "Isolated Linux CLI preflight and provider inspection only. No successful inference, live provider, network request or upgrade behavior is claimed."
  }
}
Complete frozen native proof driver

Use the supported Node runtime and independently built checkouts:
node community-infer-native-proof-20261115.mjs CHECKOUT red or green.

import assert from "node:assert/strict";
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import { createHash } from "node:crypto";
import { execFileSync, spawnSync } from "node:child_process";
import { fileURLToPath } from "node:url";

const [repoArg, phase] = process.argv.slice(2);
assert.ok(["red", "green"].includes(phase));
const repo = path.resolve(repoArg);
const head = execFileSync("git", ["rev-parse", "HEAD"], { cwd: repo, encoding: "utf8" }).trim();
const build = JSON.parse(fs.readFileSync(path.join(repo, "dist/build-info.json"), "utf8"));
assert.equal(build.commit, head);
const root = fs.mkdtempSync(path.join(os.tmpdir(), "leon-infer-remedies-"));
fs.chmodSync(root, 0o700);
const workspace = path.join(root, "workspace"); fs.mkdirSync(workspace);
const env = { PATH: process.env.PATH, LANG: "C.UTF-8", NO_COLOR: "1", OPENCLAW_HOME: root,
  OPENCLAW_STATE_DIR: path.join(root, "state"), OPENCLAW_CONFIG_PATH: path.join(root, "openclaw.json"),
  OPENCLAW_NO_RESPAWN: "1", OPENCLAW_SKIP_STARTUP_MODEL_PREWARM: "1",
  XDG_CONFIG_HOME: path.join(root, "xdg-config"), XDG_CACHE_HOME: path.join(root, "xdg-cache") };
const cfg = { meta: { migrations: { skillWorkshopPlugin: true } }, gateway: { mode: "local" },
  agents: { ownership: "explicit", entries: { main: { workspace } }, defaults: { systemAgent: { agentId: "main" } } },
  plugins: { allow: [], slots: { memory: "none" } },
  tools: { web: { fetch: { enabled: false } } }, logging: { consoleLevel: "error", file: path.join(root, "proof.log") } };
let configBytes;
function saveConfig() { configBytes = JSON.stringify(cfg); fs.writeFileSync(env.OPENCLAW_CONFIG_PATH, configBytes, { mode: 0o600 }); }
saveConfig();
const observations = [];
function cli(args) {
  const result = spawnSync(process.execPath, [path.join(repo, "openclaw.mjs"), ...args], { cwd: repo, env, encoding: "utf8", timeout: 90000 });
  assert.equal(result.error, undefined); assert.equal(result.signal, null);
  const clean = value => value.replaceAll(root, "<isolated-state>").replaceAll(repo, "<checkout>").replace(/\/home\/[^\s/:]+/g, "<user-home>");
  const record = { args, exit: result.status, stdout: clean(result.stdout), stderr: clean(result.stderr) };
  observations.push(record); assert.equal(fs.readFileSync(env.OPENCLAW_CONFIG_PATH, "utf8"), configBytes);
  return record;
}
const cases = [
  { args: ["infer", "web", "fetch", "--url", "https://example.invalid", "--json"], reason: "web.fetch is disabled. Set tools.web.fetch.enabled=true to enable it." },
  { args: ["infer", "web", "fetch", "--url", "https://example.invalid", "--provider", "unavailable-proof-provider", "--json"], reason: "web.fetch is disabled. Set tools.web.fetch.enabled=true to enable it." },
  { args: ["infer", "web", "fetch", "--url", "https://example.invalid", "--provider", "unavailable-proof-provider", "--json"], enabled: true, reason: 'web.fetch provider "unavailable-proof-provider" is not available; check it with `openclaw infer web providers`.' },
  { args: ["infer", "embedding", "create", "--text", "probe", "--provider", "proof-a", "--model", "proof-b/model", "--json"], reason: 'Embedding --provider "proof-a" must match the provider "proof-b" in --model.' },
];
for (const item of cases) {
  cfg.tools.web.fetch.enabled = item.enabled === true; saveConfig();
  const result = cli(item.args); assert.equal(result.exit, 1);
  const json = JSON.parse(result.stdout); assert.equal(json.ok, false); assert.ok(json.error.message.includes(item.reason), JSON.stringify(result));
  result.hasActionableStderr = result.stderr.includes(item.reason);
  assert.equal(result.hasActionableStderr, phase === "green", JSON.stringify(result));
}
const list = cli(["infer", "list", "--json"]); assert.equal(list.exit, 0);
assert.ok(JSON.parse(list.stdout).some(entry => entry.id === "embedding.create"));
const providers = cli(["infer", "web", "providers", "--json"]); assert.equal(providers.exit, 0);
const catalog = JSON.parse(providers.stdout); assert.ok(Array.isArray(catalog.search) && Array.isArray(catalog.fetch));
console.log(JSON.stringify({ status: "PASS", phase, head, buildCommit: build.commit, node: process.version,
  capturedAt: new Date().toISOString(), driverSha256: createHash("sha256").update(fs.readFileSync(fileURLToPath(import.meta.url))).digest("hex"),
  observations, configUnchangedByCommands: true,
  limitations: "Isolated Linux CLI preflight and provider inspection only. No successful inference, live provider, network request or upgrade behavior is claimed." }, null, 2));

AI-assisted implementation and author audit. Independent model review was waived by the contributor; no independent-review claim. No sanitized agent transcript is attached because available local logs mix unrelated/private authentication context. Complete reproducible proof and captured readback are provided above.

Merge Risk

Two-way door: reverting this classification change restores prior diagnostics. Provider selection, execution, successful outputs, configuration and persistent state are unchanged. Blast radius is limited to these existing inference preflight failures.

@clawsweeper

clawsweeper Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: S labels Nov 15, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Nov 15, 2026
@clawsweeper

clawsweeper Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Classifies three existing inference preflight guards as expected CLI errors so JSON-mode stderr shows their recovery instructions.

Example: Run openclaw infer web fetch --url https://example.invalid --json with tools.web.fetch.enabled=false.

  • Before: Stderr reports a generic command failure and suggests Doctor.
  • After: Stderr says web.fetch is disabled. Set tools.web.fetch.enabled=true to enable it.; JSON stdout and exit status 1 remain unchanged.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A minimal owner-level repair with real CLI before/after evidence, consolidated red/green regressions and no remaining findings; hosted CI completion remains pending.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): Reviewed current-head receipts exercise the real source CLI against isolated synthetic configuration for all three changed guards in text and JSON modes, showing actionable stderr with unchanged stdout and exit status; historical built-CLI captures also cover pinned-disabled fetch, and current packed-entry proof covers disabled fetch.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Operators using JSON inference commands receive a generic Doctor suggestion instead of the known setting, provider or flag remedy.
Reason: Restores consistent expected-error diagnostics through an established owner without introducing configuration, defaults or APIs.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it provides a focused, correct fix for misleading inference diagnostics that remain on current main; no actionable findings remain, and exact-head CI is running.

Priority: P2
Reviewed head: 08483cd947f1950648f332975bb11392e228634f

Before merge

None.

Findings

None.

Agent review details

How this fits together

The inference CLI validates fetch availability and embedding flags before execution, then forwards errors through the shared command wrapper to the root renderer, which owns stderr diagnostics and JSON failure envelopes.

flowchart TD
  A[Inference CLI arguments] --> B[Web and embedding preflight guards]
  B --> C[Expected CLI error]
  C --> D[Shared command wrapper]
  D --> E[Root failure renderer]
  E --> F[JSON stdout]
  E --> G[Actionable stderr]
Loading

Technical review

Best possible solution:

Keep the existing preflight guards and classify their failures through the shared expected-error helper and root renderer.

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

Current main still throws ordinary Errors at all three guards, which the shared JSON-mode path renders generically; supplied baseline/candidate CLI receipts confirm the failure without executing target code during this review.

Is this the best way to solve the issue?

This is the smallest complete fix: known preflight failures must retain their existing remedies on stderr, and producer-side classification satisfies that invariant without changing rendering, provider execution or arbitrary runtime failures.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 89ee0bd382d1.

Provenance checked

  • Web-fetch availability guards keeps the original intent (bb957f5: Restore default direct fetching while giving disabled-fetch and unavailable-provider failures specific recovery instructions.)
  • Embedding provider/model conflict guard keeps the original intent (bd7686b: Reject conflicting provider/model prefixes before provider creation instead of silently dispatching a different model.)
  • Web cancellation and output settlement keeps the original intent (cac59aa: Forward invocation cancellation and suppress late results through the established capability command wrapper.)
  • Existing regression consumers keeps the original intent (6c5cdc9: Consolidate repeated fixtures while retaining distinct behavioral coverage.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Pinned change and current-main behavior: The introduced diff only replaces three ordinary Error throws with the existing expected-error helper and updates their existing consumer tests; current main retains the ordinary Error throws. (src/cli/capability-cli/web.ts:130, 08483cd947f1)
  • Existing output owner: runCommandWithRuntime forwards expected errors to the root renderer, whose expected-error branch prints producer-owned recovery text while retaining the shared JSON envelope. (src/cli/failure-output.ts, 08483cd947f1)
  • Current-head CLI and regression proof: obviyus supplied baseline/candidate real-CLI receipts for disabled fetch, an unavailable pinned provider and conflicting embedding flags in text and JSON modes, preserving stdout, text diagnostics, exit status and config bytes; the aggregate changed from four intended failures to 118 passing tests, and packed-entry disabled-fetch proof also passed. fix(cli): show actionable inference preflight errors with JSON #199639 (comment). (08483cd947f1)
  • Established sibling implementation: GitHub confirms fix(cli): surface the capability inspect remedy in --json failures #198662 merged the same producer-side classification approach for capability inspection; it does not fix these fetch or embedding guards. (src/cli/capability-cli.ts, 4f20ee5c3977)
  • Feature history and ownership: History spans the original infer implementation and domain split; bounded current-main blame attributes the fetch remedies to bb957f5 and the embedding conflict guard to bd7686b. An unbounded content search reached unavailable older blobs; the touched guards have verified provenance. (src/cli/capability-cli/web.ts:129, 89ee0bd382d1)
  • Current CI state: Checks are executing on the reviewed head; the CI gate reports that CI must complete successfully, while dependency and sensitive-product review statuses pass. This establishes no diff-caused CI failure. (08483cd947f1)

Likely related people:

  • Peter Steinberger: Raw commit bb957f5 adds src/cli/capability-cli/web.ts:130 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: bb957f57ca2d; files: src/cli/capability-cli/web.ts)

PR surface

Source +2, Tests -1. Total +1 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 5 3 +2
Tests 2 20 21 -1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 25 24 +1

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Production versus test changes Production +5/-3; tests +20/-21 Two imports enable reuse of the existing error owner, while regression coverage stays in existing suites with no net test growth.

Labels

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.
  • remove status: ⏳ waiting on maintainer: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: Misleading diagnostics affect bounded inference CLI failures; machine-readable failure details and nonzero exits already work.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (2 earlier review cycles)
  • reviewed 2026-11-15T15:01:49.432Z sha d983d9b :: needs changes before merge. :: [P2] Update the existing consumers for expected-error propagation
  • reviewed 2026-11-15T15:32:39.052Z sha 7d0c4ae :: blocked before merge. :: none

Reviewed November 15, 2026, 11:55 AM ET / 16:55 UTC (Revision 3).

@Leon-SK668

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Updated head 7d0c4aed09d9f9eaa30b4d07dd680479686a8c0c addresses the existing-consumer finding: the web/embedding cases now assert expected-error propagation, and the duplicate successful-embedding arm is removed. All 149 selected capability/root-renderer tests and targeted static checks pass. The native CLI proof was rebuilt and rerun on this head; complete readback and the frozen driver are in the updated PR body. Main CI still awaits maintainer workflow approval; no upstream CI pass is claimed.

@clawsweeper

clawsweeper Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Nov 15, 2026
@obviyus

obviyus commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

Validated head 08483cd947f1950648f332975bb11392e228634f, retaining both of Leon-SK668's human commits.

All final checks ran on the host through ocx. The merge-base diff contains only the two capability owners and two existing test files; no package manifest, lockfile, workspace, npmrc, scripts, patches or hooks changed. Runtime proof used an isolated HOME/profile and synthetic configuration, with no provider credentials, Gateway or model.

Before / after

Baseline 7d7d86bb79ca24bfaf9343290cb22f80d705ab20; the affected owners and existing tests matched sampled main febd4dcc21c4ecb590227eda7b2488b382f8eae5 before applying the regression assertions.

vitest-source: the same capability-cli.test.ts aggregate, including its registered embedding cases, produced 4 intended failures / 114 passes on baseline and 118/118 passes on candidate. Baseline failures were the ExpectedCliError classifications for default-disabled fetch, pinned-disabled fetch, unavailable pinned fetch and conflicting embedding flags. Cold wrapper wall times: about 190s baseline / 169s candidate.

source: the real CLI ran these three preflights once per side, each in text and JSON mode (six cases per side). Commands use the current registered --url, embedding create and --text syntax:

ocx src -- --profile p199639proof infer web fetch --url https://example.invalid
  # tools.web.fetch.enabled=false
ocx src -- --profile p199639proof infer web fetch --url https://example.invalid --provider nosuch
  # tools.web.fetch.enabled=true
ocx src -- --profile p199639proof infer embedding create --provider openai --model voyage/x --text hi

With --json, baseline stderr was always:

[openclaw] The CLI command failed.
[openclaw] For help, run `openclaw --profile p199639proof doctor`.

Candidate stderr contained exactly the existing message:

web.fetch is disabled. Set tools.web.fetch.enabled=true to enable it.
web.fetch provider "nosuch" is not available; check it with `openclaw infer web providers`.
Embedding --provider "openai" must match the provider "voyage" in --model. Model ids that contain a slash need the provider prefix, for example --model openai/<model id>.

Controls passed for every case: exit 1 on both sides; JSON stdout byte-identical; text-mode stdout/stderr byte-identical; configuration bytes unchanged. Example unchanged JSON:

{"ok":false,"error":{"type":"cli_error","message":"web.fetch is disabled. Set tools.web.fetch.enabled=true to enable it."}}

No provider request

A passive runtime preload recorded calls to fetch, HTTP(S), socket-connect, DNS and Undici request APIs, forwarding calls to their original implementations without changing responses or injecting errors. It loaded in the CLI and its Node children. A real loopback HTTP positive control returned observer-ok and recorded a fetch call on each side. All six guarded CLI cases per side recorded zero watched network API calls. No provider response was mocked for those cases. The guards remain before tool execution or embedding-provider creation; existing unit assertions retain the no-provider/no-output boundary.

One candidate setup attempt was stopped before CLI execution because placing the observation option in ocx's own environment changed its dependency-cache key. Observation was moved into the runtime launcher, after dependency preparation; the final source matrix passed against the normal shared install. No product code changed for that correction.

Packaging and test consolidation

full: ocx build --dts passed. Offline packed-entry/layout smoke passed version, help and the disabled-fetch JSON guard through extracted openclaw.mjs, without the observer preload. It reused the ocx-installed dependency closure, not a fresh dependency installation. Version: OpenClaw 2026.11.3 (08483cd). Tarball SHA-256: 875e62e734ab1b80d405f883eca218db2a1db09522562bef3e5217998c5b039a.

Matching test typecheck (test/tsconfig/tsconfig.core.test.config-cli.json) and focused format check passed. Source messages, provider selection and call ordering are unchanged.

Removed the new 132-line standalone fixture. The existing aggregate now covers all fetch-availability branches, and its existing embedding helper covers the conflict. Existing embedding success, cleanup-failure and cancellation cases remain. The removed raw-error duplication belongs to the unchanged shared error renderer/forwarder.

Whole-PR deltas: production +5/-3, tests +20/-21 (net -1), four files, no allocation record. No new message text. Worktrunk/commit hooks were disabled and packing skipped lifecycle scripts. The abandoned ocx dependency-setup attempt did run unchanged dependency lifecycle scripts on the host; no Git or Worktrunk hooks ran. No live vendor API, successful live inference or fresh dependency-install behavior is claimed.

@obviyus

obviyus commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked. labels Nov 15, 2026
@obviyus
obviyus merged commit a403492 into openclaw:main Nov 15, 2026
126 of 130 checks passed
@obviyus

obviyus commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator

Landed in a403492. Thanks @Leon-SK668.

@Leon-SK668

Copy link
Copy Markdown
Contributor Author

Thanks @obviyus for folding the regressions into the existing suite and validating the real CLI path.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 16, 2026
…law#199639)

fix(cli): report infer preflight errors through the expected-error path

`openclaw infer ... --json` threw plain errors for three checks that run before any request (web fetch disabled, a pinned web fetch provider that is unavailable, and an embedding `--provider` that conflicts with the provider in `--model`), so `--json` stderr showed the generic failure plus the Doctor hint instead of the existing message. The three checks now use the expected-error path with the same messages, following openclaw#198662. No new text.

Evidence: host, isolated config, no network or provider credentials. Source CLI with --json and in text mode: `infer web fetch --url https://example.invalid` with web fetch disabled, `infer web fetch --url ... --provider nosuch`, and `infer embedding create --provider openai --model voyage/x --text hi`. Base prints the generic failure and Doctor hint, this change prints the existing message; text mode, JSON stdout and exit codes are identical, and neither side made a network call (positive control confirmed the watcher). Vitest-source: four cases fail on base, 118 pass here; typecheck, full build and packed smoke pass. Receipts: openclaw#199639 (comment).

Thanks @Leon-SK668.

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

Labels

cli CLI command changes P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants