Skip to content

fix(drivers): name a location when the missing-driver error searched nothing - #1192

Merged
anandgupta42 merged 5 commits into
fix/warehouse-driver-bootstrapfrom
fix/native-driver-resolution
Aug 30, 2026
Merged

fix(drivers): name a location when the missing-driver error searched nothing#1192
anandgupta42 merged 5 commits into
fix/warehouse-driver-bootstrapfrom
fix/native-driver-resolution

Conversation

@anandgupta42

@anandgupta42 anandgupta42 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #1191.

This PR targets fix/warehouse-driver-bootstrap (#1122), not main; it builds on the optional-driver resolver introduced by that PR and includes the latest parent head.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

When optional-driver resolution fails and driverSearchRoots() returns an empty list, the old error ended with a dangling Searched 0 locations: line. The first version of this PR improved that line but overclaimed that the driver directory itself did not exist.

The final wording states only what the empty list proves and still gives the user an actionable destination:

DuckDB driver not installed.
Install it with the warehouse_install_driver tool, or run:
  npm install --prefix /home/user/.local/share/altimate-code/drivers duckdb
No searchable driver locations were found. Expected managed location: /home/user/.local/share/altimate-code/drivers/node_modules.

When roots exist, the existing Searched N location(s): ... message is unchanged. Resolution, root precedence, package selection, dynamic import, installation, and permissions are unchanged. In particular, the parent branch deliberately excludes project and ancestor node_modules; it retains the consent-gated managed root and explicitly configured/runtime roots.

Review feedback addressed

The empty-list regression test explicitly models the constructor boundary. Forcing driverSearchRoots() to return [] in a unit-test checkout would be host-dependent because executable- or package-adjacent roots may legitimately exist.

A late review found the complementary portability problem in the older non-empty-root test: it asserted Searched without creating any root, so it could fail in a dependency-free checkout. The final test-only commit creates its own managed node_modules root, points ALTIMATE_DRIVER_DIR at its parent, and asserts that exact root. The direct-constructor test still covers the genuine empty-root wording.

Codebase graph tracing confirms that loadOptionalDriver() passes the exact driverSearchRoots() array to DriverNotInstalledError without transformation.

Verification

Gate Result
Focused resolver tests 68 pass, 0 fail
Combined packages/drivers full suite 225 pass, 0 fail
Driver catalogue consistency 7 pass, 0 fail
bun run typecheck 13/13 successful
git diff --check pass
Three-seat Council consensus review unanimous ship-after-fix, high confidence
Codex Security exact-final-head diff scan complete coverage, 0 reportable findings

The source branch was synchronized with final #1122 head c49149a26f using a normal merge. Final reviewed/pushed head: 212f4546a7. No rebase or force-push was used.

Screenshots / recordings

Not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Note

Low Risk
User-facing error text only in the drivers package; no changes to resolution, install paths, or security-sensitive logic.

Overview
When optional driver resolution fails and driverSearchRoots() returns no existing directories (common on a first compiled run), DriverNotInstalledError no longer ends with a useless Searched 0 locations: line. It now says that no searchable locations were found and points at the expected managed node_modules path under driverInstallDir(), while keeping the existing Searched N location(s): … wording when roots were actually checked.

The npm install --prefix hint still uses the same install directory (now via a single installDir variable). Resolver behavior is unchanged.

Tests cover the empty-searched message directly (host-independent), assert listed roots when searched is non-empty, and tighten the integration case so the error mentions the managed root.

Reviewed by Cursor Bugbot for commit 212f454. Bugbot is set up for automated code reviews on this repo. Configure here.

…nothing

Drivers are deliberately not shipped, so "driver not installed" is a normal
state users hit by design rather than an edge case. `driverSearchRoots()`
returns only directories that exist, so on a machine that has never installed
a driver it returns nothing and the error ended in a bare "Searched 0
locations:" — a colon with nothing after it, naming nowhere to look.

Say plainly that there was nothing to search, and name the `node_modules`
directory the printed install command creates. Resolution behaviour is
unchanged; this is the error text and one branch.

Two tests: the empty case must not render "Searched 0 locations:" and must
name the install directory, and the populated case must still list the roots
it actually searched.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ccf18d05-2c93-4f4c-970e-d5fd9aef8509

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 30, 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-08-30T05:29:33.677512Z f57e73d New commits
ℹ️ 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.

@github-actions

Copy link
Copy Markdown

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown
- - - - - - - - - - - - - - - - - - - - - - - - -
                    AIRECEIPTS                    
             1 session behind this PR             

claude-opus-5....................12,007,185 tokens
  session slice: turns 1–99 of 100
--------------------------------------------------
TOTAL unpriced...................12,007,185 tokens
  counted: 1 session
  cache served 99% of input tokens
  full receipts + session ids: section below
- - - - - - - - - - - - - - - - - - - - - - - - -
                npx aireceipts-cli                
         github.com/anandgupta42/receipts         
- - - - - - - - - - - - - - - - - - - - - - - - -
full receipts (1 session)
session id scope turns time tokens in / out cached
builder ac833aa4 turns 1–99 of 100 99 18m 198 / 1.4k 99%

builder · ac833aa4

- - - - - - - - - - - - - - - - - - - - - - - - -
                    AIRECEIPTS                    
 “Fix native-module loading in the altimate-cod…” 
 Claude Code · Aug 30 2026 01:38:41 UTC · 18m 38s 
                claude-opus-5 100%                
         cache served 99% of input tokens         

pre-edit: 9% of tokens (14/99 turns)
  (share before the first named edit tool)

Bash.....................9,664,356 tok  (87 calls)
Write....................1,703,499 tok  (16 calls)
Edit........................399,613 tok  (3 calls)
SendMessage..................121,225 tok  (1 call)
ToolSearch...................118,492 tok  (1 call)
--------------------------------------------------
TOTAL...............................12,007,185 tok
no price table matched
- - - - - - - - - - - - - - - - - - - - - - - - -
                npx aireceipts-cli                
         github.com/anandgupta42/receipts         
- - - - - - - - - - - - - - - - - - - - - - - - -

Generated by aireceipts

@kilo-code-bot

kilo-code-bot Bot commented Aug 30, 2026

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • packages/drivers/src/resolve.ts
  • packages/drivers/test/resolve-unit.test.ts
Previous Review Summaries (2 snapshots, latest commit 31a73e1)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 31a73e1)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • packages/drivers/src/resolve.ts
  • packages/drivers/test/resolve-unit.test.ts

Previous review (commit 4dba9bf)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • packages/drivers/src/resolve.ts
  • packages/drivers/test/resolve-unit.test.ts

Reviewed by deepseek-v4-pro · Input: 42.9K · Output: 13K · Cached: 481.2K

Review guidance: REVIEW.md from base branch fix/warehouse-driver-bootstrap

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread packages/drivers/test/resolve-unit.test.ts
@github-actions

Copy link
Copy Markdown

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 31a73e1493

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/drivers/src/resolve.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant