Skip to content

clink codex fails: --enable web_search_request passed to exec subcommand instead of main command #387

@dkelson

Description

@dkelson

Project Version

9.8.2

Bug Description

The fix for #338 (which replaced --search with --enable web_search_request) has the same underlying problem: the --enable flag is a top-level codex flag, not a
codex exec subcommand flag.

Error Message

error: unexpected argument '--enable' found

tip: to pass '--enable' as a value, use '-- --enable'

Usage: codex exec --json --dangerously-bypass-approvals-and-sandbox [PROMPT]

For more information, try '--help'.

Environment

  • pal-mcp-server: latest (via uvx from git)
  • codex-cli: 0.66.x
  • OS: macOS

Root Cause

In conf/cli_clients/codex.json:

{
"additional_args": [
"--json",
"--dangerously-bypass-approvals-and-sandbox",
"--enable",
"web_search_request"
]
}

These args are appended to codex exec, producing:

codex exec --json --dangerously-bypass-approvals-and-sandbox --enable web_search_request "prompt"

But --enable is a top-level flag that must come before exec:

codex --enable web_search_request exec --json --dangerously-bypass-approvals-and-sandbox "prompt"

Workaround

Remove --enable and web_search_request from conf/cli_clients/codex.json:

{
"additional_args": [
"--json",
"--dangerously-bypass-approvals-and-sandbox"
]
}

Suggested Fix

Either:

  1. Add a pre_subcommand_args field to CLI configs for flags that must come before the subcommand
  2. Or remove --enable web_search_request from the default codex config since it's optional

Related

Relevant Log Output

Operating System

macOS

Sanity Checks

  • I have searched the existing issues and this is not a duplicate.
  • I am using GEMINI_API_KEY
  • I am using OPENAI_API_KEY
  • I am using OPENROUTER_API_KEY
  • I am using CUSTOM_API_URL

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions