Repository navigation
fix(tool): explain invalid regex patterns in code_search - #2069
Closed
lizhengfeng101 wants to merge 1 commit into
Closed
lizhengfeng101 wants to merge 1 commit into
lizhengfeng101 wants to merge 1 commit into
Conversation
Contributor
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 2 selected item(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1340.
When a search mixes regex operators with literal source text, retrying the entire pattern as a fixed string changes the question. For example, the corrected
FS\(_|func FSshould match either alternative, not a literal pipe.This change keeps an invalid pattern as a failed
code_searchcall. When Git reports a-epattern compilation error, the tool preserves the original diagnostic and exit status and suggests escaping literal metacharacters or explicitly choosing literal mode. The tool description now shows the two modes side by side. There is no automatic retry.Verification
make check,make test, andmake coveragepassed (91.6% statement coverage).GIT_TRACE=1prepends trace lines to stderr, the original Git error still reaches the model but the extra hint is omitted.AI disclosure: OpenAI Codex CLI (
gpt-6.2-astra) was used to implement and test the change and draft this PR. OpenCodeReview (gpt-6.2-astra) was used for the pre-commit review.