Skip to content

Conversation

@DragonFSKY
Copy link
Contributor

@DragonFSKY DragonFSKY commented Dec 3, 2025

Description

The previous fix (aceddb6) removed --search entirely to fix the "unexpected argument" error, but this also disabled web search functionality.

This PR restores web search for clink codex using the correct --enable web_search_request flag that works with the codex exec subcommand.

Changes Made

  • Added --enable web_search_request to conf/cli_clients/codex.json
  • Updated regression test to verify the correct config args
  • Breaking changes introduced (N/A)
  • Dependencies added/removed (N/A)

Testing

  • All unit tests pass (5/5 passed)
  • Manual testing with codex CLI confirms:
    • codex exec --enable web_search_request → ✅ Works correctly

Related Issues

Related to #338

Checklist

  • PR title follows Conventional Commits
  • Self-review completed
  • Tests updated
  • All unit tests passing
  • Ready for review

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @DragonFSKY, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a critical bug that prevented clink codex commands from executing successfully when attempting to use web search. The core problem stemmed from an incompatible command-line argument being used in a non-interactive context. The solution involves updating the configuration to use the correct, globally supported flag for enabling web search and introducing a new test to safeguard against future regressions, thereby improving the robustness and reliability of the codex client.

Highlights

  • Bug Fix: Resolved an issue where clink codex calls failed due to the codex exec subcommand not supporting the --search flag, which is only available in interactive mode.
  • Configuration Update: Replaced the unsupported --search flag with --enable web_search_request in conf/cli_clients/codex.json to correctly enable web search in non-interactive (exec) mode.
  • Regression Test: Added a new regression test, test_codex_config_args_use_enable_flag, to ensure that the correct flag for enabling web search is used in the codex client configuration, preventing similar issues in the future.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly fixes an issue where the --search flag was used with the codex exec subcommand, which does not support it. The change to use --enable web_search_request is appropriate. The addition of a regression test is also a great practice. I've provided one suggestion to make the new test more robust by ensuring it correctly checks for the adjacency of command-line flags and their values.

Comment on lines 83 to 86
has_enable_flag = "--enable" in codex_client.config_args and "web_search_request" in codex_client.config_args
has_config_flag = "-c" in codex_client.config_args and any(
"web_search_request" in arg for arg in codex_client.config_args
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The current checks for has_enable_flag and has_config_flag are not robust. They verify the presence of the flag and its value independently in the config_args list, which could lead to false positives if the arguments are not adjacent. For example, ['--enable', 'other_feature', 'web_search_request'] would incorrectly pass the has_enable_flag check.

A more reliable approach is to check that the flag is immediately followed by its expected value. This can be done cleanly by pairing adjacent arguments.

Additionally, the check for has_config_flag is too broad by searching for just "web_search_request". It should be more specific to match features.web_search_request=true as mentioned in the test's docstring.

Suggested change
has_enable_flag = "--enable" in codex_client.config_args and "web_search_request" in codex_client.config_args
has_config_flag = "-c" in codex_client.config_args and any(
"web_search_request" in arg for arg in codex_client.config_args
)
args = codex_client.config_args
arg_pairs = list(zip(args, args[1:]))
has_enable_flag = ("--enable", "web_search_request") in arg_pairs
has_config_flag = any(p[0] == "-c" and "features.web_search_request=true" in p[1] for p in arg_pairs)

The previous fix (aceddb6) removed --search entirely, disabling web search.
This restores web search functionality using the correct --enable flag
that works with the codex exec subcommand.

Related to BeehiveInnovations#338
@DragonFSKY DragonFSKY force-pushed the fix/clink-codex-search-arg branch from 2f30434 to e7b9f3a Compare December 3, 2025 06:34
@DragonFSKY DragonFSKY changed the title fix: clink codex search argument not supported by exec subcommand feat: re-enable web search for clink codex using correct --enable flag Dec 3, 2025
DragonFSKY added a commit to DragonFSKY/pal-mcp-server that referenced this pull request Dec 6, 2025
- Add --enable web_search_request flag for codex exec
- Update regression tests for correct config parameters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant