You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(config): resolve relative embedding.model against config dir / source_root
A relative `embedding.model` (e.g. `./models/minilm`) was handed to
sentence-transformers verbatim and resolved against process CWD — unlike
`index_dir` and `source_root`, which anchor on the config file's
directory. That made a committed `.java-codebase-rag.yml` non-portable,
and could let the CLI indexer and the MCP reader load different models
from the same config when their CWDs differed.
`maybe_expand_embedding_model_path` now takes optional `config_dir` /
`source_root` / `source` kwargs and, after the existing `~` / `$VAR`
expansion, resolves a result still `./` / `../`-prefixed to absolute —
mirroring `_resolve_index_dir_path`: YAML values anchor on the config
file's directory, CLI / env values on `source_root`. Hub ids, absolute
paths, `~/`-expanded values, and an env var that already yielded an
absolute path are all left untouched.
With no base supplied, relative resolution is skipped, so the MCP
runtime read (`resolved_sbert_model_for_process_env`) is byte-for-byte
unchanged — it receives an already-absolute path from
`apply_to_os_environ` in the normal flow. The #239 MCP YAML-loading fix
is untouched.
Co-Authored-By: Claude <noreply@anthropic.com>
| `index_dir` | partial | `~` expanded; `$VAR` is NOT expanded. A YAML relative path resolves against the config file's directory (same base as `source_root`); the default `./.java-codebase-rag` sits beside the resolved `source_root`. |
223
-
| `embedding.model` (when path-shaped) | yes | Path-shape = starts with `/`, `./`, `../`, `~`, or contains `$`. Plain `org/name` is treated as a hub id and passed through. Applies to the value after CLI > env > YAML > default precedence. Long-lived MCP hosts also apply the same expansion when reading `SBERT_MODEL` from the process environment (so table metadata and search agree with `index_common` defaults). |
229
+
| `embedding.model` (when path-shaped) | yes | Path-shape = starts with `/`, `./`, `../`, `~`, or contains `$`; `~` / `$VAR` are expanded, then a result still `./` / `../`-prefixed is resolved to absolute. Plain `org/name` is treated as a hub id and passed through. Relative base (mirrors `index_dir`): a YAML `model` resolves against the config file's directory; `SBERT_MODEL` / `--embedding-model` resolve against `source_root`. Applies after CLI > env > YAML > default precedence. Long-lived MCP hosts also apply the same expansion when reading `SBERT_MODEL` from the process environment (so table metadata and search agree with `index_common` defaults). |
0 commit comments