Commit fe92c06
fix(core): address review feedback on FastEmbed cache fix
- Use explicit ``is not None`` instead of ``or`` in _resolve_cache_dir so
an empty-string override doesn't silently fall through to the default.
Empty string is an invalid path; letting FastEmbed surface the error
is clearer than swapping it out for ~/.basic-memory/fastembed_cache.
- Drop the ``os.getenv("HOME", Path.home())`` dance in resolve_data_dir.
``Path.home()`` already reads $HOME on POSIX and %USERPROFILE% on
Windows, so the env check was redundant and made tests that patched
os.name to simulate Windows on non-Windows hosts fragile.
- Switch default_fastembed_cache_dir to ``os.getenv`` for consistency
with the rest of config.py.
- Fix test_default_fastembed_cache_dir_never_falls_back_to_tmp so it no
longer mis-fires on Linux CI. ``tempfile.gettempdir()`` is ``/tmp``
there and pytest's ``tmp_path`` lives under it, so the previous
``startswith(tempfile.gettempdir())`` guard flagged legitimate paths.
Compare exact paths against FastEmbed's concrete
``<tempdir>/fastembed_cache`` fallback instead.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Drew Cain <groksrc@gmail.com>1 parent 1a8fbd5 commit fe92c06
File tree
3 files changed
+38
-14
lines changed- src/basic_memory
- repository
- tests
3 files changed
+38
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | | - | |
| 57 | + | |
| 58 | + | |
59 | 59 | | |
60 | | - | |
61 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
65 | | - | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
Lines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
28 | 37 | | |
29 | 38 | | |
30 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
338 | | - | |
339 | | - | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
340 | 353 | | |
341 | 354 | | |
342 | 355 | | |
343 | | - | |
| 356 | + | |
344 | 357 | | |
345 | | - | |
346 | | - | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
347 | 362 | | |
348 | 363 | | |
349 | 364 | | |
| |||
0 commit comments