Skip to content

fix(search): pass db file path instead of directory to setupIndexer#74

Merged
aeneasr merged 1 commit intocodex-pluginfrom
worktree-fix-72
Apr 1, 2026
Merged

fix(search): pass db file path instead of directory to setupIndexer#74
aeneasr merged 1 commit intocodex-pluginfrom
worktree-fix-72

Conversation

@aeneasr
Copy link
Copy Markdown
Member

@aeneasr aeneasr commented Apr 1, 2026

Summary

  • runSearch was calling setupIndexer with the raw indexRoot directory instead of the SQLite db file path from config.DBPathForProject
  • SQLite cannot open a directory and fails with exec "PRAGMA journal_mode=WAL": unable to open database file
  • Also adds os.MkdirAll for the db parent directory (matching the pattern already used in runIndex)

Red/Green regression test

TestSetupIndexer_DBPathVsDirectory in cmd/search_test.go:

  • Red: setupIndexer with a raw directory fails with the SQLite PRAGMA error
  • Green: setupIndexer with config.DBPathForProject(dir, model) succeeds

Closes #72

🤖 Generated with Claude Code

runSearch was calling setupIndexer with the raw indexRoot directory
instead of the SQLite db file path computed by config.DBPathForProject.
SQLite cannot open a directory and failed with:
  exec "PRAGMA journal_mode=WAL": unable to open database file

Also add os.MkdirAll for the db directory (matching the pattern in
runIndex) and a red/green regression test.

Closes #72

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@aeneasr aeneasr merged commit e8660ef into codex-plugin Apr 1, 2026
1 check passed
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