Skip to content

Derive worker card label from head's live model (fail-closed) - #79

Closed
a2001eric-web wants to merge 1 commit into
MiaAI-Lab:mainfrom
a2001eric-web:feat/worker-derived-label
Closed

Derive worker card label from head's live model (fail-closed)#79
a2001eric-web wants to merge 1 commit into
MiaAI-Lab:mainfrom
a2001eric-web:feat/worker-derived-label

Conversation

@a2001eric-web

Copy link
Copy Markdown

Summary

Worker cards showed a hand-maintained workerLabel that went stale on every topology switch (e.g. 02 still said DeepSeek 0731 after moving to GLM-5.3-Flash EXL3). The snapshot now carries workerDerivedLabel, a display-only mirror of the head's live served model.

  • Mirror only when ALL hold: role is worker, workerHeadId resolves to another spark, and the head probe entry is available === true with a non-empty modelId
  • Unavailable/protected entries are skipped (they can retain a stale modelId), so a dead head never yields a stale model — fail-closed
  • A non-empty manual workerLabel still takes display priority; nothing writes back to config/sparks.json
  • Frontend (Overview + Spark header): manual > derived > fallback

Test plan

  • New server/sparks/__tests__/worker-derived-label.test.js: 8 tests (override priority, head-offline, standalone, self/unresolvable head, stale-entry skip pins)
  • Full suite: 180/180 pass
  • tsc --noEmit clean, vite build succeeds
  • Live-verified on a 2-node TP=2 deployment (head + worker): worker card mirrors head's live model; clearing manual label engages auto mode

Worker cards showed a hand-maintained workerLabel that went stale on
every topology switch. The snapshot now carries workerDerivedLabel, a
display-only mirror of the head's live served model: only when role is
worker, workerHeadId resolves to another spark, and the head probe entry
is available with a non-empty modelId. Unavailable entries are skipped
so a dead/protected head never yields a stale model. A non-empty manual
workerLabel still takes display priority; nothing writes back to config.
Adds 8 regression tests (override priority, head-offline, standalone,
self/unresolvable head, stale-entry skip).

@MikeGibbsOnyx MikeGibbsOnyx left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Verified locally against current main: clean diff, 180/180 tests pass including 8 new fail-closed worker-label tests, TypeScript check passes, production build passes. Reviewed resolver wiring and UI precedence; manual labels remain authoritative and stale/unavailable head models are excluded.

MikeGibbsOnyx added a commit that referenced this pull request Sep 8, 2026
@MikeGibbsOnyx

Copy link
Copy Markdown
Collaborator

Superseded: content landed on main via the 2026-09-08 backlog integration (main tip 950ac31, full suite 312/312 green). Credit preserved in the merge history.

plana-ai-agent added a commit to plana-ai-agent/sparkDash that referenced this pull request Sep 8, 2026
Upstream range: cc44d35..1573e76
Imported highlights:
- PR MiaAI-Lab#1-MiaAI-Lab#6 audit remediation merges (secure dashboard administration, durable registry, bounded live telemetry, fleet operations UX, secure installation, audit validation)
- Fleet energy telemetry (PR MiaAI-Lab#63), LLM trend chart (PR MiaAI-Lab#75), q27 LLM backend telemetry (PR MiaAI-Lab#74)
- LLM API key reconciliation (PR MiaAI-Lab#76), worker derived labels (PR MiaAI-Lab#79), undici security update (PR MiaAI-Lab#81)
- SSH transport reuse (PR MiaAI-Lab#77), monitor polling lifecycle isolation (PR MiaAI-Lab#59)
- llmTunnel.js new remote LLM tunnel collector, per-node LLM runtime settings
- hideWorkers setting, overview search/status filters (default off), remote bind/preflight
- Bench/PrefillBench/DecodeBench streaming resource fixes, websocket snapshot fix
Fork features preserved: GPU ECO (server/eco.js, EcoControl.tsx), Local LLM Runtime (server/localLlmSwitch.js, LocalLlmControl.tsx), worker SSH key auth in docker-compose.yml

# Conflicts:
#	.env.example
#	README.md
#	docker-compose.yml
#	package.json
#	server/settings.js
#	src/components/OverviewPage/OverviewPage.tsx
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.

2 participants