-
-
Notifications
You must be signed in to change notification settings - Fork 889
feat: re-enable web search for clink codex using correct --enable flag #352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: re-enable web search for clink codex using correct --enable flag #352
Conversation
Summary of ChangesHello @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 Highlights
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this 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.
tests/test_clink_tool.py
Outdated
| 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 | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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
2f30434 to
e7b9f3a
Compare
- Add --enable web_search_request flag for codex exec - Update regression tests for correct config parameters
Description
The previous fix (aceddb6) removed
--searchentirely 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_requestflag that works with thecodex execsubcommand.Changes Made
--enable web_search_requesttoconf/cli_clients/codex.jsonTesting
codex exec --enable web_search_request→ ✅ Works correctlyRelated Issues
Related to #338
Checklist