fix(codex): add AskUserQuestion→request_user_input tool rewrite

Issue #1066 — Codex skills that call AskUserQuestion silently fail
in Default mode because Codex strips AskUserQuestion from the
tool schema and its equivalent (request_user_input) only works in
Plan mode.

The HostConfig interface already supports toolRewrites (gbrain, openclaw,
factory, hermes all use it). codex.ts was missing it.

Adding { 'AskUserQuestion': 'request_user_input' } to codex.ts so that
when gen-skill-docs.ts applies rewrites at generation time, any prompt
text referencing AskUserQuestion gets replaced with Codex's equivalent.

Note: this only handles the text rewrite. A full fix would also need
the Plan-mode gate in the preamble (Option 4 in #1066), but that requires
codex-side feature flag changes outside gstack's control.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
jacob-wang 2026-04-21 01:08:08 +08:00
parent d0782c4c4d
commit 8f313cf15a
1 changed files with 4 additions and 0 deletions

View File

@ -31,6 +31,10 @@ const codex: HostConfig = {
{ from: '.claude/skills', to: '.agents/skills' },
],
toolRewrites: {
'AskUserQuestion': 'request_user_input',
},
suppressedResolvers: [
'DESIGN_OUTSIDE_VOICES', // design.ts:485 — Codex can't invoke itself
'ADVERSARIAL_STEP', // review.ts:408 — Codex can't invoke itself