fix(oracle): honor explicit wallet_password="" for auto-login wallets (closes #289)#290
Merged
Merged
Conversation
…closes #289) Pydantic v2 made SecretStr("") falsy, so the truthy guard `if cfg.wallet_password:` silently dropped an explicit wallet_password="" before it reached oracledb.create_pool_async. But "" is python-oracledb's documented idiom for an auto-login (cwallet.sso) wallet. Dropping it forces the driver onto the encrypted ewallet.pem path, which fails at connect time with DPY-6005 / OSError: [Errno 22] (and prompts for a PEM passphrase on a TTY). Switch the guard to `is not None` at all seven Oracle pool builders so an omitted password (None) is still skipped while an explicit "" is forwarded: - memory/backends/oracle.py - memory/backends/oracle_versioned.py - memory/store_backends/oracle.py - rag/embeddings/oracle_indb.py - rag/chunkers/oracle_indb.py - rag/stores/oracle.py - rag/loaders/oracle.py Add tests/unit/test_oracle_wallet_password_empty.py: 7 backends x 3 cases (empty-string forwarded / None omitted / real value forwarded), stubbing oracledb to capture create_pool_async kwargs. Signed-off-by: Federico Kamelhar <federico.kamelhar@oracle.com>
f46793b to
0602655
Compare
fede-kamel
added a commit
that referenced
this pull request
May 30, 2026
…290) (#291) Bumps locus-sdk to 0.2.0b25. Fixes a Pydantic v2 regression where an explicit wallet_password="" (the python-oracledb auto-login / cwallet.sso idiom) was silently dropped by a truthy SecretStr guard, forcing the encrypted ewallet.pem path and failing at connect with DPY-6005 / OSError: [Errno 22]. The guard is now `is not None` across all seven Oracle pool builders (closes #289). Signed-off-by: Federico Kamelhar <federico.kamelhar@oracle.com>
fede-kamel
added a commit
that referenced
this pull request
May 30, 2026
…oses #292) (#293) * chore(release): v0.2.0b25 — Oracle auto-login wallet_password="" fix (#290) Bumps locus-sdk to 0.2.0b25. Fixes a Pydantic v2 regression where an explicit wallet_password="" (the python-oracledb auto-login / cwallet.sso idiom) was silently dropped by a truthy SecretStr guard, forcing the encrypted ewallet.pem path and failing at connect with DPY-6005 / OSError: [Errno 22]. The guard is now `is not None` across all seven Oracle pool builders (closes #289). Signed-off-by: Federico Kamelhar <federico.kamelhar@oracle.com> * fix(rag): make OCI embedding dimension + input_type deterministic (closes #292) OCIEmbeddings.embed_query() hardcoded input_type="SEARCH_QUERY" (ignoring config) and embed_documents() hardcoded "SEARCH_DOCUMENT"; embed_query also carried a dead `original_type` local and a misleading "frozen config" comment. More importantly, the real dimension-mismatch trigger behind the report is Cohere v4's Matryoshka output_dimensions, which Locus never set. cohere.embed- v4.0 returns exactly the requested size (256/512/1024/1536) and OCI's server-side default (1536 today) applies otherwise — so a table indexed at one output_dimensions and queried at another raises ORA-51803. input_type does NOT change the output dimension (verified live: v4 returns 1536 for both SEARCH_QUERY and SEARCH_DOCUMENT; v3 returns 1024 for both). Changes: - Add OCIEmbeddingConfig.output_dimensions (default None). Forwarded to EmbedTextDetails on every embed path via a shared _build_embed_details helper, and only when set, so non-Matryoshka models never see the field. - config.dimension now prefers output_dimensions, so the vector column is sized to match the pinned embedding dimension. - Add OCIEmbeddingConfig.query_input_type (default SEARCH_QUERY) and read input_type from config in embed_documents; removes the hardcodes and the dead/misleading code in embed_query. Tests: query_input_type / input_type configurability, output_dimensions omitted-by-default + forwarded on all three paths, and config.dimension reflecting output_dimensions. Signed-off-by: Federico Kamelhar <federico.kamelhar@oracle.com> --------- Signed-off-by: Federico Kamelhar <federico.kamelhar@oracle.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #289. In Pydantic v2
SecretStr("")is falsy, so the truthy guardsilently dropped an explicit
wallet_password=""before it reachedoracledb.create_pool_async. But""is python-oracledb's documented idiom for anauto-login (
cwallet.sso) wallet. With it dropped, the thin driver falls through tothe encrypted
ewallet.pempath and fails at connect time withDPY-6005/OSError: [Errno 22](and prompts for a PEM passphrase on a TTY).Change
Switch the guard to
is not Noneat all seven Oracle pool builders, so an omittedpassword (
None) is still skipped while an explicit""is forwarded:memory/backends/oracle.pymemory/backends/oracle_versioned.pymemory/store_backends/oracle.pyrag/embeddings/oracle_indb.pyrag/chunkers/oracle_indb.pyrag/stores/oracle.pyrag/loaders/oracle.pyRoot-cause confirmation
Tests added
tests/unit/test_oracle_wallet_password_empty.py— 7 backends × 3 cases = 21 tests,stubbing
oracledbto capture the kwargs each_get_pool()sends tocreate_pool_async:""→ kwarg forwarded as""None) → kwarg absentTesting performed
1. Unit
test_oracle_store,test_oracle_adb_loader,test_oracle_versioned_checkpointer,test_oracle_indb_embeddings,test_oracle_indb_chunker) — 143 tests total, noregressions.
fail with
AssertionError: empty-string wallet_password was dropped (truthy-guard regression), then passes again once the fix is restored — confirming the testactually pins the behavior.
2. No-database probe
Stubbing
create_pool_asyncon the unpatched code shows the kwarg is dropped:With the fix,
wallet_passwordis present.3. Live Oracle Autonomous DB (auto-login wallet,
wallet_password="")Direct vs. Locus, same wallet + credentials:
oracledb.create_pool_async(..., wallet_password="")select 1 -> 1wallet_password=""(unpatched)DPY-6005/OSError: [Errno 22](after the driver prompted for a PEM passphrase, falling through toewallet.pem)wallet_password=""(patched)select 1 -> 14. Integration suite —
tests/integration/test_oracle_rag.pyRun against a live ADB with an auto-login wallet and
ORACLE_WALLET_PASSWORD=""(thedefault, i.e. the #289 trigger), exercising
OracleVectorStore:test_oracle_cohere_embeddings— needs an OCIGenAI profile that wasn't configured in this run; unrelated to this change).
wallet_password="".rag/stores/oracle.pyand re-runningtest_oracle_connectionreproduces the failure end-to-end —OSError: [Errno 22]→DPY-6005— and re-applying the fix returns it to green. Thisties the integration pass directly to the fix.
Note:
tests/integration/rag/test_oracle_adb_store.pywas reviewed but is not relevanthere — its fixture defaults
wallet_passwordto the DB password (never""), so it doesnot exercise the auto-login path.
A self-contained reproduction probe (no database required) is posted on #289.