can1357/oh-my-pi · error

--no-prewalk cannot be combined with --prewalk or --prewalk-

Error message

--no-prewalk cannot be combined with --prewalk or --prewalk-into

What it means

The CLI validates that model prewalk configuration is not self-contradictory. `--no-prewalk` explicitly disables prewalk discovery, while `--prewalk` / `--prewalk-into` explicitly enable or target it; combining them is ambiguous, so main.ts throws immediately during argument parsing. Fix the flags rather than catching — this runs before the app starts.

Source

Thrown at packages/coding-agent/src/main.ts:1235

		// deferring under an explicit CLI scope would let the saved default
		// escape it — keep pinning the first scoped model there.
		deferredDefaultRole = !options.model && Boolean(remembered) && !((parsed.models?.length ?? 0) > 0);
		if (!options.model && !deferredDefaultRole) options.model = scopedModels[0].model;
	} else if ((parsed.models?.length ?? 0) > 0 && !restoringSession) {
		// A CLI `--models` scope that resolved to zero models at startup: its
		// selectors name only models supplied by extension providers (or discovery)
		// that register during createAgentSession, so nothing matched the
		// pre-session catalog and `getDiscoverableProviders()` did not yet list the
		// provider for resolveScopedModels' pre-refresh. Defer the choice to the
		// SDK's post-extension resolution — the same `modelPattern` path a deferred
		// `--model` uses — so the initial model is picked from the requested scope
		// instead of an unrelated fallback. The fire-and-forget rebuild then
		// activates the scoped list once discovery settles (issue #9220).
		options.modelPattern = parsed.models;
	}

	if (parsed.noPrewalk && (parsed.prewalk || parsed.prewalkInto !== undefined)) {
		throw new Error("--no-prewalk cannot be combined with --prewalk or --prewalk-into");
	}
	const explicitPrewalk = parsed.prewalk === true || parsed.prewalkInto !== undefined;
	const prewalkEnabled = parsed.noPrewalk
		? false
		: explicitPrewalk
			? true
			: !restoringSession && activeSettings.get("prewalk.enabled");
	if (prewalkEnabled) {
		const rolePattern = expandRoleAlias(parsed.prewalkInto ?? DEFAULT_PREWALK_TARGET, activeSettings);
		const resolved = resolveCliModel({ cliModel: rolePattern, modelRegistry, preferences: modelMatchPreferences });
		if (resolved.warning) {
			process.stderr.write(`${chalk.yellow(`Warning: ${resolved.warning}`)}\n`);
		}
		// Prewalk is an optional optimization (off by default): switch to a fast
		// model at the first edit. If its hand-off target can't be resolved or has
		// no configured auth, warn and leave prewalk unarmed rather than aborting
		// startup and locking the user out of the app (issue #6064).
		if (resolved.error || !resolved.model) {

View on GitHub (pinned to 9690622007)

Solutions

  1. Remove `--no-prewalk` if you want prewalk enabled via `--prewalk`/`--prewalk-into`.
  2. Remove `--prewalk`/`--prewalk-into` if you intended to disable prewalk entirely.
  3. Review wrapper scripts/aliases so they don't inject conflicting prewalk flags.

Example fix

// before
omp --no-prewalk --prewalk-into "gpt-5"

// after
omp --prewalk-into "gpt-5"
Defensive patterns

Strategy: validation

Validate before calling

const flags = process.argv;
if (flags.includes("--no-prewalk") && (flags.includes("--prewalk") || flags.some(a => a.startsWith("--prewalk-into")))) {
  throw new Error("--no-prewalk cannot be combined with --prewalk or --prewalk-into");
}

Prevention

When it happens

Trigger: Running `omp` with `--no-prewalk` together with `--prewalk` or `--prewalk-into <target>` on the same command line.

Common situations: Shell aliases or scripts that append `--no-prewalk` while the user manually adds a prewalk flag; env/CI wrappers layering flags on a base command that already disables prewalk.

Related errors


AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31). Data as JSON: /api/errors/54bf2285e3e2748a. Report an issue: GitHub.