diff --git a/src/commands/agent-via-gateway.test.ts b/src/commands/agent-via-gateway.test.ts index 3dfc1429718b..c445130581bc 100644 --- a/src/commands/agent-via-gateway.test.ts +++ b/src/commands/agent-via-gateway.test.ts @@ -1766,6 +1766,27 @@ describe("agentCliCommand", () => { }); }); + it("preserves inline message whitespace for local embedded runs", async () => { + await withTempStore(async () => { + mockLocalAgentReply(); + + await agentCliCommand( + { + message: " keep spaces ", + to: "+1555", + local: true, + }, + runtime, + ); + + const localOpts = requireRecord( + requireFirstCallArg(agentCommand, "embedded agent"), + "embedded agent options", + ); + expect(localOpts.message).toBe(" keep spaces "); + }); + }); + it("passes explicit session keys to local embedded runs", async () => { await withTempStore(async () => { mockLocalAgentReply(); diff --git a/src/commands/agent-via-gateway.ts b/src/commands/agent-via-gateway.ts index e4cb7fb1c8cb..81824459371d 100644 --- a/src/commands/agent-via-gateway.ts +++ b/src/commands/agent-via-gateway.ts @@ -229,8 +229,8 @@ async function resolveAgentMessageOpts(opts: AgentCliOpts): Promise