From 09a40d06a1f2f41798be0b6b87cccb827c416046 Mon Sep 17 00:00:00 2001 From: Sawyer Cutler Date: Fri, 16 Oct 2026 18:19:02 -0700 Subject: [PATCH 1/2] fix(config): restore --no-workflow as warn-and-ignore shim --- docs/IMPLEMENTATION.md | 1 + src/config/index.ts | 9 +++++++++ src/config/settings.test.ts | 25 +++++++++++++++++++++++++ 3 files changed, 35 insertions(+) diff --git a/docs/IMPLEMENTATION.md b/docs/IMPLEMENTATION.md index f2b50e471..202a1bdf1 100644 --- a/docs/IMPLEMENTATION.md +++ b/docs/IMPLEMENTATION.md @@ -444,6 +444,7 @@ Printed by `corbits --help` / `-h` from `CLI_HELP_TEXT` in `src/config/index.ts` | `--dangerously-skip-permissions`, `--yolo` | false | Process-only aliases that auto-allow anything not denied by the authorization layer (gate + pre-gate workspace sandboxes; secret-guard / authz hard denies remain). `/yolo [on\|off\|toggle]` persists to the active settings file instead. | | `--auto` | true (default) | Force auto mode on (workspace writes + unconstrained shell without prompts) | | `--no-auto` | false | Start with auto mode off (ask on every consequential action); no in-session key toggles it | +| `--no-workflow` | — | Deprecated no-op: accepted with a stderr warning and ignored (kept for one release so existing wrappers keep starting; will become `unrecognized flag` after removal) | | `--help`, `-h` | — | Show help (exit 0 via `CliHelpError`) | | `--version`, `-V` | — | Print `corbits v` plus the running `package.json` version (exit 0 via `CliVersionError`) | diff --git a/src/config/index.ts b/src/config/index.ts index 9d8f60ce8..a6b2be149 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -960,6 +960,15 @@ export async function loadConfig( auto = false; continue; } + // CL-10755: deprecated no-op retained for one release as warn-and-ignore + // so existing `--no-workflow` wrappers keep starting instead of hitting + // the catch-all "unrecognized flag" error below. + if (arg === "--no-workflow") { + process.stderr.write( + "--no-workflow is deprecated and has no effect; ignoring.\n", + ); + continue; + } if (arg === "-p") { continue; } diff --git a/src/config/settings.test.ts b/src/config/settings.test.ts index 6ae6eb026..9c5429463 100644 --- a/src/config/settings.test.ts +++ b/src/config/settings.test.ts @@ -215,6 +215,31 @@ test("loadConfig --no-auto disables auto mode", async () => { }); }); +// CL-10755: --no-workflow is a deprecated no-op. It must stay accepted for +// one release (stderr warn-and-ignore) instead of hitting the catch-all +// "unrecognized flag" error. +test("loadConfig --no-workflow warns and is ignored", async () => { + await withSettings(async ({ cwd, globalSettingsPath }) => { + const { impl } = offlineFetch(); + const stderr = captureStderr(); + try { + const config = await loadConfig( + ["--cwd", cwd, "--no-workflow", "do something"], + { + globalSettingsPath, + pricing: { fetchImpl: impl }, + }, + ); + expect(config.configured).toBe(true); + expect(stderr.output()).toContain( + "--no-workflow is deprecated and has no effect; ignoring.", + ); + } finally { + stderr.restore(); + } + }); +}); + test("loadConfig uses the injected pricing fetchImpl instead of the network", async () => { await withSettings(async ({ cwd, globalSettingsPath }) => { resetPricingMetadataRefreshForTests(); From f0809436db786a602b6902b453ff0e7fb4388b5d Mon Sep 17 00:00:00 2001 From: Sawyer Cutler Date: Fri, 16 Oct 2026 18:33:15 -0700 Subject: [PATCH 2/2] fix(config): lock the ignored --no-workflow shim --- src/config/index.ts | 7 ++++--- src/config/settings.test.ts | 21 ++++++++++++++------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/config/index.ts b/src/config/index.ts index a6b2be149..17cbbc77c 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -750,6 +750,7 @@ Flags: the default settings file is machine-wide; --config selects another source --auto / --no-auto auto mode on/off + --no-workflow deprecated and ignored --help, -h show this help --version, -V show version `; @@ -960,9 +961,9 @@ export async function loadConfig( auto = false; continue; } - // CL-10755: deprecated no-op retained for one release as warn-and-ignore - // so existing `--no-workflow` wrappers keep starting instead of hitting - // the catch-all "unrecognized flag" error below. + // Warn-and-ignore so existing `--no-workflow` wrappers keep starting + // instead of the unrecognized-flag error. Do not consume the next token + // or set a config field. if (arg === "--no-workflow") { process.stderr.write( "--no-workflow is deprecated and has no effect; ignoring.\n", diff --git a/src/config/settings.test.ts b/src/config/settings.test.ts index 9c5429463..2f3a6d11b 100644 --- a/src/config/settings.test.ts +++ b/src/config/settings.test.ts @@ -215,22 +215,29 @@ test("loadConfig --no-auto disables auto mode", async () => { }); }); -// CL-10755: --no-workflow is a deprecated no-op. It must stay accepted for -// one release (stderr warn-and-ignore) instead of hitting the catch-all -// "unrecognized flag" error. +// Warn-and-ignore: the flag must not consume the following task token or +// change parsed command/auto versus the same argv without it. test("loadConfig --no-workflow warns and is ignored", async () => { await withSettings(async ({ cwd, globalSettingsPath }) => { const { impl } = offlineFetch(); const stderr = captureStderr(); try { + const options = { + globalSettingsPath, + pricing: { fetchImpl: impl }, + }; const config = await loadConfig( ["--cwd", cwd, "--no-workflow", "do something"], - { - globalSettingsPath, - pricing: { fetchImpl: impl }, - }, + options, + ); + const baseline = await loadConfig( + ["--cwd", cwd, "do something"], + options, ); expect(config.configured).toBe(true); + expect(config.task).toBe(baseline.task); + expect(config.command).toBe(baseline.command); + expect(config.auto).toBe(baseline.auto); expect(stderr.output()).toContain( "--no-workflow is deprecated and has no effect; ignoring.", );