diff --git a/hosts/codex.ts b/hosts/codex.ts index 7dc80ea87..ab67ae8b3 100644 --- a/hosts/codex.ts +++ b/hosts/codex.ts @@ -30,6 +30,13 @@ const codex: HostConfig = { { from: '.claude/skills/review', to: '.agents/skills/gstack/review' }, { from: '.claude/skills', to: '.agents/skills' }, ], + toolRewrites: { + 'Do NOT use AskUserQuestion for interactive prompts. Auto-choose the recommended option.': + 'If request_user_input is unavailable, report BLOCKED and stop; never auto-choose an answer.', + 'AskUserQuestion with 4 options': 'request_user_input using the sequential 2-3-option split rule', + AskUserQuestions: 'request_user_input calls', + AskUserQuestion: 'request_user_input', + }, suppressedResolvers: [ 'DESIGN_OUTSIDE_VOICES', // design.ts:485 — Codex can't invoke itself diff --git a/scripts/resolvers/preamble/generate-ask-user-format.ts b/scripts/resolvers/preamble/generate-ask-user-format.ts index 533c002c0..c7a13aaff 100644 --- a/scripts/resolvers/preamble/generate-ask-user-format.ts +++ b/scripts/resolvers/preamble/generate-ask-user-format.ts @@ -1,6 +1,94 @@ import type { TemplateContext } from '../types'; -export function generateAskUserFormat(_ctx: TemplateContext): string { +function generateCodexRequestUserInputFormat(): string { + return `## request_user_input Format + +### Availability (read first) + +\`request_user_input\` is available in Codex Plan mode by default. Before each +decision, confirm that it appears in the current tool list. + +If the tool is unavailable — including in Default mode — do NOT guess, silently +choose, auto-select the recommendation, or continue the workflow. Tell the user: +\`BLOCKED — this workflow needs interactive decisions. Switch this task to Plan +mode and rerun it.\` Then STOP. Do not enable the under-development +\`default_mode_request_user_input\` feature as a workaround. + +### Tool-call shape + +Send one decision per call and one item in the \`questions\` array. Use: + +- \`header\`: at most 12 characters. +- \`id\`: stable snake_case. +- \`question\`: the complete decision brief below, including context, stakes, + recommendation, completeness, pros/cons, and the closing Net line. +- \`options\`: 2-3 explicit choices. Keep each label to 1-5 words, suffix the + recommended label with \`(Recommended)\`, and give each option one concise + sentence describing its concrete impact or tradeoff. + +The detailed brief belongs in \`question\`; do not try to pack it into option +labels or omit it because the tool has structured options. + +### Decision-brief format + +\`\`\` +D +Project/branch/task: <1 short grounding sentence using _BRANCH> +ELI10: +Stakes if we pick wrong: +Recommendation: because +Completeness: A=X/10, B=Y/10 (or: Note: options differ in kind, not coverage — no completeness score) +Pros / cons: +A)