Skip to content

Fix find context controls and regex mode - #2736

Merged
Widthdom merged 7 commits into
mainfrom
codex/fix-issue1413-1414-1593-1597-1930
May 31, 2026
Merged

Fix find context controls and regex mode#2736
Widthdom merged 7 commits into
mainfrom
codex/fix-issue1413-1414-1593-1597-1930

Conversation

@Widthdom

Copy link
Copy Markdown
Owner

Summary

  • Clamp MCP excerpt/find context values instead of rejecting large before/after values.
  • Add find snippet, focus-line/focus-column, and regex controls for CLI and MCP.
  • Keep find count mode aligned with regex/focus semantics and return user-facing regex errors for invalid or timed-out regexes.

Issues

Fixes #1413
Fixes #1414
Fixes #1593
Fixes #1597
Fixes #1930

Validation

  • dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj --filter "FullyQualifiedNameQueryCommandRunnerTests.RunFind_SnippetLinesControlsMatchContext|FullyQualifiedNameMcpServerTests.ToolsCall_FindInFile_SnippetLinesControlsMatchContext|FullyQualifiedNameQueryCommandRunnerTests.RunFind_FocusLineAndColumnRestrictMatch|FullyQualifiedNameMcpServerTests.ToolsCall_FindInFile_FocusLineAndColumnRestrictMatch|FullyQualifiedNameQueryCommandRunnerTests.RunFind_RegexMatchesAnchors|FullyQualifiedNameQueryCommandRunnerTests.RunFind_CountOnlyRegexAndFocusUseSameMatchingSemantics|FullyQualifiedNameMcpServerTests.ToolsCall_FindInFile_RegexMatchesAnchors|FullyQualifiedNameMcpServerTests.ToolsCall_Excerpt_BeforeAboveCapClampsContext|FullyQualifiedNameMcpServerTests.ToolsCall_Excerpt_AfterAboveCapClampsContext|FullyQualifiedNameMcpServerTests.ToolsCall_FindInFile_BeforeAfterAboveCapClampContext"
  • dotnet run --project tools/CodeIndex.Changelog -- check

Review

  • adversarial review found count-mode regex/focus drift and regex timeout handling; both were fixed in follow-up commit 8b58235.
  • A second adversarial-review run was attempted after the fix, but Codex returned a usage-limit error before reviewing.

@Widthdom
Widthdom merged commit d05b7bc into main May 31, 2026
10 checks passed
@Widthdom
Widthdom deleted the codex/fix-issue1413-1414-1593-1597-1930 branch May 31, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment