fix: pass embedding dimension to provider and surface sqlite-vec probe failures - #1386
Conversation
…e failures - send the configured embedding profile dimension via Embedder settings instead of letting providers return their default dimension - clear a leftover probe row before the sqlite-vec vector index probe so an interrupted run cannot poison subsequent startups - include the underlying error, with a dimension-mismatch hint, in the CapabilityNotSupportedError raised by the probe - log embedding readiness probe failures before marking the capability unavailable Fixes oceanbase#1385
The server test suite intentionally asserts that provider error messages never reach the logs (see the redaction tests in tests/test_server.py), so the readiness probe stays silent; root causes are surfaced through the hard-failure CapabilityNotSupportedError detail instead. Also annotate the spy state as ClassVar and apply ruff formatting.
1bc63e8 to
5b5c5d7
Compare
Address review feedback on PR oceanbase#1386: - dependency_readiness_probe now exposes the stable code/detail carried by InferenceConfigurationError (e.g. 'misconfigured: provider-rejected (HTTP 400)') so the Server and doctor explain what was rejected, while plain configuration errors stay redacted as 'misconfigured'. - _map_error attaches the structured HTTP status to provider-rejected failures; the raw provider response body is never included. - _probe_failure_detail only emits the existing-table migration hint after confirming a pre-existing vec0 table with a different dimension; a fresh oversized dimension now preserves the actual probe error (e.g. the sqlite-vec 8192 maximum).
|
Both review points are addressed in 6229cb9:
Validation: |
Which issue or RFC does this PR close?
Closes #1385.
Rationale for this change
The configured
EMBEDDING_DIMENSIONwas never sent to the embedding provider, so any configured dimension different from the provider default failed validation. The failure was invisible to users: the readiness probe swallowed the underlying error and only reporteddegraded/inference.embedding: unavailable, and if the failure happened during vector index initialization it was uniformly wrapped asCapabilityNotSupportedError: vector (sqlite-vec probe failed), which misleadingly suggests a missing sqlite-vec extension. Additionally, an interrupted startup could leave avector_id=-1probe row behind, which poisoned every subsequent startup with the same masked error until the database file was deleted manually.What changes are included in this PR?
composition.py: pass the configured embedding profile dimension to theEmbedderviaEmbeddingSettings(dimensions=...), so providers actually receive the requested dimension instead of returning their default.sqlite/memory_index.py: clear a leftovervector_id=-1probe row before the vector index probe, making startup idempotent after an interrupted run.sqlite/memory_index.py: include the underlying error in theCapabilityNotSupportedErrordetail, with a dedicated hint when the existing vec table dimension does not match the configured profile (message contains both dimension values).composition.py: log embedding readiness probe failures vialogger.exceptionbefore markinginference.embeddingunavailable.Are there any user-facing changes?
dimensionsparameter; providers that reject the parameter will now surface a visible error instead of silently mismatching dimensions.sqlite-vec probe failed; a stale vec table with a different dimension produces an actionable message naming both dimensions.How was this change tested?
tests/builtin/persistence/test_sqlite_memory_vector_index.py,tests/builtin/runtime/test_composition_embedding.py): leftover-row self-heal, dimension-mismatch message contains both dimensions plus chained cause, generic cause surfacing,dimensionssettings reaching theEmbedder, and no-embedding-config passthrough.make test: no new failures vs the base commit (16 vs 17 pre-existing environment-dependent failures);make checkclean.readywith vector/hybrid search enabled; a stale 1024-dim table now fails with a message containing both dimensions; an injectedvector_id=-1row is cleaned up on the next start.AI usage statement
Built with opencode (GLM, Z.ai) under human direction and review; all code, tests, and validation steps were reviewed and confirmed by the author.