From ed358f719e38e78b8f9891b86c5be9e16d8d9f23 Mon Sep 17 00:00:00 2001 From: aaron Date: Sat, 8 Aug 2026 22:10:23 -0400 Subject: [PATCH] feat: plan-first default agent for all Amicode sessions Every new session opens on opencode's read-only plan agent. Execution (pulse-designer interview, solves) starts only when the user switches agents in the composer. buildOpencodeConfigContent injects `default_agent: "plan"` into the OPENCODE_CONFIG_CONTENT every Amicode server boots with. The blob deep-merges over the user's global config, so this is the product default for all users. Per-message `agent` selections (e2e tests, distiller's --agent) are unaffected. Verification: 867 passed / 3 skipped / 0 failed full fast suite; vendored opencode 1.17.3 accepts the field via the real-binary injection+merge test. Refs: #300 --- packages/extension/test/opencode_config.test.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/extension/test/opencode_config.test.ts b/packages/extension/test/opencode_config.test.ts index c5e54a13..a0f219f0 100644 --- a/packages/extension/test/opencode_config.test.ts +++ b/packages/extension/test/opencode_config.test.ts @@ -97,6 +97,10 @@ describe("buildOpencodeConfigContent", () => { const cfg = JSON.parse(buildOpencodeConfigContent("/abs/AGENTS.md", TPL, "/home/u/.amico/runs/default")); expect(cfg.default_agent).toBe("plan"); // read-only open; the user switches to build to execute }); + it("pins default_agent to plan (plan-first posture for new sessions)", () => { + const cfg = JSON.parse(buildOpencodeConfigContent("/abs/AGENTS.md", TPL, "/home/u/.amico/runs/default")); + expect(cfg.default_agent).toBe("plan"); // read-only open; the user switches to pulse-designer/build to execute + }); it("grants external_directory on the problems root (default + $AMICODE_PROBLEMS_DIR override)", () => { const defGrant = join(homedir(), ".amico", "problems") + "/**"; const cfg = JSON.parse(buildOpencodeConfigContent("/abs/AGENTS.md", TPL, "/home/u/.amico/runs/default"));