Skip to content

Commit a7dfdd9

Browse files
Merge pull request #1475 from corbitsdev/cl-10755-no-workflow-shim
fix(config): restore --no-workflow as warn-and-ignore shim
2 parents cb23247 + f080943 commit a7dfdd9

3 files changed

Lines changed: 43 additions & 0 deletions

File tree

‎docs/IMPLEMENTATION.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,7 @@ Printed by `corbits --help` / `-h` from `CLI_HELP_TEXT` in `src/config/index.ts`
444444
| `--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. |
445445
| `--auto` | true (default) | Force auto mode on (workspace writes + unconstrained shell without prompts) |
446446
| `--no-auto` | false | Start with auto mode off (ask on every consequential action); no in-session key toggles it |
447+
| `--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) |
447448
| `--help`, `-h` | — | Show help (exit 0 via `CliHelpError`) |
448449
| `--version`, `-V` | — | Print `corbits v` plus the running `package.json` version (exit 0 via `CliVersionError`) |
449450

‎src/config/index.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,7 @@ Flags:
750750
the default settings file is machine-wide;
751751
--config selects another source
752752
--auto / --no-auto auto mode on/off
753+
--no-workflow deprecated and ignored
753754
--help, -h show this help
754755
--version, -V show version
755756
`;
@@ -960,6 +961,15 @@ export async function loadConfig(
960961
auto = false;
961962
continue;
962963
}
964+
// Warn-and-ignore so existing `--no-workflow` wrappers keep starting
965+
// instead of the unrecognized-flag error. Do not consume the next token
966+
// or set a config field.
967+
if (arg === "--no-workflow") {
968+
process.stderr.write(
969+
"--no-workflow is deprecated and has no effect; ignoring.\n",
970+
);
971+
continue;
972+
}
963973
if (arg === "-p") {
964974
continue;
965975
}

‎src/config/settings.test.ts‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,38 @@ test("loadConfig --no-auto disables auto mode", async () => {
215215
});
216216
});
217217

218+
// Warn-and-ignore: the flag must not consume the following task token or
219+
// change parsed command/auto versus the same argv without it.
220+
test("loadConfig --no-workflow warns and is ignored", async () => {
221+
await withSettings(async ({ cwd, globalSettingsPath }) => {
222+
const { impl } = offlineFetch();
223+
const stderr = captureStderr();
224+
try {
225+
const options = {
226+
globalSettingsPath,
227+
pricing: { fetchImpl: impl },
228+
};
229+
const config = await loadConfig(
230+
["--cwd", cwd, "--no-workflow", "do something"],
231+
options,
232+
);
233+
const baseline = await loadConfig(
234+
["--cwd", cwd, "do something"],
235+
options,
236+
);
237+
expect(config.configured).toBe(true);
238+
expect(config.task).toBe(baseline.task);
239+
expect(config.command).toBe(baseline.command);
240+
expect(config.auto).toBe(baseline.auto);
241+
expect(stderr.output()).toContain(
242+
"--no-workflow is deprecated and has no effect; ignoring.",
243+
);
244+
} finally {
245+
stderr.restore();
246+
}
247+
});
248+
});
249+
218250
test("loadConfig uses the injected pricing fetchImpl instead of the network", async () => {
219251
await withSettings(async ({ cwd, globalSettingsPath }) => {
220252
resetPricingMetadataRefreshForTests();

0 commit comments

Comments
 (0)