Skip to content

fix(web): check a stream node's health right after it is added - #2294

Merged
Quick104 merged 1 commit into
Silo-Server:mainfrom
Rhainland:fix/web-admin-check-new-node
Oct 21, 2026
Merged

Quick104 merged 1 commit into
Silo-Server:mainfrom
Rhainland:fix/web-admin-check-new-node

Conversation

@Rhainland

@Rhainland Rhainland commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: #1176
Validation tasks: changes #1178 C1

A node that an admin has just added in Admin > Nodes shows as Unhealthy, checked Never, for up to 30 seconds, even when it is running and reachable. During that time Silo sends it no work. Nothing checks a new node until the next health sweep, and the create request deliberately doesn't contact the worker.

After a node is created, the web admin now runs the existing health check for it (POST /api/v2/admin/nodes/{id}/check) and reloads the list. The check stores its result, so a reachable node shows Healthy a moment after it is saved. Each server picks up the stored result on its next node-list reload, within about 5 seconds, and can then send it work.

Approach

  • The check runs after the create succeeds, under the same login and profile authority as the create. A failed check is ignored; the sweep checks the node anyway.
  • Updates and deletes don't trigger a check.
  • No server or API change.

Validation

  • Tests: a create runs one check for the new node and reloads the list after it; an update doesn't run a check. The create test fails without the change.
  • pnpm exec vitest run src/hooks/queries/admin/ src/pages/AdminNodes: pass.
  • In a local web admin, adding a running transcode node: before, the card showed Unhealthy and Checked Never until the next sweep; after, it showed Healthy and Checked just now within a few seconds of saving.
  • Gate: web lint, format, build, budget and make test-web pass, and so do the Go build, vet, lint and every verify-* target. make test-go fails on this macOS host in the same tests as on main; this change has no Go code.

Evidence: https://evidence.siloserver.org/r/silo-server/pr-2294/

Risks

None identified. The check is the same request the card's refresh button sends.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • The Evidence section shows every change a user can see, or says there is none.

AI Disclosure

  • Harness: Claude Code (running in T3 Code)
  • Tool(s): Claude Code, GitHub CLI, Playwright
  • Model(s): claude-opus-5-5
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: n/a

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T21:26:43.504103Z e738a67 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@silo-kody

silo-kody Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2111ea42-4c63-4a9c-9e68-97641654b79e
📥 Commits

Reviewing files that changed from the base of the PR and between a6a620c and e738a67.

📒 Files selected for processing (2)
  • web/src/hooks/queries/admin/nodeConfiguration.test.tsx
  • web/src/hooks/queries/admin/nodes.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.

📝 Walkthrough
📝 Walkthrough

Walkthrough

Successful node creation now triggers a health check for the new node. After the check settles, the nodes query is invalidated if write authority remains active. Tests cover the create and update mutation behavior.

Changes

Node creation health check

Layer / File(s) Summary
Create health check and refresh
web/src/hooks/queries/admin/nodes.ts, web/src/hooks/queries/admin/nodeConfiguration.test.tsx
Successful creates trigger a POST to the new node’s /check endpoint. Check failures are ignored, and the nodes query is invalidated after the check settles if the captured authority remains active. Tests verify two list invalidations for create and no health-check request for update.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: quick104

Merge Risk: ⚪ Minimal · up to e738a

Newly added nodes get an immediate health check instead of waiting for the next scheduled sweep. A failed check is ignored and the scheduled sweep still covers the node. No merge-blocking risk is evident.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly and concisely describes the main change: checking a node's health immediately after creation.
Description check Passed The description is directly related to the changeset and explains the problem, approach, validation, and expected behavior.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Quick104

Copy link
Copy Markdown
Contributor

Review summary

Reviewed head: e738a67. No defects found; nothing pushed.

What I checked

  • The new create test fails on the PR's base and passes on the head. The update test passes on both, which is expected for a guard.
  • The branch merges cleanly onto current main, which has since reworked web/src/hooks/queries/admin/nodes.ts. On that merge, all 398 tests under src/hooks/queries/admin/ and src/pages/AdminNodes pass, and the touched files type-check.
  • Server path: CheckAdminNode stores the result through the URL-fenced UpdateHealth, and the configuration reconciliation loop rebuilds each server's pools from that stored row. A check that lands before the new node reaches this server's pool still takes effect on the next reload. Other servers see it within about 5 seconds, not at once. I corrected that one sentence in the PR body.
  • Authority: the check runs and the list reloads only while the create's captured login and profile are still current, so a profile switch drops both. A stale-context error from the check is swallowed, and the sweep remains the fallback.
  • The manual check doesn't fetch the capability report the way the sweep does. That was already true of the card's refresh button, and the sweep marks a node healthy before its capability fetch finishes anyway, so this adds no new path.
  • Cross-provider round (GPT-6.1-Sol, one round, read-only): no findings beyond the timing wording above.

Left for the maintainers

  • Placement: a detached check after commit in the server's create handler would give every API client the same result, not just the web admin. The PR keeps the server contract unchanged ("No worker probe" on createAdminNode), and the web admin is the only first-party node admin client, so I scored it as a fit with a named stretch rather than a redirect.

Validated features

  • #1178 C1 (register a node and verify saved configuration) is listed as changed. It has not been run yet, so no passed case is affected.

User manual

  • running-a-server/transcode-nodes.md says Silo checks a new node within 30 seconds and to use the refresh button to check it right away. After this PR the web admin checks a new node as soon as it's saved. A siloserver.org issue should cover that page; none is linked.

Apple/Android parity: not applicable. Neither app manages nodes.

Fit: 8/10 · Readiness: 9/10 — conditional

  • Fit: it fixes a real gap in adding a node, reuses the existing check endpoint, and adds no API surface. It sits in the web client, though, where the server could cover every client.
  • Readiness: small and correct, guarded by the existing authority checks, and covered by a test that fails on the base. CI is green on this head.

@Quick104
Quick104 merged commit 2903186 into Silo-Server:main Oct 21, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working javascript Pull requests that update javascript code priority: P2 Limited scope, workaround exists, or polish size/M 50–199 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants