Commit 4b5620c
fix(search): cross-platform dynamic import + Windows VC++ Redist hint
Two fixes for `axme-code config set context.mode search` on Windows:
1. **pathToFileURL on dynamic import.** `await import(absolutePath)`
throws on Windows because Node treats raw `C:\...` paths as bare
specifiers. Wrapping the resolved path with `pathToFileURL(...).href`
produces a `file:///C:/...` URL that imports cleanly on every
platform.
2. **Actionable error when onnxruntime-node native binding fails to
load.** Most common Windows failure: `onnxruntime_binding.node`
throws "specified module could not be found" because Microsoft
Visual C++ Redistributable is missing. We now detect that
signature and print a clear hint pointing to the redist installer
plus the retry command, instead of returning null silently and
leaving the user to chase a generic "module not loaded" message
from search-install.ts.
Verified on Azure Win11 native:
- Before VC++ Redist install: error message correctly directs the
user to https://aka.ms/vs/17/release/vc_redist.x64.exe.
- After VC++ Redist install: `axme-code config set context.mode
search` succeeds end-to-end (31/31 entries indexed in 5s,
embeddings.json written, config.yaml updated).
- claude --print session calls axme_context (renders search-mode
catalog) and axme_search_kb (top hits semantically correct: D-004
+ D-002 for "git push force safety" query).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent dcc62ef commit 4b5620c
1 file changed
Lines changed: 26 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
92 | | - | |
93 | | - | |
| 93 | + | |
| 94 | + | |
94 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
95 | 100 | | |
96 | 101 | | |
97 | 102 | | |
98 | 103 | | |
99 | | - | |
100 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
101 | 123 | | |
102 | 124 | | |
103 | 125 | | |
| |||
0 commit comments