From dc2bfcedc765ff867227d0c66ae8e1a5b42d65b5 Mon Sep 17 00:00:00 2001 From: Sawyer Cutler Date: Fri, 11 Sep 2026 20:05:15 -0700 Subject: [PATCH] Remove the workflow field from profile files --- CHANGELOG.md | 6 ++++++ docs/IMPLEMENTATION.md | 2 +- src/config/index.ts | 3 --- src/config/profiles.ts | 1 - src/profiles.test.ts | 8 ++++++++ tests/unit/config.test.ts | 15 +++++++++++++++ 6 files changed, 30 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 228bf6dd5..3a7c30f46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,12 @@ parallel copies under `docs/` or `scripts/notes/`. At cut time: rename ## [Unreleased] +### Removed + +- Profile files no longer accept a `workflow` field. Workflows start only from + slash commands; a leftover key is rejected on load rather than ignored. The + `--no-workflow` CLI flag is unchanged. + ## [0.3.22] - 2026-09-11 ### Added diff --git a/docs/IMPLEMENTATION.md b/docs/IMPLEMENTATION.md index 92dd447d2..e56fd45fc 100644 --- a/docs/IMPLEMENTATION.md +++ b/docs/IMPLEMENTATION.md @@ -347,7 +347,7 @@ Profiles supply per-project or named-profile overrides for `model`, `systemPromp } ``` -`resolveProfile` merges a named profile with the project profile, with **project profile field values overriding the named profile's**. The resolved `model` feeds into provider resolution and the director; `systemPromptExtensions` are appended to the system prompt. Workflow profile metadata is deprecated because workflows are started only by explicit slash commands. CLI flags (`--model`, `--profile`) still win over profile values during config resolution. +`resolveProfile` merges a named profile with the project profile, with **project profile field values overriding the named profile's**. The resolved `model` feeds into provider resolution and the director; `systemPromptExtensions` are appended to the system prompt. CLI flags (`--model`, `--profile`) still win over profile values during config resolution. ### Provider Configuration diff --git a/src/config/index.ts b/src/config/index.ts index 2552bdd36..9396d4619 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -506,8 +506,6 @@ export interface Config { */ resumeMode?: "id" | "pick"; - // Deprecated workflow profile metadata; workflows are manual-only slash commands. - workflow?: string; // Deprecated no-op retained for CLI compatibility. noWorkflow: boolean; /** @@ -988,7 +986,6 @@ export async function loadConfig( noWorkflow, ...(resumeMode !== undefined ? { resumeMode, skipInitialTask } : {}), ...(resumePicker ? { resumePicker: true } : {}), - ...(profile.workflow !== undefined ? { workflow: profile.workflow } : {}), ...(settings?.defaultProvider !== undefined ? { globalDefaultProvider: settings.defaultProvider } : {}), diff --git a/src/config/profiles.ts b/src/config/profiles.ts index 33433b2da..5cb25c29a 100644 --- a/src/config/profiles.ts +++ b/src/config/profiles.ts @@ -8,7 +8,6 @@ const ProfileSchema = type({ "profile?": "string", "model?": "string", "systemPromptExtensions?": "string[]", - "workflow?": "string", // Per-call inactivity timeout in milliseconds. If the provider yields no // inference event for this many ms, the call is aborted and the user sees // "Request timed out". Default in the inference harness is 120_000 (2 min). diff --git a/src/profiles.test.ts b/src/profiles.test.ts index b28e41eec..bcb353206 100644 --- a/src/profiles.test.ts +++ b/src/profiles.test.ts @@ -65,6 +65,14 @@ test("loadProfile rejects unknown keys", async () => { await expect(loadProfile(path)).rejects.toThrow(/unknownKey must be removed/); }); +test("loadProfile rejects a workflow field", async () => { + const dir = makeTmp(); + await mkdir(dir, { recursive: true }); + const path = join(dir, "profile.json"); + await writeJson(path, { workflow: "build" }); + await expect(loadProfile(path)).rejects.toThrow(/workflow must be removed/); +}); + test("loadProfile rejects non-array systemPromptExtensions", async () => { const dir = makeTmp(); await mkdir(dir, { recursive: true }); diff --git a/tests/unit/config.test.ts b/tests/unit/config.test.ts index e67953e64..051a57b6a 100644 --- a/tests/unit/config.test.ts +++ b/tests/unit/config.test.ts @@ -81,6 +81,21 @@ test("loadConfig --no-auto disables auto mode", async () => { }); }); +test("loadConfig --no-workflow remains a recognized flag", async () => { + await withSettings(async ({ cwd, globalSettingsPath }) => { + const { impl } = offlineFetch(); + const config = await loadConfig( + ["--cwd", cwd, "--no-workflow", "do something"], + { + globalSettingsPath, + pricing: { fetchImpl: impl }, + }, + ); + expect(config.configured).toBe(true); + if (config.configured) expect(config.noWorkflow).toBe(true); + }); +}); + test("loadConfig uses the injected pricing fetchImpl instead of the network", async () => { await withSettings(async ({ cwd, globalSettingsPath }) => { resetPricingMetadataRefreshForTests();