Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/IMPLEMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`) |

Expand Down
10 changes: 10 additions & 0 deletions src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
`;
Expand Down Expand Up @@ -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;
}
Expand Down
32 changes: 32 additions & 0 deletions src/config/settings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Loading