Skip to content

fix(fusion): keep local server health per server - #1149

Draft
sosidudku1 wants to merge 1 commit into
mainfrom
fix/fusion-local-health-per-server
Draft

sosidudku1 wants to merge 1 commit into
mainfrom
fix/fusion-local-health-per-server

Conversation

@sosidudku1

@sosidudku1 sosidudku1 commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Problem (ATO-1318). With mixLocalModels on, role legs can run on a second local server. The health mark from ATO-917 was one flag for all local legs, and the only probe (llama.probeHealth()) asks the main server (localModels.url). So a wedge on one server could fail a worker sent to the other, and the main server's answer could clear the other server's mark.

Fix.

  • LocalLegHealth keeps one mark per leg, filed under the worker's provider id. noteCut, cause and readyForDispatch take the leg; isSuspect() with no leg still means "any".
  • New dep probeLocalHealthFor(providerId) returns the probe for that leg's own server, or undefined. The runtime returns the main client's probe only for a llama-server entry with no URL or the main URL. A leg with no probe is not checked, as the issue asks.
  • Without probeLocalHealthFor (tests, embedders) the old probeLocalHealth is used as before.

Default config (one local server) behaves the same as before.

Tests: two new cases in local-leg-health.test.ts (marks kept apart, a cut filed under the worker's own server); one existing case now names its leg.

This PR and #1139 (ATO-1317) both edit the noteCut(...) call at the end of runOneTask. Whichever merges second must keep options.providerId as the second argument and #1139's cause text, or every cut is filed under "local" and the health check silently stops; the test files a cut under the worker's own server catches it.

Merge note. #1139 also appends tests to the end of local-leg-health.test.ts; keep both sides.

Not yet checked on the second Mac.

With mixLocalModels two local servers can serve one fan-out, but the
health mark set after a cut-off worker was shared, and the only probe
asked the main server. A wedge on one server could fail a worker sent to
the other, and an answer from the main server cleared the other's mark.

Marks are now filed under the leg's provider id, and a leg is asked only
through its own server's probe. The runtime has a probe for the main
local server only, so a second server's leg is not checked rather than
checked against the wrong one. (ATO-1318)

This branch has not been deployed

No deployments
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.

1 participant