Skip to content

Report a failed embedding model load as non-retryable on every search path - #3686

Merged
malibio merged 1 commit into
mainfrom
issue-3683-model-load-failed-status
Oct 7, 2026
Merged

malibio merged 1 commit into
mainfrom
issue-3683-model-load-failed-status

Conversation

@malibio

@malibio malibio commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Closes #3683

Summary

  • The failed-load flag is process-global beside the missing and in-flight flags; embedding_model_unavailable() returns FAILED_PRECONDITION for it, so SearchNodes and FindSkillGuidance stop saying the model is loading.
  • Removed the injected SharedContext::model_load_failed, the EmbeddingsServiceImpl::new parameter and every hand-built SharedContext field (net -32 lines).
  • Added a daemon test that reaches the failed-load state with a non-model file and asserts the status through NodeService search. The docs section lists the failed-load status.

Test plan

  • bun run test:changed
  • no_model_search:: covers missing, failed and loading

🤖 Generated with Claude Code

@malibio

malibio commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator Author

Code Review: PR 3686 (issue 3683)

Verdict: APPROVE (posted as a comment, since the PR is self-authored). No blockers.

Requirements

  • Failed load returns non-retryable status on SearchNodes, FindSkillGuidance and EmbeddingsService: MET. All go through embedding_model_unavailable(), which returns FAILED_PRECONDITION "failed to load".
  • In-flight load still Unavailable/retry, missing file still no-model message: MET. The failed check runs first, but the two flags are mutually exclusive (a load only spawns when a file exists).
  • SharedContext::model_load_failed and the EmbeddingsServiceImpl flag removed: MET. Grep shows no remaining references; all 14 hand-built contexts updated.
  • Daemon test reaching failed-load through NodeService search: MET (no_model_search.rs).
  • Docs line in daemon-cli-lifecycle.md: MET (docs db81586).
  • Flag reset on every build_shared_services: MET.

Findings

  • Nit: assembly.rs build_shared_services (clear of SHARED_MODEL_LOAD_FAILED). A load task from an earlier call that finishes after a later call's clear could set the flag stale. This matches the existing SHARED_MODEL_MISSING and IN_FLIGHT semantics, and the process builds shared services once, so no change is needed.
  • Nit: embeddings_service.rs. The removed unit test (unavailable_reports_failed_precondition_once_load_failed) is covered by the new integration test. That test only asserts through NodeService search, not the EmbeddingsService RPCs, but both share the single function, so coverage is adequate.
  • Nit: no_model_search.rs. std::env::set_var and the process-global flags rely on nextest per-process isolation. This is the same as the existing test, and the comment there explains it. The new test lacks that comment but it is not needed.
  • No issue numbers in comments or docs, no lint suppression, no leftover unused imports (AtomicBool is still used in assembly.rs).

Recommendation

Approve and proceed through address-review, then merge.

@malibio malibio left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review: PR 3686 (issue 3683)

Verdict: APPROVE (posted as a comment, since the PR is self-authored). No blockers.

Requirements

  • Failed load returns non-retryable status on SearchNodes, FindSkillGuidance and EmbeddingsService: MET. All go through embedding_model_unavailable(), which returns FAILED_PRECONDITION "failed to load".
  • In-flight load still Unavailable/retry, missing file still no-model message: MET. The failed check runs first, but the two flags are mutually exclusive (a load only spawns when a file exists).
  • SharedContext::model_load_failed and the EmbeddingsServiceImpl flag removed: MET. Grep shows no remaining references; all 14 hand-built contexts updated.
  • Daemon test reaching failed-load through NodeService search: MET (no_model_search.rs).
  • Docs line in daemon-cli-lifecycle.md: MET (docs db81586).
  • Flag reset on every build_shared_services: MET.

Findings

  • Nit: assembly.rs build_shared_services (clear of SHARED_MODEL_LOAD_FAILED). A load task from an earlier call that finishes after a later call's clear could set the flag stale. This matches the existing SHARED_MODEL_MISSING and IN_FLIGHT semantics, and the process builds shared services once, so no change is needed.
  • Nit: embeddings_service.rs. The removed unit test (unavailable_reports_failed_precondition_once_load_failed) is covered by the new integration test. That test only asserts through NodeService search, not the EmbeddingsService RPCs, but both share the single function, so coverage is adequate.
  • Nit: no_model_search.rs. std::env::set_var and the process-global flags rely on nextest per-process isolation. This is the same as the existing test, and the comment there explains it. The new test lacks that comment but it is not needed.
  • No issue numbers in comments or docs, no lint suppression, no leftover unused imports (AtomicBool is still used in assembly.rs).

Recommendation

Approve and proceed through address-review, then merge.

@malibio

malibio commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator Author

Address review

The review was APPROVE with three nits and no change requested. Skipped all three:

  • Stale load task setting the flag after a later build_shared_services clears it: matches the existing missing and in-flight flags, and shared services are built once per process. Revisit if a daemon ever rebuilds them in-process.
  • Removed EmbeddingsService unit test: both services answer through the one shared function, which the integration test covers.
  • set_var relying on nextest's process-per-test: the sibling test already documents it.

Re-Review Decision

Decision: NO RE-REVIEW NEEDED

Rationale: No code changed after the review.

… path (closes #3683)

The failed-load signal is process-global next to the missing and in-flight
flags, so embedding_model_unavailable() answers FAILED_PRECONDITION for it
and NodeService search no longer says the model is loading. The injected
SharedContext::model_load_failed flag and its plumbing are gone.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@malibio
malibio force-pushed the issue-3683-model-load-failed-status branch from 0ec1674 to fea7845 Compare October 7, 2026 10:23
@malibio
malibio merged commit 64f2b60 into main Oct 7, 2026
@malibio
malibio deleted the issue-3683-model-load-failed-status branch October 7, 2026 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tell search the embedding model failed to load, not that it is loading

1 participant