Skip to content

Fix zero-result query exit codes - #2658

Merged
Widthdom merged 6 commits into
mainfrom
codex/fix-issue1425-latest
May 24, 2026
Merged

Fix zero-result query exit codes#2658
Widthdom merged 6 commits into
mainfrom
codex/fix-issue1425-latest

Conversation

@Widthdom

Copy link
Copy Markdown
Owner

Summary

  • Make valid zero-result query commands exit 0 by default.
  • Add --strict-not-found so scripts can opt back into exit code 2 for zero-row results.
  • Keep missing indexed paths, such as outline for a non-indexed file, returning exit code 2.

Validation

  • dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj --filter "FullyQualifiedName~RunSearch_StrictNotFoundReturnsNotFoundForZeroResults_Issue1425|FullyQualifiedName~RunInspect_StrictNotFoundReturnsNotFoundForEmptyAnalysis_Issue1425" -p:UseSharedCompilation=false --no-restore
  • dotnet run --project tools/CodeIndex.Changelog -- check
  • dotnet build CodeIndex.sln -c Release -p:UseSharedCompilation=false
  • dotnet ./src/CodeIndex/bin/Debug/net8.0/cdidx.dll status --check --json
  • Codex adversarial review: No blocking/actionable issues found.

Note: a targeted run including RunPublishedTrimmedCli_SerializesQueryJsonAndErrorJson passed the new tests but hit an existing net8 ILLink AccessViolationException during trimmed publish; net9 completed that selection successfully.

Docs and Changelog

  • Updated README.md, USER_GUIDE.md, and DEVELOPER_GUIDE.md.
  • Added changelog.d/unreleased/1425.changed.md.

Fixes #1425

@Widthdom
Widthdom merged commit bd1204e into main May 24, 2026
11 checks passed
@Widthdom
Widthdom deleted the codex/fix-issue1425-latest branch May 24, 2026 19:59
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.

Zero-result exit codes are inconsistent across subcommands (2/0/5 are all used)

1 participant