Yeachan-Heo/oh-my-codex · error · OmxQuestionError

Structured questions are unavailable in the current OMX work

Error message

Structured questions are unavailable in the current OMX workflow context.

What it means

ensureStructuredQuestionFallbackAllowed() evaluates the question policy for the repo; if structured questions are not allowed AND fallbackAllowed is false, it throws an OmxQuestionError (using policy.code/policy.message when present). This blocks guided autoresearch setup from proceeding without a permitted question mechanism.

Source

Thrown at src/cli/autoresearch-guided.ts:183

				header: input.header,
				question: input.question,
				options: input.options,
				allow_other: input.allow_other,
				other_label: input.other_label ?? "Other",
				type: input.type,
				multi_select: input.multi_select ?? false,
				source: input.source ?? "deep-interview",
			},
			{ cwd: repoRoot },
		);
}

async function ensureStructuredQuestionFallbackAllowed(
	repoRoot: string,
): Promise<void> {
	const policy = await evaluateQuestionPolicy({ cwd: repoRoot });
	if (policy.allowed || policy.fallbackAllowed !== false) return;
	throw new OmxQuestionError(
		policy.code ?? "question_policy_denied",
		policy.message ?? "Structured questions are unavailable in the current OMX workflow context.",
	);
}

function shouldFallbackFromStructuredQuestion(error: unknown): boolean {
	if (error instanceof OmxQuestionError) {
		if (
			error.code === "worker_blocked"
			|| error.code === "team_blocked"
			|| error.code === "active_execution_mode_blocked"
		) {
			return false;
		}
		return true;
	}

	const message = error instanceof Error ? error.message : String(error);

View on GitHub (pinned to 3ad79a8a6f)

Solutions

  1. Run the guided setup in a context where the question policy permits questions (interactive terminal, allowed agent mode)
  2. Inspect the question policy configuration for the repo and enable structured questions or allow fallback
  3. Skip guided setup and drive autoresearch non-interactively by supplying inputs directly

Example fix

// policy: { allowed: false, fallbackAllowed: false }
// after — allow fallback in question policy config
// policy: { allowed: false, fallbackAllowed: true }
Defensive patterns

Strategy: try-catch

Validate before calling

const policy = await evaluateQuestionPolicy({ cwd: repoRoot });
if (!policy.allowed && policy.fallbackAllowed === false) {
  failFast('Structured questions disabled here; run in an interactive context or adjust policy');
}

Try / catch

try { await guidedAutoresearchSetup(...); } catch (e) { if (e instanceof OmxQuestionError && (e.code === 'question_policy_denied' || /Structured questions are unavailable/.test(e.message))) { skipGuidedFlow(); } else throw e; }

Prevention

When it happens

Trigger: evaluateQuestionPolicy({cwd: repoRoot}) returns a policy where allowed is false and fallbackAllowed is false — e.g. the repo or OMX workflow context (agent mode, config, environment) disallows interactive/structured questions entirely.

Common situations: Running the guided setup inside a restricted workflow context (CI, non-TTY agent run) where policy explicitly disables both structured questions and fallback, or repo-level configuration denying question mechanisms.

Related errors


AI-assisted analysis of Yeachan-Heo/oh-my-codex@3ad79a8a6f (2026-08-27). Data as JSON: /api/errors/aab9874911f21867. Report an issue: GitHub.