fix(cli): preserve equals in root option values [AI-assisted] (#84107) · openclaw/openclaw@d916f17
clawsweeper
·
2026-05-19
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -10,6 +10,7 @@ Docs: https://docs.openclaw.ai
|
10 | 10 | |
11 | 11 | ### Fixes |
12 | 12 | |
| 13 | +- CLI: preserve embedded equals signs in inline root option values instead of truncating after the second separator. (#83995) Thanks @ThiagoCAltoe. |
13 | 14 | - Providers/Ollama: default unknown-capabilities models to tool-capable so discovered native Ollama models can use tools when `/api/show` omits capabilities. (#84055) Thanks @dutifulbob. |
14 | 15 | - Installer/Windows: launch `install.ps1` onboarding as an attached child process so fresh native Windows installs do not freeze visibly at `Starting setup...` or corrupt the wizard's terminal rendering. |
15 | 16 | - Memory/search: close local embedding providers when active-memory searches time out so pending local model loads and embedding contexts are aborted and released. (#83858) Thanks @brokemac79. |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +import { describe, expect, it } from "vitest"; |
| 2 | +import { takeCliRootOptionValue } from "./root-option-value.js"; |
| 3 | + |
| 4 | +describe("takeCliRootOptionValue", () => { |
| 5 | +it("preserves equals signs after the first separator", () => { |
| 6 | +expect(takeCliRootOptionValue("--token=abc=def", undefined)).toEqual({ |
| 7 | +value: "abc=def", |
| 8 | +consumedNext: false, |
| 9 | +}); |
| 10 | +expect(takeCliRootOptionValue("--token=abc==", undefined)).toEqual({ |
| 11 | +value: "abc==", |
| 12 | +consumedNext: false, |
| 13 | +}); |
| 14 | +}); |
| 15 | + |
| 16 | +it("treats empty inline values as missing", () => { |
| 17 | +expect(takeCliRootOptionValue("--token=", "fallback")).toEqual({ |
| 18 | +value: null, |
| 19 | +consumedNext: false, |
| 20 | +}); |
| 21 | +}); |
| 22 | + |
| 23 | +it("continues to consume the next token for space-separated values", () => { |
| 24 | +expect(takeCliRootOptionValue("--token", "abc=def")).toEqual({ |
| 25 | +value: "abc=def", |
| 26 | +consumedNext: true, |
| 27 | +}); |
| 28 | +}); |
| 29 | +}); |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -8,7 +8,7 @@ export function takeCliRootOptionValue(
|
8 | 8 | consumedNext: boolean; |
9 | 9 | } { |
10 | 10 | if (raw.includes("=")) { |
11 | | -const [, value] = raw.split("=", 2); |
| 11 | +const value = raw.slice(raw.indexOf("=") + 1); |
12 | 12 | const trimmed = (value ?? "").trim(); |
13 | 13 | return { value: trimmed || null, consumedNext: false }; |
14 | 14 | } |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。