From 963d4f92400c6511fc58fd1b44fb162c9d29d0af Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Tue, 28 Jul 2026 16:30:50 +0200 Subject: [PATCH] Configure agent thinking from the CLI (#2533) * feat(cli): update agent thinking from the CLI * fix(cli): harden agent thinking updates * feat(cli): configure thinking for schedules * fix(cli): report applied thinking updates * fix(cli): report current agent thinking state --- packages/cli/src/cli-surface.test.ts | 13 ++ packages/cli/src/commands/agent/index.ts | 3 +- .../cli/src/commands/agent/update.test.ts | 108 +++++++++++++ packages/cli/src/commands/agent/update.ts | 148 ++++++++++++++---- packages/cli/src/commands/schedule/create.ts | 2 + packages/cli/src/commands/schedule/index.ts | 1 + .../cli/src/commands/schedule/shared.test.ts | 19 +++ packages/cli/src/commands/schedule/shared.ts | 14 +- packages/cli/tests/16-agent-update.test.ts | 25 +++ packages/cli/tests/31-loop-schedule.test.ts | 3 + .../messages.project-command-center.test.ts | 10 ++ packages/protocol/src/messages.ts | 2 + .../server/src/server/websocket-server.ts | 2 + 13 files changed, 319 insertions(+), 31 deletions(-) create mode 100644 packages/cli/src/commands/agent/update.test.ts diff --git a/packages/cli/src/cli-surface.test.ts b/packages/cli/src/cli-surface.test.ts index 9011c23b3..c480fe824 100644 --- a/packages/cli/src/cli-surface.test.ts +++ b/packages/cli/src/cli-surface.test.ts @@ -35,6 +35,19 @@ describe("canonical CLI surface", () => { expect(run?.helpInformation()).not.toContain("--detach"); }); + it("offers thinking configuration when running, updating, and scheduling agents", () => { + const cli = createCli(); + const run = cli.commands.find((command) => command.name() === "run"); + const agent = cli.commands.find((command) => command.name() === "agent"); + const update = agent?.commands.find((command) => command.name() === "update"); + const schedule = cli.commands.find((command) => command.name() === "schedule"); + const scheduleCreate = schedule?.commands.find((command) => command.name() === "create"); + + expect(run?.helpInformation()).toContain("--thinking "); + expect(update?.helpInformation()).toContain("--thinking "); + expect(scheduleCreate?.helpInformation()).toContain("--thinking "); + }); + it("offers opening an existing agent in the desktop app", () => { const agent = createCli().commands.find((command) => command.name() === "agent"); const open = agent?.commands.find((command) => command.name() === "open"); diff --git a/packages/cli/src/commands/agent/index.ts b/packages/cli/src/commands/agent/index.ts index a0fd5d5de..85d34ef91 100644 --- a/packages/cli/src/commands/agent/index.ts +++ b/packages/cli/src/commands/agent/index.ts @@ -92,9 +92,10 @@ export function createAgentCommand(): Command { addJsonAndDaemonHostOptions( agent .command("update") - .description("Update an agent's metadata") + .description("Update an agent's settings or metadata") .argument("", "Agent ID (or prefix)") .option("--name ", "Update the agent's display name") + .option("--thinking ", "Update the agent's thinking option ID") .option( "--label