Skip to content

feat(nodes): let proxy and transcode nodes declare their configuration from the environment - #4499

Merged
Quick104 merged 23 commits into
mainfrom
feat/env-node-declarations
Nov 18, 2026
Merged

Quick104 merged 23 commits into
mainfrom
feat/env-node-declarations

Conversation

@Quick104

@Quick104 Quick104 commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: N/A
Validation tasks: none (no passed case changes for a node that sets none of the new variables; #1177 C1 and #1178 C1 cover registering a node and setting its group and caps in the admin UI, and a field a node declares is read-only there)

Other clients: Apple N/A (no node administration screen); Android N/A (no node administration screen); Roku N/A (no node administration screen)

A proxy or transcode node's group, caps, addresses and hardware overrides live only on its entry in the admin UI, so every node added from a Compose file or a Kubernetes manifest needs a second, manual step on the main server, and the two can drift apart. This change lets a node declare those fields from its own environment at startup. A field a node declares is read-only for administrators until the node starts without the variable, and a transcode node enforces what it declares itself, so a node run by someone other than the main server's administrator keeps the limits its owner set (the case raised in #4456).

Approach

A node reads its declaration from SILO_NODE_* variables (internal/nodedeclare):

Field Proxy Transcode node
name, URL SILO_NODE_NAME, SILO_NODE_URL (identity; NODE_NAME, NODE_URL still work) SILO_NODE_NAME, SILO_NODE_URL
public URL SILO_NODE_PUBLIC_URL
group SILO_NODE_GROUP SILO_NODE_GROUP
job cap SILO_NODE_MAX_STREAMS SILO_NODE_MAX_TRANSCODES
egress cap SILO_NODE_MAX_BANDWIDTH_KBPS
source access SILO_NODE_SOURCE_ACCESS
hardware acceleration and device SILO_NODE_HW_ACCEL, SILO_NODE_HW_DEVICE
prepared-download directory and budget SILO_NODE_DOWNLOAD_ARTIFACT_DIR, SILO_NODE_DOWNLOAD_ARTIFACT_MAX_BYTES

An unset or blank variable leaves its field to the administrator. A node declares at startup and sends the same declaration again every minute.

  • Storage. stream_nodes.env_managed lists the fields the node declared at its last start. One nodepool operation validates a declaration with the rules of an admin update, writes the fields and replaces env_managed in one transaction. The column is not configuration: changing it alone moves neither the row's revision nor the pool generation.
  • Proxy. A proxy has the database, so it writes its declaration to its row before its configuration watcher first reads it. It finds its row as the watcher does: by URL, then by name (its name variable, or the watcher's fallback proxy). Its URL and name stay its identity and are not declared. A proxy that matches no row behaves as before when it declares nothing and refuses to start when it declares something. With SILO_NODE_REGISTER=true it adds its own row instead. Registration is opt-in because a proxy can match no row and still have one, registered at the address clients reach it by; a second row at its own URL would hand clients an address they cannot reach.
  • Transcode node. A transcode node has no database, so it sends its declaration to the main server over a new signed node route, PUT /api/internal/nodes/self/registration, before its first configuration read. The main server applies it to the row the node's key names and then does what an admin update does afterward; a body with a field it does not know is refused whole, and so is a URL that any other node, proxy or transcode, already has under any spelling. The route has its own small per-node budget (a burst of six, one more every ten seconds), because a changed declaration makes every API server reload its node pools. A node that declares nothing sends an empty declaration once, which releases fields it declared at an earlier start, and does not wait on the answer. The legacy NODE_URL and NODE_NAME stay ignored on a transcode node, because shared env files set them and honoring them on upgrade would rewrite rows.
  • Enforcement on the transcode node. A row can be changed in the main server's database, so the node does not rely on it:
    • With SILO_NODE_MAX_TRANSCODES set, the node refuses new work once it runs that many jobs, counted as the active_jobs its health reports, with 503, Retry-After and X-Silo-Node-Refusal: at_capacity. Work for a job it already holds (an audio or quality switch, a seek, a rebuilt session) is not refused; a third transport for one playback session, or a prepared download it has to encode again, is new work. Admission is serialized, so two starts at the cap less one cannot both pass.
    • The main server treats that refusal as it treats a draining node: playback starts and trickplay try the next executor, prepared downloads now try another node before their existing fallback, and the planner holds the node back until its next health check or 30 seconds.
    • The node runs with its own declared acceleration, device, source access and prepared-download directory and budget, whatever the configuration document from the main server says. A hardware tone map names its backend only on a node that declares auto.
    • The declaration is sent again every minute, so a row or lock changed behind the node's back is put back without a restart. An unchanged declaration commits no configuration revision and reloads nothing.
    • Name, URL and group are placement and identity on the main server's side; the node cannot enforce them, only put them back. A proxy holds the main server's database and secrets, so it enforces nothing beyond its row.
  • Admin API and web. v2 node rows carry env_managed, and GET /api/v2/admin/nodes/capabilities reports env_declarations. updateAdminNode refuses a change to a declared field with 422 and the field code managed_by_environment; an update that restates the stored value still succeeds, so saving the whole form works. The node editor shows declared fields disabled with a note.

A transcode node declaring its own URL and source access is a maintainer decision; see Risks.

Validation

  • Go: build, gofmt, go mod tidy -diff, go vet, make lint-changed, make lint-router-recovery and make test-go pass.
  • Web: lint, format check, build, bundle budget and make test-web pass.
  • Contracts and hygiene: settings bindings, playback fixtures, route inventory, OpenAPI, web types, the v2 contract comparison, v2 fixtures, the committed-artifact test, local paths, case collisions, size ratchet, bidi and migrations pass.
  • The Postgres-backed node tests, including the new declaration test, pass against a migrated database.
  • Not run: make verify-actionlint and make verify-shellcheck (neither tool is installed where the gate ran; this change touches no workflow or shell script) and make verify-prometheus-rules (no Docker there).
  • New tests cover the declaration operation (fields written, env_managed replaced, a changed declared field refused, a URL another transcode node has), the registration route's refusals, the node's retry rules for each kind of answer, and variable parsing.

Evidence

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

Checked on isolated stacks (a main server, one proxy and one transcode node, with their own Postgres and Redis) built from this branch:

  • A proxy started with SILO_NODE_MAX_STREAMS and SILO_NODE_PUBLIC_URL, and a transcode node with SILO_NODE_MAX_TRANSCODES and SILO_NODE_HW_ACCEL. Each row took the declared values and listed those fields in env_managed; both nodes were healthy at the next health check.
  • An admin update that changed declared fields returned 422 naming each field with managed_by_environment. An update that restated them and renamed the node returned 200.
  • Restarting both nodes without the variables emptied env_managed and kept the stored values.
  • A proxy at a URL and name matching no row: with nothing declared it started and added no row; with a cap declared it refused to start and named SILO_NODE_REGISTER; with SILO_NODE_REGISTER=true it added an enabled row carrying the cap.
  • A proxy started against a database without the new column started without its declaration and applied it 30 seconds after the column appeared.
  • A proxy with no name variable, an unregistered URL and a declared cap applied the cap to the one row named proxy and added no row.
  • A transcode node restarted with nothing declared started, stayed healthy and had its env_managed emptied.
  • A transcode node started with the proxy's URL plus a trailing slash exited naming SILO_NODE_URL, and its row was unchanged. Started with its own URL, SILO_NODE_SOURCE_ACCESS=core and a cap, it applied all three, locked them and stayed healthy.
  • A transcode node with SILO_NODE_MAX_TRANSCODES=1: the first playback start ran on the node; for the second the node answered 503 and the main server ran the transcode itself, so the viewer got a playable stream; the third went local without trying the node.
  • With env_managed cleared in the database and the row set to a cap of 10, vaapi and core source access, the running node put the row and its locks back within one interval. While the row was wrong, the node's job still ran in software from its local mount, as it declared.
  • On the final build (5415791), with a cap of 1: a direct-stream remux GET on the full node got 503 with Retry-After: 5 and X-Silo-Node-Refusal: at_capacity, and a HEAD got 200; below the cap the GET and a seek returned media. A quality change on the full node was accepted (202) and played. A prepared download the node refused at its job limit, and one it refused with storage_full, were both placed again and ran on the main server. With no cap, a transcode, a remux and a seek all worked. No panics, data races or admission errors in the logs.
  • In the web admin, the node editor showed the declared fields disabled with "Set by this node's environment. Change it there and restart the node.", the other fields stayed editable, and saving the proxy's form unchanged returned 200.

Not checked on a running stack: the en-XA pseudo-locale, a capacity refusal of a trickplay run, two transports of one playback session overlapping on the node (a quality change replaced the transport without a visible overlap, and a third could not be produced through the API), a prepared download whose artifact answers another recipe, the hardware tone map backend rule, and a node against a main server that predates these changes. Those have unit tests only.

Surface and build: web admin, admin API and node startup. The first stacks ran this branch's changes before the rebase onto the current main and the translations pin; the fallback-name and release checks ran on a stack built from 9a46202's changes, and the URL and source access checks on one built from a78b950, after main was merged in, the cap and row checks on one built from 691b2d0, and the final checks on one built from 5415791.

Risks

  • A transcode node's key now changes its own row. Until now the key authenticated the node and an administrator set every field. With this change, whoever holds a node's key can set that node's name, URL, group, cap, source access, hardware overrides and download storage. The URL is the address the main server and proxies send that node's work to, and core source access makes the API servers serve the node the media for jobs it is given. It cannot touch another node's row, take another node's address, enable or disable itself, or issue keys.
  • Migration and upgrade order. One migration adds stream_nodes.env_managed with a default. Upgrade the main server first. A proxy on this build that starts before the migration starts without its declaration and retries every 30 seconds. Transcode nodes can be upgraded before or after the main server: against an older one, or behind a gateway that blocks the new route, a node that declares something warns, starts, and offers its declaration again every 30 seconds.
  • SILO_NODE_NAME on an existing transcode node. API servers already read that variable for their own identity, so a shared env file may carry it. A transcode node that has it set now renames its row to it and locks the name.
  • What the cap counts and where a refusal reaches a viewer. The cap counts every job the node reports as active: transcodes, progressive remuxes, prepared downloads and trickplay runs. A fresh progressive remux on a full node has no fallback, because the main server only contacts the node when it plans; the viewer gets 503 with Retry-After, as from a draining node today. Two things can put a node briefly over its cap: sessions a restarted node rebuilds are never refused, and one replacement transport may overlap the one it replaces (a quality switch), which is at most one extra process per playback session. The planner hold after a refusal is per API server; the others learn at their next health sweep.
  • A declared field cannot be edited in the admin UI. Changing it takes a change to the node's environment and a restart of the node.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
  • The Evidence section shows every change a user can see, or how I checked a change nobody sees.

AI Disclosure

  • Harness: Claude Code in T3 Code
  • Tool(s): GitHub CLI, Playwright (headless Chromium)
  • Model(s): claude-opus-5-5 (implementation), claude-fable-5-2 (design, review, verification)
  • Involvement: Fully AI-generated, directed by the maintainer; not yet human-reviewed
  • Adversarial review: none independent. claude-fable-5-2 reviewed the implementing agent's diff and made proxy self-registration opt-in after finding that automatic registration could add a second, client-unreachable row for a proxy registered under a different address.

🤖 Generated with Claude Code

Quick104 and others added 9 commits November 18, 2026 10:29
Add stream_nodes.env_managed and a store operation that applies a node's
declaration with the admin update rules and records exactly the declared
field names. Administrator updates that change a declared field are refused;
ones that restate it pass. A proxy with no row registers itself.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
PUT /api/internal/nodes/self/registration applies the declaration a transcode
node sends at startup to the row its key names, through the admin node
service, so every API server and proxy follows it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A proxy writes SILO_NODE_PUBLIC_URL, SILO_NODE_GROUP, SILO_NODE_MAX_STREAMS and
SILO_NODE_MAX_BANDWIDTH_KBPS to its row, registering itself when no row
matches, and accepts SILO_NODE_URL and SILO_NODE_NAME beside NODE_URL and
NODE_NAME. A transcode node sends its SILO_NODE_* declaration to the core
before its first configuration read.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Admin node rows carry env_managed, the node capabilities report
env_declarations, and updateAdminNode refuses a change to a declared field
with field code managed_by_environment.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…igrating

A proxy started beside its main server can reach the database before the
migration that adds env_managed. It now starts without its declaration and
applies it every 30 seconds until the column exists, instead of skipping it
until the next restart.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s set

A proxy whose URL and name match no row can still have one, registered at
the address clients reach it by. Creating a second row at its own URL
would hand clients an address they cannot reach, so registration is
opt-in. Without it, a proxy that declares nothing starts as before and
one that declares something refuses to start.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@silo-triage silo-triage Bot added the size/XXXL 3000+ added + deleted lines (all files); change volume, not priority. label Nov 18, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T19:36:47.207036Z 09eac9d New commits
🔒 Security Review ✅ Completed 2026-11-18T19:40:10.486181Z 09eac9d New commits

Security findings

Advisory findings (3)

ℹ️ 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 Nov 18, 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 ❌

@silo-triage silo-triage Bot added documentation Improvements or additions to documentation enhancement New feature or request go Pull requests that update go code javascript Pull requests that update javascript code priority: P2 Limited scope, workaround exists, or polish labels Nov 18, 2026
@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

Nodes can declare configuration through environment variables. The server stores declared fields and rejects conflicting administrator updates. Transcode nodes enforce declared job and prepared-download limits. Remote node selection responds to capacity refusals.

Changes: Node declarations and registration

Layer / File(s) Summary
Declaration storage and administrator validation
internal/nodepool/*, internal/api/handlers/admin_node_configuration.go, internal/apiv2/*, migrations/sql/*, contracts/api/v2/openapi.json, scripts/ci/db-contracts.txt
Node rows track environment-managed fields. Declarations validate and update node configuration. Administrator updates that change managed values return field-level validation errors.
Node registration and startup
internal/nodecontrol/*, internal/nodeconfig/*, internal/nodedeclare/*, cmd/silo/*, internal/api/router.go, internal/config/bootstrap.go, contracts/api/v2/route-inventory.json, .env.example, docker-compose.yml, docs/admin-api.md, docs/architecture/*, docs/update-to-1.0.md
Proxy and transcode nodes parse environment declarations and submit them through the node-control registration route. Proxy startup supports preferred SILO_NODE_* variables, legacy aliases, and optional self-registration. Registration retries and rate limits are added.
Managed-field administration
web/src/api/*, web/src/pages/AdminNodes.tsx, web/src/pages/adminNodesPresentation.ts, web/src/pages/adminNodesPresentation.test.ts
The admin node form disables managed fields and restores stored values in update requests. API types and schemas describe managed fields and declaration capability.
Transcode job and artifact limits
internal/transcodenode/*, contracts/api/v2/openapi.json, docs/architecture/worker-http-protocol.md
Transcode nodes reserve capacity for new jobs and refuse new work at the declared job cap. Prepared downloads also check the declared storage budget. Existing playback work follows continuation exceptions.
Capacity feedback and remote retries
internal/nodepool/*, internal/api/handlers/playback_transport.go, internal/api/handlers/playback_transport_security_test.go, internal/jellycompat/handlers_playback.go, internal/downloadprepare/transport.go, internal/downloads/remote_preparer.go, internal/trickplay/remote.go
Remote clients report recognized capacity refusals. The planner temporarily holds the affected node from new work. Remote artifact preparation retries eligible nodes after a capacity refusal.

Estimated code review effort: 4 (Complex) | ~60 minutes

Change: Feature

Suggested reviewers: rhainland

Merge Risk: Moderate · up to 3f3bc

Node declarations and job caps work as designed in the main paths. Several edge cases and documentation gaps remain open, including a protocol doc that overstates which remux requests bypass the job cap. Address or explicitly accept these before merging.

Security architecture risk: Moderate · up to 3f3bc

Two gaps need resolution: a node credential can now choose destinations for server-originated requests, and concurrent continuation requests can exceed the node owner's declared workload limit. Authentication and transactional configuration updates limit other forms of interference.

Retained concerns

  • Medium · security · inferred: A provisioned, enabled transcode node can use its node key to change its own URL to an unregistered internal or loopback HTTP destination. Declaration validation checks URL syntax and collisions, not destination authorization; configuration reconciliation then feeds that address to server-side health requests. This newly delegates outbound-request authority that previously required administrator-controlled configuration. The supported consequence is requests into networks reachable by API replicas, not demonstrated response disclosure or credential theft. Redirect refusal, request timeouts, and registration throttling bound behavior but do not prevent the initial request.
  • Medium · security · inferred: The new continuation exemption does not atomically reserve its permitted overlap. Several signed starts with distinct transport IDs can each observe one existing transport for the same playback session, skip admission, and subsequently spawn and register independently. Their transport-specific lifecycle locks do not serialize that shared playback identity, and countJob(nil) performs no capacity check. This can exceed both the declared cap and the documented one-extra-process allowance, weakening resource containment for a node operated separately from the core. It requires an authenticated caller and usable source authority; it is not an unauthenticated entrypoint bypass.
Security review details

Security Blast Radius

  • inferred — The destination-authority concern extends from one provisioned node identity to HTTP destinations reachable by API replicas consuming its configuration. The continuation concern affects that worker's process and compute capacity. Neither inspected path establishes cross-node key forgery, unrestricted file access, or an unauthenticated attack.

Security Findings and Attack Paths

  • inferred — The outbound-request path is signed self-registration, persistence of a node-controlled URL, pool reconciliation, then a health-check GET from the server. The health sink existed at the supplied base; the PR adds the lower-authority writer that makes this path security-relevant.

Trust Boundaries and Controls

  • observed — Source-byte access continues to require a verified grant bound to the authenticated node before opening the granted file. Declaring source-access mode is not, by itself, evidence of arbitrary source authorization.
  • observed — Declared hardware acceleration takes precedence over a fresh start's requested backend, with explicit exceptions for software operation and automatic hardware selection. The supplied public-entrypoint ranges are tests of these controls, not production HTTP entrypoints themselves.

Hardening Proposals

  • proposed — Keep endpoint approval separate from node self-declaration, or constrain declared destinations to an administrator-approved network policy. Preserve legitimate private-network deployment support rather than relying solely on a blanket private-address prohibition.
  • proposed — Represent continuation overlap as a reservation keyed by playback identity, acquired atomically with admission and released on failure or retirement, so concurrent transports cannot independently consume the same exemption.
Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: proxy and transcode nodes declaring their configuration from environment variables. It matches the changeset, which adds SILO_NODE_* declarations, the registration rou…
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.
Description check Passed The description is specific and related to the changeset. It explains that nodes declare group, caps, addresses, and hardware overrides from SILO_NODE_* variables at startup. It also covers the proxy …
Full details: Title check

Explanation

The title names the main change: proxy and transcode nodes declaring their configuration from environment variables. It matches the changeset, which adds SILO_NODE_* declarations, the registration route, and locked fields. The title is 91 characters, slightly above a short single-line title, but it is specific and accurate.

Full details: Description check

Explanation

The description is specific and related to the changeset. It explains that nodes declare group, caps, addresses, and hardware overrides from SILO_NODE_* variables at startup. It also covers the proxy and transcode-node registration paths, the read-only admin behavior for declared fields, the new PUT registration route, the job-cap refusal behavior, the migration, and the validation and risk notes. Its content matches the summarized file changes, including the migration, the admin API, the web editor, and the node enforcement logic.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9e35249414

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}

const nodeColumns = `id, name, type, url, public_url, enabled, healthy, active_jobs, node_group, max_jobs, max_bandwidth_kbps, egress_kbps, last_health_check, created_at, capabilities, capabilities_hash, capabilities_refreshed_at, last_stats, hw_accel_override, hw_device_override, capability_drift, capability_drift_baseline, network_access, download_artifact_dir_override, download_artifact_max_bytes_override, drain_requested, drain_state, node_key_ciphertext IS NOT NULL, source_access`
const nodeColumns = `id, name, type, url, public_url, enabled, healthy, active_jobs, node_group, max_jobs, max_bandwidth_kbps, egress_kbps, last_health_check, created_at, capabilities, capabilities_hash, capabilities_refreshed_at, last_stats, hw_accel_override, hw_device_override, capability_drift, capability_drift_baseline, network_access, download_artifact_dir_override, download_artifact_max_bytes_override, drain_requested, drain_state, node_key_ciphertext IS NOT NULL, source_access, env_managed`

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve proxy row reads before the declaration migration

When an upgraded proxy starts against a database without env_managed, declareProxyNode deliberately lets it run and retries the declaration later, but adding the column unconditionally to nodeColumns breaks its other row reads. In particular, newProxyPluginHost uses Repository.GetByID for its resident gate; that query now fails with undefined-column errors, so installed network-access providers cannot start. They remain unavailable until the main server migrates, indefinitely if it stays on the older version, despite the declaration fallback promising legacy operation. Keep the proxy's non-declaration row reads compatible with the pre-migration schema as well.

Useful? React with 👍 / 👎.

@Quick104 Quick104 Nov 18, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not changing this. The upgrade order for this pull request is main server first (its migration adds the column), then proxies; it is in the Risks section. A proxy on this build against a main server that stays on the older version is not a supported state, and it is the same for every column nodeColumns has gained, source_access in #4338 most recently.

The case the declaration retry exists for is a Compose stack where the proxy starts while the main server is still migrating. There the resident gate recovers by itself: newProxyResidentGate runs on every reconcile, a failed read fails only that reconcile, and the lifecycle poll calls it again, so it passes once the migration lands.

🤖 Claude Code in T3 Code (claude-fable-5-2)

Comment thread cmd/silo/proxy_declaration.go Outdated
Comment on lines +73 to +78
if errors.Is(err, nodepool.ErrProxyNotRegistered) {
if len(input.SetFields()) == 0 {
// As before declarations: the watcher reports the missing row.
return nil, nil
}
return nil, fmt.Errorf("this proxy declares configuration but matches no node on the main server by URL (%s) or name: add it there, or set %s=true to have it add itself", nodeURL, envNodeRegister)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

kody code-review Bug high

Missing proxy rows bypass the migration retry path

During a concurrent migration, a proxy declaring fields without self-registration can exit before its row is created because DeclareProxy returns ErrProxyNotRegistered before the env_managed retry path. Retry this missing-row case during startup.

Prompt for LLM
File cmd/silo/proxy_declaration.go, lines 73-78:

Missing proxy rows bypass the migration retry path

A proxy declaring fields without self-registration exits during a concurrent migration when its row has not yet been created, because `DeclareProxy` returns `ErrProxyNotRegistered` before accessing `env_managed`, so the migration retry branch never runs. Retry this missing-row case during startup instead of treating it as an immediately permanent error.

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not a defect. The migration does not create a proxy's row; an administrator adds it, or the proxy does with SILO_NODE_REGISTER=true. findProxyRow reads only id and type, so the missing-row answer is the same before and after the migration and retrying would not change it. A proxy that declares fields with no row to hold them refuses to start by design and names the fix; a restart policy brings it back once the row exists.

🤖 Claude Code in T3 Code (claude-fable-5-2)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Agreed. The suggestion conflates a missing proxy row with a missing migration: the migration adds env_managed but does not create the row. If no row matches and self-registration is disabled, refusing to start with an actionable error is the intended behavior.

Retrying could allow startup if an administrator subsequently creates the row, but that is a separate startup-policy choice—not a fix for the migration retry path. I withdraw the suggestion.

Comment thread internal/nodecontrol/registration.go Outdated
Comment on lines +36 to +41
var registration Registration
if err := json.NewDecoder(http.MaxBytesReader(w, r.Body, MaxBodyBytes)).Decode(&registration); err != nil {
http.Error(w, "invalid registration", http.StatusBadRequest)
return
}
node, err := s.opts.Registrar.DeclareNode(r.Context(), id, registration.Input())

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

kody code-review Security high

A node key can redirect core health checks to arbitrary internal hosts

A transcode node key holder can direct periodic CheckNodeReport requests to arbitrary internal HTTP hosts. Restrict node-declared URLs to administrator-approved destinations or make URL changes administrator-only.

Prompt for LLM
File internal/nodecontrol/registration.go, lines 36-41:

A node key can redirect core health checks to arbitrary internal hosts

A holder of a transcode node key can set its URL to an arbitrary HTTP host, causing the core's periodic `CheckNodeReport` to send requests to internal services at that host. Restrict node-declared URLs to administrator-approved destinations or retain URL changes as an administrator-only operation.

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is a maintainer decision, recorded under Risks in the description: a transcode node may declare its own URL and source access. Leaving the thread open for the maintainer.

For the record, what the route allows: the URL must be an absolute http or https URL, it applies only to the row the key names, another transcode node's URL is refused, and the requests the main server then sends there are the signed node requests it already sends to that row.

🤖 Claude Code in T3 Code (claude-fable-5-2)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Understood. This remains a maintainer decision, and the thread can stay open.

The stated restrictions limit which row the node can change and require an HTTP or HTTPS URL, but they do not prevent that URL from pointing to an internal service. Signing the requests also does not by itself eliminate that risk. The maintainer can decide whether to accept that expanded trust in a node key or require administrator control over destinations.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛡️ Codex Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: 9e35249414

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment on lines +37 to +38
NodeTypeTranscode: {FieldName, FieldURL, FieldGroup, FieldMaxJobs, FieldSourceAccess,
FieldHWAccelOverride, FieldHWDeviceOverride, FieldDownloadArtifactDirOverride, FieldDownloadArtifactMaxBytesOverride},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛡️ Codex Security Review · Automatically triggered

P2 Badge Security: Keep node URL changes administrator-authorized

A holder of an enabled transcode-node key who can reach the core can now submit an arbitrary url in the self-registration body. After reconciliation, an attacker-controlled endpoint can answer the expected health response and receive future /transcode/start requests, which include the media path, user/profile identifiers, and a source grant redeemable with the same node key for file bytes. Per-node authentication and rate limits do not prevent this because the attacker possesses the credential. Keep routing URLs admin-managed, or require a separate admin-approved registration capability.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is the maintainer decision recorded under Risks in the description: a transcode node may declare its own URL. Leaving the thread open for the maintainer.

One point of scope: whoever holds a node's key already is that node as far as the main server is concerned. It already receives that node's /transcode/start requests at the registered URL and can redeem their source grants. What the declaration adds is the ability to move where those requests go.

🤖 Claude Code in T3 Code (claude-fable-5-2)

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 9

Note

Due to the large number of review comments, Critical, Major severity comments were prioritized as inline comments.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (2)

Major · A worker can make the API server send requests to an arbitrary destination… · declaration.go:202

internal/nodepool/declaration.go:202
Major · Security & Privacy · Detected with Advanced Tier · Heavy lift

SSRF

Reachability: External
Exploitability: Moderate
CWE: CWE-918 — Server-Side Request Forgery (SSRF)

A worker can make the API server send requests to an arbitrary destination through its declared URL.

The declared transcode url passes only a syntax check. absoluteHTTPURL accepts any absolute http or https URL with a host (internal/nodepool/declaration.go:202). declareInTx checks only uniqueness, and Declare writes the row for the authenticated node id.

CheckNodeReport then sends a GET to NodeEndpoint(n.URL, "/api/v1/health") (internal/nodepool/health.go:147). Its http.Client sets CheckRedirect: RefuseRedirects but no Transport, so this request does not use NodeDialContext. Neither URL syntax nor redirect refusal limits the first destination. The response body is parsed as the health JSON, and its last_stats content is stored and shown to administrators (health.go:100, health.go:184).

Impact: a holder of a valid node key can make the API server send GET requests to any host it can route to, including non-worker services. The sender can read the outcome through the health status and the stored fields. The exploit requires a node key.

Required behavior: the health request must not reach a destination that the node is not approved to serve. Enforce this before the request is sent. URL syntax, uniqueness, and redirect refusal do not satisfy this requirement.

Minor · Exclude host node declarations from the core-only startup test. · transcode_node_test.go:148

cmd/silo/transcode_node_test.go:148
Minor · Functional Correctness · Quick win

Exclude host node declarations from the core-only startup test.

If the test runner exports SILO_NODE_URL=not-a-url, nodeEnv passes it to the child. The new declaration parser rejects it before the child reaches the fake core, so the health check fails even though the test supplies a valid core URL and key. Filter the variable names from nodedeclare.Variables(nodepool.NodeTypeTranscode) before appending explicit test overrides. (raw.githubusercontent.com)

Minor comments: 25

internal/nodecontrol/protocol_registry.go: 2

76-76: Minor · Functional Correctness · Quick win

Document {} as the request that unlocks every field.

A client that sends an empty body as documented gets HTTP 400. HandleRegistration rejects the body before it calls DeclareNode. Say “an empty JSON object ({}) unlocks every field” and keep the request body required.


76-76: Minor · Data Integrity & Integration · Quick win

Clarify when a 422 refusal identifies a field.

When DeclareNode returns ErrInvalidNodeInput, the handler sends 422 invalid with an empty field and the detail "invalid node configuration". A client cannot always use field to identify a rejected input. Document that field-specific refusals name the field and general refusals leave it empty.

internal/nodecontrol/protocol.go: 1

31-31: Minor · Functional Correctness · Quick win

Do not report a deleted node row as an unsupported core.

When the node row is deleted after authentication and before DeclareNode updates it, the handler returns a plain-text 404 (internal/nodecontrol/registration.go:81-84). The client maps any 404 without a refusal body to a status-only StatusError (internal/nodecontrol/registration.go:127,130). nodeconfig.Declare then classifies that status as a core without the registration route and returns ErrRegistrationUnsupported (internal/nodeconfig/declare.go:39-41,60-66). A core that serves registration can therefore be reported as unsupported.

Make this case produce a response that the client cannot confuse with a route miss. The required behavior is that a deleted node row does not produce a result that registrationUnsupported accepts. The choice of status or refusal reason is open.

contracts/api/v2/openapi.json: 2

248967-248970: Minor · Data Integrity & Integration · Quick win

Reject max_jobs values outside the database range.

On a 64-bit core, 2147483648 passes the registration schema and declaration validation but cannot be bound to the repository's PostgreSQL integer parameter. The handler returns a transient 503 for a permanent input error. A caller using nodeconfig.Declare retries until canceled. Validate 0 through 2147483647 before the write, return a field-level 422 outside that range, and generate the same bounds in the schema. The built-in environment parser already rejects this input. (raw.githubusercontent.com)


248951-248953: Minor · Data Integrity & Integration · Quick win

Bound declared group values to the admin update limit.

A declared SILO_NODE_GROUP longer than 1,024 characters can be accepted and stored. Declaration validation trims the value and checks nothing else. The stream_nodes.node_group column is unbounded text. The v2 admin update body rejects group above 1,024 characters. A save that resends the stored group can fail with a validation error. The group stays locked until the node restarts with a shorter value.

Choose one contract and enforce it at the declaration boundary before storage. Either the declaration path refuses a group above the admin limit with a field refusal that names group, or both contracts use the same larger limit. Measure the limit in the same unit the admin contract uses. Keep an empty or whitespace-only group as an unset value.

internal/nodepool/declaration_db_test.go: 1

86-86: Minor · Functional Correctness · Quick win

Use a live context to delete the proxy fixture.

Go cancels t.Context() before it runs cleanup callbacks. The delete uses that canceled context and ignores the error, so the committed proxy row can remain after the test. Use a fresh context with a timeout inside the callback and report any delete error. Keep t.Context() for the test body. (pkg.go.dev)

internal/nodepool/admin_configuration.go: 1

232-232: Minor · Functional Correctness · Quick win

Check URL ownership before URL uniqueness.

If a transcode node declares its URL and an administrator submits a canonical alias of another node's URL, checkTranscodeURLFree returns ErrTranscodeNodeURLTaken before this check runs. The update is refused, but the form does not get managed_by_environment for url.

Under the row lock, compare the normalized candidate with the stored managed URL before checking uniqueness. Keep normalized restatements valid and keep duplicate checks for editable URLs.

internal/nodepool/declaration.go: 2

353-353: Minor · Data Integrity & Integration · Quick win

Lock the proxy row during lookup so the match is checked under that lock.

findProxyRow reads the candidate row without a lock. declareInTx locks the row later and does not recheck the match. An administrator can change that row's URL or name in the gap, and the proxy's declaration is then written to the reassigned row. Its env_managed and declared field values are overwritten. Admin Update does not take proxyRegistrationLock, so the advisory lock does not close the gap.

Take the row lock in the lookup itself. Under READ COMMITTED, PostgreSQL re-checks the WHERE clause after a locked row is released by a concurrent commit.

Suggested fix

-	matches, err := query(`SELECT id, type FROM stream_nodes WHERE rtrim(url, '/') = rtrim($1, '/') ORDER BY id LIMIT 1`, nodeURL)
+	matches, err := query(`SELECT id, type FROM stream_nodes WHERE rtrim(url, '/') = rtrim($1, '/') ORDER BY id LIMIT 1 FOR UPDATE`, nodeURL)
-		if matches, err = query(`SELECT id, type FROM stream_nodes WHERE name = $1 ORDER BY id LIMIT 2`, nodeName); err != nil {
+		if matches, err = query(`SELECT id, type FROM stream_nodes WHERE name = $1 ORDER BY id LIMIT 2 FOR UPDATE`, nodeName); err != nil {

296-296: Minor · Data Integrity & Integration · Detected with Advanced Tier · Poor tradeoff

Reject an older registration declaration that arrives after a newer one.

The registration write in internal/nodepool/declaration.go does not check declaration order. The UPDATE stream_nodes SET env_managed = $2 WHERE id = $1 RETURNING env_managed statement at line 296 replaces the stored value whatever its age. The transaction serializes concurrent writes, but it does not stop a delayed or replayed signed PUT from overwriting a newer declaration. A node that declares group, clears it, and then has its first signed request replayed can have the lock restored until its next declaration.

Node-signed requests accept a replay within the 30-second maxSkew window, and no nonce cache exists. That replay window applies to every node-signed request. It is not specific to this endpoint, so the fix belongs in the registration write, not in the signing scheme. The replay can only restore a value that the same node declared earlier. It does not let a caller set arbitrary values.

Persist a per-node declaration generation in the same transaction as the write. An older generation must not change the row. An exact retry of the current generation should succeed without another write.

internal/nodecontrol/registration.go: 1

37-37: Minor · Functional Correctness · Quick win

Validate the complete registration body before writing.

A signed request with {} followed by another JSON value passes this check. Decode reads only the first value, so the handler invokes DeclareNode before rejecting the extra data. An empty declaration clears existing managed-field locks. The same early return from decoding can leave data beyond MaxBodyBytes unread. Keep the bounded decoder and require EOF after the first value. A standalone {} must still clear the locks. (pkg.go.dev)

internal/config/bootstrap.go: 1

88-88: Minor · Functional Correctness · Quick win

Reject a whitespace-only proxy URL during bootstrap.

If SILO_NODE_URL contains only spaces and NODE_URL is unset, bootstrap passes. proxyNodeIdentity then trims the value to an empty string, and DeclareProxy rejects it later. Trim both candidates before the presence check. A blank preferred value must still allow a valid NODE_URL fallback. (raw.githubusercontent.com)

internal/nodecontrol/registration_test.go: 2

55-55: Minor · Stability & Availability · Quick win

Synchronize the registrar state shared by the test and HTTP server.

The HTTP handler writes registrar.declared, and the test reads it after the TCP response. The response does not synchronize access to the map. The same problem applies to registrar.err, which the test writes and the handler reads. Protect both fields with a mutex and read the map through a locked snapshot. Remove the unused reset of f.server.opts.Registrar; the old-core case uses a different server. (go.dev)

Also applies to: 72-72


48-50: Minor · Functional Correctness · Quick win

Assert that the wrong-key request makes no write.

If the handler runs after a 401, it can record the same node and group as the valid request that follows. That request overwrites the entry, so the final map assertion still passes. Check that the registrar is untouched immediately after the 401. (raw.githubusercontent.com)

internal/nodeconfig/declare.go: 1

32-32: Minor · Security & Privacy · Detected with Advanced Tier · Heavy lift

Sensitive Data Exposure

Reachability: External
Exploitability: Moderate
CWE: CWE-319 — Cleartext Transmission of Sensitive Information

Protect signed registrations in transit.

If SILO_CORE_URL uses non-loopback HTTP, startup logs a warning and still sends a signed registration. The signing key stays local, but an on-path observer can read the declaration and its authentication header. The captured request remains valid within the verifier's timestamp window. Redirect blocking does not protect this first hop. Require authenticated encryption for remote registration requests, with a separate local-only path if needed. (raw.githubusercontent.com)

cmd/silo/transcode_node.go: 1

286-286: Minor · Data Integrity & Integration · Quick win

Retry the empty declaration when the core does not support declarations.

When the main server does not serve the registration route, an empty declaration returns without a retry. The env_managed value from an earlier declaration stays in the database, so max_jobs remains locked in the admin UI. The node sends no declaration again until it restarts. This happens when a restart without the variable reaches a core that lacks the route, such as one replica in a mixed-version rollout. A restart after the rollout clears the lock.

The node must keep offering the empty declaration after an unsupported response. The retry can still stay silent for an undeclared node, and the warning can still apply only when variables are declared.

web/src/pages/AdminNodes.tsx: 1

1310-1310: Minor · Functional Correctness · Quick win

Keep the managed device value visible when the backend changes.

If only hw_device_override is managed and the operator switches from QSV to NVENC, selectHWAccelOverride clears the device draft. The disabled input then appears empty, but Save restores the stored render path. Use the stored value for a managed device field and explain why it cannot be changed here. Keep clearing the draft on syntax changes when the device field is editable.

web/src/pages/adminNodesPresentation.ts: 1

1714-1717: Minor · Functional Correctness · Quick win

The Downloads storage editor does not honor environment locks on directory or budget.

EditLocationDialog reads only the stored override values. It never reads env_managed. Its directory input and budget controls stay editable for an environment-managed node. save() sends a changed directory or budget regardless of the lock. The server then rejects the change with managed_by_environment, so the user sees a failed save for a field the dialog allowed them to edit.

Derive the locked set from node.env_managed, as the main node form does. Disable the directory input and the budget controls for locked fields, and show the same lock reason. In save(), leave locked keys out of body. A budget-only save must still succeed when only the directory is locked, and the reverse must also hold.

.env.example: 1

121-123: Minor · Data Integrity & Integration · Quick win

Distinguish proxy identity from the address stored on the node row.

If a proxy matches an existing row by name, the declaration leaves that row's URL unchanged. The main server checks the proxy at the stored URL, which can differ from SILO_NODE_URL. Describe SILO_NODE_URL as the proxy's identity and the URL used for self-registration, not as the address the main server always uses.

docs/admin-api.md: 3

540-542: Minor · Maintainability & Code Quality · Quick win

Keep upgrade instructions in the update guide or user manual.

This paragraph tells operators which components to upgrade first. Keep the migration dependency and fallback behavior in the API reference, but move the upgrade procedure to docs/update-to-1.0.md or the user manual. Apply the same distinction to the proxy setup advice.

As per coding guidelines, “Guides for installing, configuring, operating, or troubleshooting Silo belong in the user manual”; docs/update-to-1.0.md is the stated exception.

Source: Coding guidelines


545-547: Minor · Functional Correctness · Quick win

Document when transcode declaration retries stop.

If an upgraded core rejects a declared URL because another transcode node owns it, RetryDeclaration logs the refusal and stops. The node keeps running with its stored configuration. State that a permanent refusal ends the retries and that the operator must correct the setting or conflict before restarting the node.


543-544: Minor · Functional Correctness · Quick win

Document that a missing row ends the declaration retry.

Lines 540-544 say a proxy that starts before the migration applies its declaration every 30 seconds until the column exists. The retry does not continue after that point when no row matches the proxy. Once the column exists, the proxy makes one attempt. If no row matches, it logs an error and does not retry, even if an administrator adds the row later. A declaring proxy then keeps its stored configuration until it restarts.

State this exit condition in the upgrade paragraph, so an operator knows to restart the proxy after adding the row.

docs/architecture/transcode-nodes.md: 4

204-206: Minor · Functional Correctness · Quick win

Qualify the first configuration read on registration success.

If the core does not support registration, the node reads the stored configuration before the declaration takes effect. State that the first read reflects the declaration only if the core accepts it before that read.


241-242: Minor · Data Integrity & Integration · Quick win

Specify {} as the request body that clears managed fields.

A zero-byte body fails JSON decoding. HandleRegistration returns 400 before it calls DeclareNode, so the fields stay managed. A JSON object with no fields ({}) reaches the store and clears env_managed without changing the stored values.


980-980: Minor · Functional Correctness · Quick win

Limit the retry summary to nodes with declared fields.

The registration table says a node with nothing declared starts silently against an older core. This row says it retries every 30 seconds without that condition. Add the condition here and use the registration section for the retry stop conditions.


247-247: Minor · Data Integrity & Integration · Quick win

Document that a 422 can omit field and name no variable.

The 422 row assumes that field always names a declared variable. The core sends an empty field for an invalid configuration that it does not attribute to a field. The field key is still present in the body, but its value is "". The node then cannot name a variable, and its startup error omits the variable name. Update the row to state this condition.

Suggested fix

-| `422` | `{"reason": "invalid", "field", "detail"}` | Exits, naming the variable for `field`. |
+| `422` | `{"reason": "invalid", "field", "detail"}` | Exits, naming the variable for `field`. When `field` is empty, it exits without naming a variable. |
Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d6aa4052-dcf2-4529-b620-6748827ceeb1
Commits

Reviewing files that changed from the base of the PR and between d15a890 and 9e35249.

Files selected for processing: 87

  • .env.example
  • .silo-translations
  • cmd/silo/main.go
  • cmd/silo/proxy_declaration.go
  • cmd/silo/transcode_node.go
  • cmd/silo/transcode_node_test.go
  • contracts/api/v2/openapi.json
  • contracts/api/v2/route-inventory.json
  • docker-compose.yml
  • docs/admin-api.md
  • docs/architecture/omnibus-image.md
  • docs/architecture/transcode-nodes.md
  • docs/architecture/worker-http-protocol.md
  • docs/update-to-1.0.md
  • internal/api/handlers/admin_node_configuration.go
  • internal/api/router.go
  • internal/apiv2/admin_node_configuration.go
  • internal/apiv2/admin_node_configuration_test.go
  • internal/apiv2/admin_node_drain.go
  • internal/apiv2/admin_nodes_read.go
  • internal/apiv2/problem.go
  • internal/config/bootstrap.go
  • internal/nodeconfig/declare.go
  • internal/nodeconfig/declare_test.go
  • internal/nodeconfig/watcher.go
  • internal/nodecontrol/fixture_test.go
  • internal/nodecontrol/limit.go
  • internal/nodecontrol/protocol.go
  • internal/nodecontrol/protocol_registry.go
  • internal/nodecontrol/registration.go
  • internal/nodecontrol/registration_test.go
  • internal/nodecontrol/server.go
  • internal/nodedeclare/nodedeclare.go
  • internal/nodedeclare/nodedeclare_test.go
  • internal/nodepool/admin_configuration.go
  • internal/nodepool/declaration.go
  • internal/nodepool/declaration_db_test.go
  • internal/nodepool/repository.go
  • migrations/sql/20261118141948_add_stream_node_env_managed.sql
  • scripts/ci/db-contracts.txt
  • web/src/api/types.ts
  • web/src/api/v2/schema.ts
  • web/src/locales/ar-XB.json
  • web/src/locales/ar.json
  • web/src/locales/bg.json
  • web/src/locales/ca.json
  • web/src/locales/cs.json
  • web/src/locales/da.json
  • web/src/locales/de.json
  • web/src/locales/el.json
  • web/src/locales/en-XA.json
  • web/src/locales/en.json
  • web/src/locales/es.json
  • web/src/locales/et.json
  • web/src/locales/fi.json
  • web/src/locales/fr.json
  • web/src/locales/he.json
  • web/src/locales/hi.json
  • web/src/locales/hr.json
  • web/src/locales/hu.json
  • web/src/locales/id.json
  • web/src/locales/it.json
  • web/src/locales/ja.json
  • web/src/locales/keys.ts
  • web/src/locales/ko.json
  • web/src/locales/lt.json
  • web/src/locales/lv.json
  • web/src/locales/ms.json
  • web/src/locales/nb.json
  • web/src/locales/nl.json
  • web/src/locales/pl.json
  • web/src/locales/pt-BR.json
  • web/src/locales/pt-PT.json
  • web/src/locales/ro.json
  • web/src/locales/ru.json
  • web/src/locales/sk.json
  • web/src/locales/sl.json
  • web/src/locales/sv.json
  • web/src/locales/th.json
  • web/src/locales/tr.json
  • web/src/locales/uk.json
  • web/src/locales/vi.json
  • web/src/locales/zh-Hans.json
  • web/src/locales/zh-Hant.json
  • web/src/pages/AdminNodes.tsx
  • web/src/pages/adminNodesPresentation.test.ts
  • web/src/pages/adminNodesPresentation.ts

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

Comment thread cmd/silo/main.go Resolved
Comment thread cmd/silo/proxy_declaration.go Outdated
return
case <-ticker.C:
}
_, err := applyProxyDeclaration(ctx, pool, eventBus, nodeURL, name, input)

@coderabbitai coderabbitai Bot Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Major · Data Integrity & Integration · Heavy lift

Hand the watcher the row from a successful retry.

The migration retry discards the row that applyProxyDeclaration returns. If the retry creates a row and an administrator changes its URL and name before the watcher's next lookup, the watcher cannot find it using its startup strings. The API then uses the new row while the proxy remains detached from that row's overrides and drain state. Pass the returned ID and URL into a serialized watcher reload. Keep the existing pre-start pin for immediate success. (raw.githubusercontent.com)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not changing this. It needs a proxy that starts mid-migration, creates its own row on a retry, and then has an administrator change both that row's URL and its name within the watcher's next reload (60 seconds). After a reload the watcher holds the row by id, as it does for any row it finds by URL or name.

🤖 Claude Code in T3 Code (claude-fable-5-2)

Comment thread cmd/silo/proxy_declaration.go Resolved
Comment thread cmd/silo/transcode_node.go Resolved
Comment thread contracts/api/v2/openapi.json Resolved
Comment thread docs/update-to-1.0.md Resolved
Comment thread internal/nodepool/declaration.go Resolved
}
updateMutation.mutate({ node, body }, { onSuccess: onClose });
updateMutation.mutate(
{ node, body: restoreEnvManagedFields(body, node) },

@coderabbitai coderabbitai Bot Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Major · Functional Correctness · Heavy lift

Reject the NVENC backend when a managed render-path device override remains.

The server accepts an nvenc backend while hw_device_override is a managed render path. Validate and ValidateFor check the acceleration enum and source_access only, and nothing checks the device against the backend. restoreEnvManagedFields also restates the stored render path into the save. The stored pair is then committed. The form's NVENC branch already states that render devices are not what NVENC addresses, so the saved configuration is incompatible.

The disabled device field also shows the cleared draft when the backend changes. The admin therefore cannot see the value that the save commits.

Either refuse the save with an error that names the managed SILO_NODE_* declaration, or keep the device field showing the stored managed value and block the backend change. The choice between these paths is open. Whichever path applies must not commit an NVENC backend with a managed render-path device override.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Display part fixed in 9a46202: changing the backend no longer clears a device the node declares, so the disabled field keeps showing the value the save restates. Not changed: the server accepting an acceleration backend and a device that do not go together. Neither an admin update nor a declaration checks that pair on main either, so it is left as a separate question.

🤖 Claude Code in T3 Code (claude-fable-5-2)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Analysis chain

Script executed:

#!/bin/bash
set -u
printf '%s\n' '--- Current revision and available base refs ---'
git rev-parse HEAD
git branch -a
printf '%s\n' '--- Current form guard ---'
ast-grep outline web/src/pages/AdminNodes.tsx --match NodeForm --view expanded 2>/dev/null || true
rg -n -C 5 'function selectHWAccelOverride|restoreEnvManagedFields\(body' web/src/pages/AdminNodes.tsx
printf '%s\n' '--- Node update and declaration validation ---'
ast-grep outline internal/nodepool/declaration.go --match 'ValidateDeclaration|Declare' --view expanded 2>/dev/null || true
rg -n -C 4 'func .*Validate(For)?\(|func ValidateDeclaration\(|hw_device_override|HWDeviceOverride' internal/nodepool -g '*.go' | head -240
printf '%s\n' '--- Base form and validation, if available ---'
if git rev-parse --verify origin/main >/dev/null 2>&1; then
  git show origin/main:web/src/pages/AdminNodes.tsx | rg -n -C 5 'function selectHWAccelOverride|hwDeviceSyntaxChanges'
  git grep -n -E 'func .*Validate(For)?\(' origin/main -- internal/nodepool || true
fi

Length of output: 21900


@Quick104 I checked 9a462025b2. The form now preserves the displayed device override when it is environment-managed.

I accept treating backend and device compatibility validation as a separate question. Since that part is unchanged, I’m not marking the full finding as addressed.


Learnings used

Learnt from: Quick104
Repo: Silo-Server/silo-server PR: 794
File: internal/api/handlers/nodes.go:213-243
Timestamp: 2026-08-27T18:47:36.062Z
Learning: In `internal/api/handlers/nodes.go`, `HandleUpdateNode` must still publish a persisted per-node hardware acceleration override when `reloadNodeConfig` does not confirm it. Suppressing the pool reload or excluding the node has no reconciliation path and can leave the override inactive indefinitely. The node configuration watcher polls within 60 seconds, so the accepted current behavior is a logged, bounded mismatch between the API-dispatched backend and the node-local device. Eliminating that mismatch requires a future transcode start-contract change that sends the effective hardware device together with the effective backend, including the recipe-card rebuild path.

You are interacting with an AI system.

- A proxy's declaration finds its row by the configuration watcher's
  fallback name too, so both bind the same row.
- A proxy's background retry keeps going through a database failure and
  stops only on an answer another attempt cannot change.
- A transcode node that declares nothing sends its empty declaration
  once and never waits on it, and a 403 from a gateway in front of the
  main server is treated like a missing route.
- The registration route refuses a body with a field it does not know,
  so a misspelled field cannot read as an empty declaration.
- The node editor keeps a declared device on screen when the
  acceleration backend changes.
- The docs warn against copying SILO_NODE_URL or SILO_NODE_NAME from a
  proxy's .env to a transcode node.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@silo-kody

silo-kody Bot commented Nov 18, 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 ❌

Comment thread cmd/silo/main.go Resolved
Comment thread internal/nodeconfig/declare.go Resolved
…s row

A proxy with no name variable is found by the watcher's fallback name so
its declaration lands on the row the watcher binds it to. With
SILO_NODE_REGISTER it is found by URL only, so several unnamed proxies
each create their own row instead of sharing the one named "proxy".

A node that declares nothing now offers its empty declaration again in
the background after any failure, a missing route included: a gateway
that briefly refused the route looks the same, and giving up there left
earlier fields locked.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@silo-kody

silo-kody Bot commented Nov 18, 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 ❌

@silo-triage silo-triage Bot added size/XXXL 3000+ added + deleted lines (all files); change volume, not priority. and removed size/XXL 1000–2999 added + deleted lines (all files); change volume, not priority. labels Nov 18, 2026
@silo-kody

silo-kody Bot commented Nov 18, 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 ❌

Comment thread internal/transcodenode/jobcap.go Resolved
Comment thread internal/transcodenode/jobcap.go Resolved
Comment thread internal/transcodenode/server.go Resolved
- A preparation that skipped admission because its artifact looked
  prepared, and then has to encode after all, takes a job slot.
- A playback session that already runs two transports here is not
  continuing anything, so a third takes a slot. One replacement may
  still overlap the transport it replaces.
- A hardware tone map names its backend only on a node that declares
  auto; a node that declares a backend runs that one.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@silo-kody

silo-kody Bot commented Nov 18, 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 ❌

Comment thread internal/transcodenode/server.go Resolved
Comment thread internal/transcodenode/server.go Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 866c55d550

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/transcodenode/server.go Resolved
Comment thread internal/downloadprepare/transport.go Resolved
…t goes

The late admission ran after the existing artifact's receipt was
invalidated and checked only the job cap. A refusal then left a valid
artifact unusable for the recipe it answers, and the declared storage
budget was skipped. It now runs first and checks the budget as well.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@silo-kody

silo-kody Bot commented Nov 18, 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 ❌
⚠️ 5 Kody Rule(s) were not evaluated

These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:

  • Preserve optional store capabilities through production wrappers
  • Detach mandatory cleanup from request cancellation and bound its lifetime
  • Preserve durable media identity and share identity-evidence precedence
  • Bound decoder throughput trades and share direct-play eligibility
  • Retain distributed firing claims through their own validity windows

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Minor · Describe registration's separate request budget. · worker-http-protocol.md:507

docs/architecture/worker-http-protocol.md:507
Minor · Functional Correctness · Quick win

Describe registration's separate request budget.

Registration uses LimitNodeRegistration, not the shared LimitNode budget used by configuration, reports and logs. The server now has three per-node request budgets. List registration separately and keep the background and playback groups unchanged.

Nitpick comments: 1

internal/nodepool/planner_test.go: 1

519-519: Trivial · Maintainability & Code Quality · Quick win

Advance the clock past the health check before the second refusal.

The second refusal uses the same now as the first, so it is older than the health check at now+1s. The health check releases the hold before the final assertion runs. That assertion then passes even if the time-based expiry in heldAtCapacity is removed, so the test does not verify the expiry behavior its name describes.

Advance now beyond the health timestamp before the second report. Assert that work is unavailable, then advance by atCapacityHold and assert that work is available.

Suggested fix

 	transcodes.ApplyHealth(1, "http://transcode-a", true, 1, 0, "", nil, nil, now.Add(time.Second))
 	if !planner.TranscodeWorkAvailableWith(nil) {
 		t.Fatal("a health check after the refusal did not lift the hold")
 	}
-	ReportAtCapacity(planner, "http://transcode-a")
+	now = now.Add(2 * time.Second)
+	ReportAtCapacity(planner, "http://transcode-a")
+	if planner.TranscodeWorkAvailableWith(nil) {
+		t.Fatal("a node that refused again at its cap still takes work")
+	}
 	now = now.Add(atCapacityHold)
Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cf78b3e1-bdf4-4aa1-9be5-ced089e9ab85
Commits

Reviewing files that changed from the base of the PR and between 0b478ce and 691b2d0.

Files selected for processing: 40

  • .env.example
  • cmd/silo/main.go
  • cmd/silo/transcode_node.go
  • contracts/api/v2/openapi.json
  • contracts/api/v2/route-inventory.json
  • docs/admin-api.md
  • docs/architecture/transcode-nodes.md
  • docs/architecture/worker-http-protocol.md
  • internal/api/handlers/admin_node_configuration.go
  • internal/api/handlers/playback_transport.go
  • internal/api/handlers/playback_transport_security_test.go
  • internal/api/router.go
  • internal/downloadprepare/transport.go
  • internal/downloads/remote_preparer.go
  • internal/jellycompat/handlers_playback.go
  • internal/nodeconfig/declare.go
  • internal/nodeconfig/declare_test.go
  • internal/nodeconfig/remote.go
  • internal/nodeconfig/watcher.go
  • internal/nodecontrol/fixture_test.go
  • internal/nodecontrol/limit.go
  • internal/nodecontrol/protocol.go
  • internal/nodecontrol/protocol_registry.go
  • internal/nodecontrol/registration.go
  • internal/nodecontrol/registration_test.go
  • internal/nodecontrol/server.go
  • internal/nodepool/at_capacity.go
  • internal/nodepool/declaration.go
  • internal/nodepool/declaration_db_test.go
  • internal/nodepool/planner.go
  • internal/nodepool/planner_test.go
  • internal/transcodenode/download_prepare_protocol.go
  • internal/transcodenode/jobcap.go
  • internal/transcodenode/jobcap_test.go
  • internal/transcodenode/server.go
  • internal/transcodenode/start_protocol.go
  • internal/transcodenode/streaming_protocol.go
  • internal/transcodenode/trickplay.go
  • internal/trickplay/remote.go
  • scripts/ci/db-contracts.txt
Files skipped from review as they are similar to previous changes: 1

  • .env.example

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

Comment thread internal/transcodenode/jobcap.go Resolved
Comment thread internal/transcodenode/server.go Resolved
…rage refusal

Starts arriving together for one playback session could all see one
running transport and each skip admission. The allowance is now claimed
under the admission lock, counting allowances granted and not yet
registered, so only one transport overlaps the one it replaces.

A node that refuses a preparation at its declared budget was read as a
plain failure, which spent the job's retry budget. The main server now
tries another node, leaving that one out, and keeps the waiting-for-space
outcome when none can take it.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@silo-kody

silo-kody Bot commented Nov 18, 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 ❌

Comment thread internal/transcodenode/server.go Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b5ea625c-ba7b-42fc-8946-b8ebab81426b
Commits

Reviewing files that changed from the base of the PR and between 691b2d0 and 3f3bc42.

Files selected for processing: 5

  • docs/architecture/transcode-nodes.md
  • docs/architecture/worker-http-protocol.md
  • internal/transcodenode/jobcap.go
  • internal/transcodenode/jobcap_test.go
  • internal/transcodenode/server.go

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

A new remux registered itself before it claimed a slot, so a request the
cap then turned away could briefly be what another request for the same
playback session continued. The slot is now taken first.

The worker protocol doc lists registration's own request budget, and the
planner test now checks that only time lifts a hold newer than the last
health check.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@silo-kody

silo-kody Bot commented Nov 18, 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 ❌

A remux HEAD starts and registers nothing, but it claimed the one
allowance a GET for the same playback session may need at the cap.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@silo-kody

silo-kody Bot commented Nov 18, 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 ❌
⚠️ 5 Kody Rule(s) were not evaluated

These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:

  • Preserve optional store capabilities through production wrappers
  • Detach mandatory cleanup from request cancellation and bound its lifetime
  • Preserve durable media identity and share identity-evidence precedence
  • Bound decoder throughput trades and share direct-play eligibility
  • Retain distributed firing claims through their own validity windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request go Pull requests that update go code javascript Pull requests that update javascript code priority: P2 Limited scope, workaround exists, or polish size/XXXL 3000+ added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant