Skip to content

[fix] Retry failed skip-gitignore reindexes - #455

Closed
bvolpato wants to merge 3 commits into
mainfrom
bvolpato/fix-skip-gitignore-errors
Closed

bvolpato wants to merge 3 commits into
mainfrom
bvolpato/fix-skip-gitignore-errors

Conversation

@bvolpato

@bvolpato bvolpato commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Why

A --skip-gitignore search could return incomplete results after a local or daemon reindex failed. Later queries could miss ignored files even after the error was fixed. Local --all-indices searches also missed ignored files when an index used the default ignore mode.

What changed

Report metadata and reindex failures, including the full daemon error chain. Compare the requested mode with the last successfully indexed mode and index health so the next query retries a failed or interrupted reindex. Prepare each selected workspace before local --all-indices searches, using the daemon when it owns indexing. Report daemon search errors instead of silently falling back, and reject a disconnected-daemon fallback if a selected index is incomplete or excludes ignored files.

To reproduce on Unix as a non-root user:

(
  tmp=$(mktemp -d)
  mkdir -p "$tmp/repo/.git" "$tmp/repo/locked"
  printf 'secret.txt\n' > "$tmp/repo/.gitignore"
  printf 'hidden-secret-string\n' > "$tmp/repo/secret.txt"
  printf 'public data\n' > "$tmp/repo/locked/visible.txt"
  export IVYGREP_HOME="$tmp/home" IVYGREP_NO_AUTOSPAWN=1
  ig --add "$tmp/repo" --hash --no-watch
  chmod 000 "$tmp/repo/locked"
  ig --literal --skip-gitignore --no-watch --file-name-only hidden-secret-string "$tmp/repo"
  chmod 700 "$tmp/repo/locked"
  ig --literal --skip-gitignore --no-watch --file-name-only hidden-secret-string "$tmp/repo"
)

The first search reports the permission error. The second finds secret.txt without an explicit reindex.

Validation

cargo fmt -- --check, cargo clippy --locked --all-targets -- -D warnings, cargo test --locked --test skip_gitignore, the local_reindex_persists_skip_gitignore_false library test, and ./test.sh --quick ran on macOS. The regression checks repeated failures and recovery for local and live-daemon literal and hybrid searches, including local all-indices and daemon-assisted lexical search. It checks disconnected-daemon fallback and unfinished publication recovery. The full ./test.sh suite and neural E2E were not rerun for this focused change.

A temporary worktree combined the three PR branches. It ran cargo test --locked --test skip_gitignore --test literal_cli, the E2E workflow unit tests, and scripts/e2e_all.sh --binary <debug-binary> with an overlong TMPDIR. The browser used one headless worker.

The dependency audit fails on the unchanged main-branch lockfile because of existing rustls and zip advisories.

Evidence

Not applicable.

Risk

An index with a missing or mismatched mode marker or an unfinished publication is rebuilt before a local --skip-gitignore query. Local --all-indices searches can rebuild multiple workspaces, prompt before indexing broad roots, and fail if any required reindex fails. Revert this change to restore the previous behavior.

Downsides

A daemon error for --skip-gitignore now fails the query instead of trying local search, even when a local fallback might have worked. A disconnected daemon can still fall back when the selected indexes are healthy and were successfully built in the requested mode.

Checklist

  • Change is focused and follows existing project patterns.
  • Tests cover changed behavior or regression, or testing is not applicable.
  • ./test.sh --quick passed during iteration.
  • ./test.sh passes, or Validation explains narrower proportional checks.
  • Relevant CLI, daemon, MCP, browser, neural, or artifact E2E passes, or E2E is not applicable.
  • User-facing docs and changelog are updated when needed.
  • Performance and relevance claims include reproducible evidence.
  • No private code, credentials, generated caches, or local paths are committed.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T22:05:38.732692Z 12afde2 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@bvolpato

Copy link
Copy Markdown
Owner Author

Included in #454, merged as b6f4e75.

The commits from reviewed head 06524203d948e0d0da27b55fed724253fd4dcd14 are preserved in the combined branch. I verified that the merged tree exactly matches the reviewed candidate. The skip-gitignore retry/error paths and both literal fallback guards passed combined CLI, daemon, and native-platform validation. Closing as superseded.

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