Commit 8549cb5
fix: do not persist zero dimension after a zero-chunk parse
A parse producing no chunks (e.g. whitespace-only content) reached the
dimension persistence block with ctx->dimension still 0, writing
dimension=0 to dbmem_settings and latching dimension_saved. Later real
embeddings then updated the dimension in memory only, so a reopened
connection that only searches saw dimension=0 and reported that no
content has been indexed.
Persist the dimension only when at least one real embedding was
computed (chunks_added > 0), which guarantees ctx->dimension is set.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 1b16f43 commit 8549cb5
2 files changed
Lines changed: 37 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3016 | 3016 | | |
3017 | 3017 | | |
3018 | 3018 | | |
3019 | | - | |
| 3019 | + | |
| 3020 | + | |
| 3021 | + | |
3020 | 3022 | | |
3021 | 3023 | | |
3022 | 3024 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5407 | 5407 | | |
5408 | 5408 | | |
5409 | 5409 | | |
| 5410 | + | |
| 5411 | + | |
| 5412 | + | |
| 5413 | + | |
| 5414 | + | |
| 5415 | + | |
| 5416 | + | |
| 5417 | + | |
| 5418 | + | |
| 5419 | + | |
| 5420 | + | |
| 5421 | + | |
| 5422 | + | |
| 5423 | + | |
| 5424 | + | |
| 5425 | + | |
| 5426 | + | |
| 5427 | + | |
| 5428 | + | |
| 5429 | + | |
| 5430 | + | |
| 5431 | + | |
| 5432 | + | |
| 5433 | + | |
| 5434 | + | |
| 5435 | + | |
| 5436 | + | |
| 5437 | + | |
| 5438 | + | |
| 5439 | + | |
| 5440 | + | |
| 5441 | + | |
| 5442 | + | |
5410 | 5443 | | |
5411 | 5444 | | |
5412 | 5445 | | |
| |||
5637 | 5670 | | |
5638 | 5671 | | |
5639 | 5672 | | |
| 5673 | + | |
5640 | 5674 | | |
5641 | 5675 | | |
5642 | 5676 | | |
| |||
0 commit comments