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..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,6 +961,15 @@ export async function loadConfig( auto = false; continue; } + // 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", + ); + continue; + } if (arg === "-p") { continue; } diff --git a/src/config/settings.test.ts b/src/config/settings.test.ts index 6ae6eb026..2f3a6d11b 100644 --- a/src/config/settings.test.ts +++ b/src/config/settings.test.ts @@ -215,6 +215,38 @@ test("loadConfig --no-auto disables auto mode", async () => { }); }); +// 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"], + 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.", + ); + } finally { + stderr.restore(); + } + }); +}); + test("loadConfig uses the injected pricing fetchImpl instead of the network", async () => { await withSettings(async ({ cwd, globalSettingsPath }) => { resetPricingMetadataRefreshForTests();