Compare commits

...
3 changed files with 40 additions and 1 deletions

No files matched your search

+1
View File
@@ -26,6 +26,7 @@
- Fix: guard model fallback against undefined provider/model values. (#954) — thanks @roshanasingh4.
- Fix: refactor session store updates, add chat.inject, and harden subagent cleanup flow. (#944) — thanks @tyler6204.
- Fix: clean up suspended CLI processes across backends. (#978) — thanks @Nachx639.
- Fix: parse systemd ExecStart arguments when whitespace is present. (#995) — thanks @roshanasingh4.
- CLI: add `--json` output for `clawdbot daemon` lifecycle/install commands.
- Memory: make `node-llama-cpp` an optional dependency (avoid Node 25 install failures) and improve local-embeddings fallback/errors.
- Browser: add `snapshot refs=aria` (Playwright aria-ref ids) for self-resolving refs across `snapshot` → `act`.
+38
View File
@@ -0,0 +1,38 @@
import { describe, expect, it } from "vitest";
import { parseSystemdExecStart } from "./systemd-unit.js";
describe("parseSystemdExecStart", () => {
it("splits on whitespace outside quotes", () => {
const execStart = "/usr/bin/clawdbot gateway start --foo bar";
expect(parseSystemdExecStart(execStart)).toEqual([
"/usr/bin/clawdbot",
"gateway",
"start",
"--foo",
"bar",
]);
});
it("preserves quoted arguments", () => {
const execStart = "/usr/bin/clawdbot gateway start --name \"My Bot\"";
expect(parseSystemdExecStart(execStart)).toEqual([
"/usr/bin/clawdbot",
"gateway",
"start",
"--name",
"My Bot",
]);
});
it("preserves backslashes in arguments", () => {
const execStart = String.raw`/usr/bin/clawdbot gateway start --path \/tmp\/clawdbot`;
expect(parseSystemdExecStart(execStart)).toEqual([
"/usr/bin/clawdbot",
"gateway",
"start",
"--path",
"\\/tmp\\/clawdbot",
]);
});
});
+1 -1
View File
@@ -76,7 +76,7 @@ export function parseSystemdExecStart(value: string): string[] {
inQuotes = !inQuotes;
continue;
}
if (!inQuotes && /\\s/.test(char)) {
if (!inQuotes && /\s/.test(char)) {
if (current) {
args.push(current);
current = "";