Compare commits

...

2 Commits

Author SHA1 Message Date
Peter Steinberger
860dc74639 fix: adjust systemd ExecStart escape test (#995) (thanks @roshanasingh4) 2026-01-16 06:03:17 +00:00
Roshan Singh
97acca47ac Fix systemd ExecStart parsing whitespace 2026-01-16 05:41:30 +00:00
3 changed files with 40 additions and 1 deletions

View File

@ -26,6 +26,7 @@
- Fix: guard model fallback against undefined provider/model values. (#954) — thanks @roshanasingh4. - 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: 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: 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. - 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. - 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`. - Browser: add `snapshot refs=aria` (Playwright aria-ref ids) for self-resolving refs across `snapshot``act`.

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",
]);
});
});

View File

@ -76,7 +76,7 @@ export function parseSystemdExecStart(value: string): string[] {
inQuotes = !inQuotes; inQuotes = !inQuotes;
continue; continue;
} }
if (!inQuotes && /\\s/.test(char)) { if (!inQuotes && /\s/.test(char)) {
if (current) { if (current) {
args.push(current); args.push(current);
current = ""; current = "";