Repository navigation
Let the models directory be set independently of NODESPACE_HOME (#3791) - #3792
Conversation
Code Review SummaryThe change is small, correct and well-scoped. Acceptance criteria
1. Consumer auditDaemon consumers, both through
2. Semantics
3. Safety (isolated daemon pointed at the real models dir)I found no automatic deletion or rewriting of model files. Removals under the directory are:
Residual risks, none blocking:
4. Tests
5. AGENTS.md complianceNo lint suppression, no FindingsCritical Issues
Suggested Improvements
Nitpicks
RecommendationAPPROVE, no blockers. Fold in the test-isolation fix and the consumer-level test before merge; the rest is optional. Merge is the user's call. |
malibio
left a comment
There was a problem hiding this comment.
Verdict: APPROVE with suggestions, no blockers (full report in the comment above). Fold in before merge: clear NODESPACE_MODELS_DIR in the env-sensitive tests, add one test through resolve_model_path with the override set, and document that the value should be absolute. Not merging; that is the user's call.
Review addressed (commit e2ed82c)Addressed
Skipped
Daemon unit tests: 418 pass. Re-Review DecisionDecision: NO RE-REVIEW NEEDED Rationale: The reviewer approved with no blockers. The follow-ups are tests, a doc comment, and removal of a one-line passthrough. No behavior of 🤖 Generated with Claude Code |
#3791) models_dir() is always NODESPACE_HOME/.nodespace/models, so a run that isolates the home finds no models and the daemon downloads a second multi-GB copy into the throwaway home. NODESPACE_MODELS_DIR, when set and not empty, names the directory outright; unset or empty resolves under the home as before. Both daemon consumers (the chat models and the embedding model) already go through models_dir(). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…CE_MODELS_DIR, test the override through resolve_model_path - The env-sensitive tests (resolve_with and the two with_env tests) clear NODESPACE_MODELS_DIR, so a shell that exports it, which is the point of the feature, cannot decide their result. Verified by running them with it exported. - Two tests through resolve_model_path: a named directory is searched under an isolated home, and it replaces the home's directory rather than adding to it. - models_dir documents that the value should be an absolute path that exists; the one-line home_override_from hop is gone; GgufModelManager::with_dir describes the override. Skipped: rejecting a relative value (it matches NODESPACE_HOME, and the embedding path swallows a models_dir error with .ok()?, so a rejection would silently disable search); the dev-tooling helpers that hardcode ~/.nodespace/models (explicit overrides, irrelevant to the daemon). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
e2ed82c to
bc874e7
Compare
Summary
Closes #3791.
models_dir()was alwaysNODESPACE_HOME/.nodespace/models. That is right for isolating a database and a registry, but a run that isolates the home (an agent eval, a test harness) then found no models, and the daemon downloaded a second multi-GB copy into the throwaway home.NODESPACE_MODELS_DIR, when set and not empty, now names the directory outright. Unset or empty resolves under the home exactly as before. A run that wants the models already on the machine sets it to the real directory instead of linking one into the isolated home.Scope
models_dir()(the chat models inlocal_agent_service.rsand the embedding model inassembly.rs), so one change covers both.bundled_model.rs) reads the user's home by design, and the embedding fallback innlp-engineis only reached when the daemon passes no path, which it always does.Tests
bun run test:changedpasses (scripts, types, node-types and the Rust workspace).Follow-up
The eval runbook's setup block links the real models directory into the isolated home. That becomes
NODESPACE_MODELS_DIR=$HOME/.nodespace/modelsonce this lands, in the docs repository.🤖 Generated with Claude Code