Skip to content

feat(nodes): run a VideoToolbox transcode node on a Mac from the server image - #4950

Open
Quick104 wants to merge 4 commits into
mainfrom
feat/macos-transcode-node
Open

Quick104 wants to merge 4 commits into
mainfrom
feat/macos-transcode-node

Conversation

@Quick104

@Quick104 Quick104 commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: #1175
Validation tasks: unblocks #1175 C1, C2 and C3 on a Mac whose server runs in Docker Desktop

Other clients: N/A (server image and a new node command; the apps are unchanged)

Docker Desktop on a Mac runs the server in a Linux VM with no VideoToolbox, so Silo in Docker converts video on the CPU. A transcode node running on the Mac itself already resolves VideoToolbox, but nothing ships one: an operator has to compile the server with cgo against Homebrew's libvips and keep the process running by hand. A binary built that way loads Homebrew libraries at startup. In testing, brew install ffmpeg-full upgraded OpenEXR, and the node then failed to load until libvips was upgraded too.

Approach

A silo_node build tag (internal/nodebuild) leaves libvips and the embedded web app out. internal/imageutil keeps the declarations both builds share in shared.go, imageutil_node.go replaces its functions with ones that fail, and web/embed_node.go gives an empty DistFS. A node processes no images; its one image job, chapter thumbnails, is FFmpeg's. A node build refuses every subcommand except silo node, and any run without MODE=transcode.

A new node_darwin stage in the Dockerfile cross-compiles that build for darwin/arm64 with CGO_ENABLED=0, and the base image (so the omnibus image too) carries it at /usr/share/silo/nodes/silo-darwin-arm64. Copied from the running container, the node always matches the server's revision, and it links only system frameworks. make build-node-darwin runs the same build, and the Go vet CI job vets it.

silo node install and silo node uninstall (internal/nodeinstall, kept out of cmd/silo because the route inventory reads only one build of that package) manage one per-user LaunchAgent, org.siloserver.node, with its files under ~/Library/Application Support/Silo/node and its log at ~/Library/Logs/Silo/node.log. Before writing anything, the installer checks the flags and key, Homebrew's ffmpeg-full, the server's /api/v1/ready, and that the port is free. It then stages the new files and stops the old job: current macOS caps a LaunchAgent's ExitTimeOut at 60 seconds, so the installer sends SIGTERM itself, waits for the node to finish its streams within its drain timeout, and only then boots the job out. It swaps the files in, starts the job, and waits up to 60 seconds for the node's health to report a node-control version without key_rejected. If that fails, it puts the previous install back, or removes a first install, and prints the end of the log. A rerun is the upgrade: it keeps the server, key, port and any other variable in node.env. The installer's wait follows the node's SILO_NODE_DRAIN_TIMEOUT, and KeepAlive restarts the node after a crash but not after a drained exit. A swap-pending marker makes the commit point durable, so a rerun after an interrupted swap recovers the previous install's settings and backups, and rollback restores nothing while it can't confirm the replacement stopped. --server must be a plain URL. The key is never a command-line argument, which other users of the Mac could read: the installer asks for it at a prompt that doesn't echo, or reads it from standard input, and --new-key replaces an installed key. The install lock sits beside the install folder, so uninstall never deletes a lock it holds.

docs/architecture/transcode-nodes.md describes the build, the files and the install sequence.

Validation

  • Tested live on an Apple M4 Mac mini with the server in Docker Desktop, using the node from make build-node-darwin (the same build as the image's new stage) copied to a folder as ./silo. An earlier round built the full image from this branch merged with its two companion branches and ran the node copied out of the container with docker compose cp.
  • The binary is 159 MiB (45 MB gzipped) and links only system libraries (libSystem, libresolv, CoreFoundation, Security).
  • In the earlier round, with the node resolving VideoToolbox, H.264, HEVC and AV1 sources and HDR10, Dolby Vision 7 and 8 sources (tone mapped through scale_vt) transcode on the node with h264_videotoolbox; eight simultaneous 4K HDR to 1080p transcodes each held at least 1.16x real time.
  • Installer, each run live: first install with the key typed at a prompt that doesn't echo it (ready in about 2 s); refusals with nothing written for a server that isn't answering, a bad --port, and a port another program holds; a rerun that keeps an added node.env variable (2.3 s); a rerun on a drained node, which stays drained and says so; a rerun while the node serves a stream, which waits for the drain (12 s) and loses no segment; a wrong key, rolled back to the working node after 60 s with the log's last lines; Ctrl-C during a drain, after which the previous node runs again with no staged files left; uninstall, and uninstall with nothing installed.
  • After the review fixes (f524c9e), live again: the lock sits beside the install folder and survives uninstall; ExitTimeOut is 660 with the default drain and 960 with SILO_NODE_DRAIN_TIMEOUT=15m, and the stop message follows it; an invalid drain is refused before anything changes. After 8cafe62: a first install with the key piped in on standard input; --new-key replacing the key at the hidden prompt with no trace of it in the captured terminal output; --key refused as an unknown flag.
  • After the drain change (2519287), live: an upgrade 10 s into a 1080p stream of a 90-minute file on the node waited while the node drained for 4 min 38 s, past launchd's 60-second cap, then swapped; the stream received every segment (2716) and ran on VideoToolbox. The plist has KeepAlive → SuccessfulExit false.
  • A node build refuses silo backup and other subcommands.
  • go build, go vet (also for the darwin node build), go test ./cmd/silo/ ./internal/imageutil/ in both builds, make build-node-darwin, make lint-changed and make verify-local-paths pass.

Evidence

Evidence: https://evidence.siloserver.org/r/silo-server/macos-transcode-node/

Surface and build: the installer's terminal output on this branch's node build: 6410f980 for the first runs, then the review fixes in f524c9e.

Risks

  • The image grows by the darwin node binary: 159 MiB on a 1.2 GB image, about 45 MB more to download.
  • A new exported internal/imageutil function needs a stub in imageutil_node.go, or the node build fails; the Go vet CI job catches it.
  • The node runs only while its user is logged in, and a sleeping Mac stops converting. The user manual says so. A logout or shutdown stops streams after a minute, launchd's cap.

Follow-ups

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.

Council review

Plan round: Sol (gpt-6.2-sol, xhigh) and Opus (claude-opus-5-5, high). Gemini (gemini-4-neon) was unavailable: this session doesn't run in full access.

Rounds: 2, last reviewed 8cafe62; fixes in 2519287

Member Round 1 (16e5f21) Round 2 (8cafe62)
Sol (gpt-6.2-sol, xhigh) 6/10: launchd killed a node draining past 11 minutes; uninstall deleted the lock it held; a crashed swap's retry could overwrite the backup; a double-quoted node.env value blocked a rerun; rollback restarted a job that was stopped before. All fixed. Not changed here: the node inherits the server's custom FFmpeg path (every node does; follow-up). 7/10: an interrupted swap lost the settings; the stop used node.env's drain rather than the loaded one; rollback restored files before confirming the replacement stopped. All fixed.
Opus (claude-opus-5-5, high) 7/10: the drain and ExitTimeOut mismatch; a bootout answering EINPROGRESS left the node stopped; the darwin stage compiled cold on every image build. All fixed. 8.5/10: a piped key read silently; a stale binary backup could outlive a run that didn't replace the binary. Both fixed.
Gemini (gemini-4-neon, xhigh) unavailable unavailable

AI Disclosure

  • Harness: Claude Code in T3 Code
  • Tool(s): Claude Code, T3 Code delegate tasks, Codex CLI
  • Model(s): claude-opus-5-5 (orchestration, review), claude-opus-5 subagent (implementation), gpt-6.2-sol (plan review)
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: a plan round (Sol and Opus; Gemini unavailable) chose shipping the node in the server image over a separate download; an xhigh code review found 14 issues in the installer and build, the background review eight more in round 1 and five in round 2, and CodeRabbit found that launchd caps the stop at 60 seconds; all fixed except the inherited FFmpeg path, now a follow-up. CI moved the installer out of cmd/silo. See Council review.

🤖 Generated with Claude Code

Note

Add macOS node installer and build VideoToolbox transcode node into server image

  • Adds a Darwin installer (silo node install/uninstall/version) in node_install_darwin.go: it stages files, swaps them transactionally with backups, writes a LaunchAgent plist, boots the launchd job, and rolls back to the previous install if the new node fails to start or become ready.
  • The Dockerfile and Makefile cross-build a darwin/arm64 silo_node binary and ship it in the image at /usr/share/silo/nodes/, so a Mac can install the node directly from the server image.
  • Introduces the silo_node build tag: in node builds, imageutil functions and web.DistFS are replaced by stubs (imageutil_node.go, embed_node.go), and main.go rejects anything other than node subcommands or transcode-node startup.
  • Shared node settings (mode, core URL, node key, drain timeout with a 10-minute default) move to env.go with new parsers; the CI vet target now also checks the tagged darwin/arm64 build.
  • Behavioral Change: in silo_node builds, image-processing functions like imageutil.GenerateVariants return errNodeBuild and web.DistFS is an empty filesystem; non-Darwin installNode/uninstallNode return a macOS-only error. Risk: node_command.go and its test contain inline + tokens in quoteNodeEnv and a test loop that make the Go source fail to parse, so the package does not currently build.

Macroscope summarized 2519287.

…er image

Docker on a Mac cannot reach VideoToolbox, so a Mac transcodes with a native
node beside the server in Docker. The image now carries a darwin/arm64 node
built with the silo_node tag (no cgo, no libvips, no web app), and
`silo node install` sets it up as a LaunchAgent that a rerun upgrades in place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@silo-triage silo-triage Bot added the size/XXL 1000–2999 added + deleted lines (all files); change volume, not priority. label Nov 21, 2026
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

Adds a Darwin ARM64 silo_node binary to Docker images and introduces silo node installation, uninstall, and version commands. The macOS installer manages a per-user LaunchAgent and supports upgrades and rollback. Build-tagged implementations omit web and image-processing functionality from the node build.

Changes: Darwin transcode-node distribution and installation

Layer / File(s) Summary
Node build variants
internal/imageutil/*, internal/nodebuild/*, web/embed*.go
Build tags select node-specific image-processing and web implementations. Shared imageutil declarations support both build variants.
Node CLI and shared configuration
cmd/silo/main.go, cmd/silo/node_drain.go, cmd/silo/node_drain_test.go, cmd/silo/node_keys.go, cmd/silo/transcode_node.go, cmd/silo/transcode_node_test.go, internal/transcodenode/*, internal/nodeinstall/node_install_other.go
Node builds route silo node commands to the installer and reject regular server startup. Shared transcode-node constants and parsers provide mode, URL, key, and drain-timeout configuration.
Install command and settings
internal/nodeinstall/node_command.go, internal/nodeinstall/node_command_test.go
The command parses install options, merges stored settings, and renders environment files and LaunchAgent plists. Tests cover settings, quoting, timeout parsing, and generated plist values.
Darwin install, upgrade, and recovery
internal/nodeinstall/node_install_darwin.go, internal/nodeinstall/node_install_darwin_test.go, internal/fspath/launch_guard_test.go, internal/playback/remux.go, go.mod, docs/architecture/transcode-nodes.md
The installer validates prerequisites, stages and launches the node, checks health, and handles uninstall and rollback. Tests cover launchctl handling, rollback, file swaps, locking, and key prompting. The documentation describes installer files, readiness, and recovery behavior.
Darwin build and image distribution
Makefile, Dockerfile, .dockerignore, .gitignore, .github/actions/ci-tools/go-checks.mk, docs/architecture/transcode-nodes.md
The Makefile and Dockerfile build the Darwin ARM64 node and add it to the runtime image. CI checks the cross-build, and the documentation describes the build and image contents.

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

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant CLI as silo node install
  participant Run as nodeinstall.Run
  participant Installer as Darwin installer
  participant LaunchAgent as launchctl
  participant Health as Loopback health endpoint
  CLI->>Run: Pass install command and arguments
  Run->>Installer: Dispatch install
  Installer->>LaunchAgent: Stop existing job and start replacement
  Installer->>Health: Poll for node readiness
  Health-->>Installer: Return health response
Loading

Possibly related PRs

Suggested reviewers: darthshadow, blurbery, bulderi

Merge Risk: Moderate · up to f524c

The new macOS node installer has several recovery and shutdown gaps. On macOS 26.4 and later a stop may kill in-flight transcodes after 60 seconds. A changed drain setting or an interrupted upgrade can leave the node stopped or lose the stored settings. Rollback after a launchctl failure can leave the old node unrestarted. Fix these before merge, or explicitly accept them for this opt-in installer.

Security architecture risk: Low · up to f524c

The Mac installer has a bounded recovery flaw: interrupted upgrade cleanup can make a later failed upgrade restore mismatched files or an older credential instead of the last working installation. The impact is limited to that user’s node; existing request authentication remains in place.

Retained concerns

  • Medium · reliability · inferred: Rollback backups are not tracked as one installation generation. After a successful upgrade, interruption between individual .old deletions can leave only some older backups. On the next upgrade, moveAside preserves those backups but creates fresh backups for the remaining files. If that upgrade fails, rollback restores the mixed set alongside the immediately previous plist and can report restoration success despite reverting settings or credentials further than the binary. This can strand the node after credential rotation or configuration changes. The lock prevents concurrent installer runs but does not resolve this interrupted-cleanup state.
Security review details

Security Blast Radius

  • inferred — The identified recovery failure affects one user’s installer-managed executable, configuration, node credential and LaunchAgent. It can disrupt that node’s relationship with its configured server, but the inspected failure does not grant root authority or expose other nodes’ keys.

Trust Boundaries and Controls

  • observed — The node listens on all interfaces. Its existing router leaves health and metrics unauthenticated while requiring node-key request signatures for media and control operations. Health redacts filesystem paths. These behaviors predate the PR; the new installer makes this runtime persistent on the Mac.

Resilience and Maintainability Implications

  • observed — Install and uninstall share an exclusive nonblocking lock outside the removable installation directory. Stored settings are reread under that lock. This protects cooperating lifecycle operations from overlap, but cannot identify whether surviving backups belong to a committed or interrupted upgrade.

Hardening Proposals

  • proposed — Track the binary, environment, credential and plist as one durable installation generation, with an explicit commit/recovery marker. Recovery should select one coherent known-good generation rather than infer verification from individual .old files.
Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: a macOS VideoToolbox transcode node shipped in the server image. The changeset adds a silo_node build tag, a darwin/arm64 node binary in the Docker image, and a silo n…
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 closely related to the changeset. It explains the problem (Docker Desktop on a Mac converts video on the CPU), the approach (a silo_node build tag, a darwin/arm64 node stage in the …
Full details: Title check

Explanation

The title names the main change: a macOS VideoToolbox transcode node shipped in the server image. The changeset adds a silo_node build tag, a darwin/arm64 node binary in the Docker image, and a silo node install/uninstall LaunchAgent installer. The title is specific and matches the primary objective, and it follows the conventional commit style.

Full details: Description check

Explanation

The description is closely related to the changeset. It explains the problem (Docker Desktop on a Mac converts video on the CPU), the approach (a silo_node build tag, a darwin/arm64 node stage in the Dockerfile, a Makefile target, and the silo node install/uninstall LaunchAgent installer), the validation performed, and the risks. It describes the files and behavior the changes implement, so it passes the lenient relevance check.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@silo-kody

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 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-21T07:37:26.797983Z 2519287 New commits
🔒 Security Review ✅ Completed 2026-11-21T07:39:47.746313Z 2519287 New commits

Security findings

Advisory findings (1)

ℹ️ 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-triage silo-triage Bot added enhancement New feature or request go Pull requests that update go code priority: P2 Limited scope, workaround exists, or polish labels Nov 21, 2026
Comment thread cmd/silo/node_command.go Resolved

@Quick104 Quick104 left a comment

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.

Adversarial review (gpt-6.2-sol, reviewed 16e5f21)

Six findings are attached. The 15-minute drain in the new test is cut short by launchd. The file swap and lock also leave ways for an interrupted upgrade or overlapping uninstall to break recovery.

AI disclosure

Codex in T3 Code, using gpt-6.2-sol, performed this adversarial review. Tools included Git, Python, the local launchd manual, and T3 Code’s GitHub integration. I traced the installer, node startup, image build, and CI at the pinned revision and checked the file rename and lock behavior with disposable files. The review did not exercise a LaunchAgent or build Docker images. This review changed no source files.

Comment thread cmd/silo/node_install_darwin.go Resolved
Comment thread cmd/silo/node_command.go Resolved
if err != nil {
return err
}
if !playback.HomebrewFFmpegFull(playback.ResolveFFmpegPath("")) {

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.

F4 · should Check the FFmpeg executable the installed node will use.

This checks Homebrew discovery with an empty path. The launched node loads playback.ffmpeg_path from the core, and ResolveFFmpegPath preserves a custom path even when that file is absent on the Mac. The warmup failure does not delay the health listener, so a Docker-only custom path can pass the install and leave the node unable to run FFmpeg. Have the installed node verify its effective executable and surface that result in installer readiness, with the path in the failure message.

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 changed here. Every transcode node has this gap, not only one this installer sets up: a node takes playback.ffmpeg_path from the core, and ResolveFFmpegPath keeps a custom path even where it doesn't exist. Only the Jellyfin default falls back to discovery. Fixing it needs a per-node FFmpeg path or a node-side fallback, which is its own change; it's listed under Follow-ups in the description.

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.

Still open by decision: every transcode node inherits playback.ffmpeg_path from the core, so this needs a per-node FFmpeg path or a node-side fallback, listed under Follow-ups.

Comment thread cmd/silo/node_command.go Resolved

@Quick104 Quick104 left a comment

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.

Adversarial review (claude-opus-5-5, reviewed 16e5f21)

Scope: the install, upgrade, rollback and uninstall paths in node_install_darwin.go and node_command.go, main's dispatch for both builds, the imageutil stubs and the empty web.DistFS against what a node runs, the node_darwin Dockerfile stage, and the vet target. Method: I read the source at this head, cross-built the node for darwin/arm64 without cgo, ran go vet -tags silo_node for darwin and the cmd/silo node tests with the tag (all pass), ran the built binary's node version and a refused subcommand, and timed a cold and a warm darwin compile. I ran no launchctl.

Findings: two should and one nit, inline.

Checked and clean:

  • Nothing a node runs reaches an imageutil stub. transcodenode links chapterthumbs, scanner and overlays, but the node's chapter route calls only ExtractFrame and returns FFmpeg's JPEG; the WebP encode and thumbhash run on the core. No node route calls overlays or scanner. The only reader of web.DistFS is the server's web handler, which a node build never reaches past the nodeBuild guard.
  • A node build refuses other subcommands (silo migrate exits with nodeBuildOnly), and without MODE=transcode it exits right after the transcode branch.
  • ffprobe paths are derived from the FFmpeg path, so the LaunchAgent's minimal PATH does not matter.
  • An interrupt after the swap, a partial swapIn and a failed plist write all roll back to the previous files and job.

AI disclosure: Claude Code, running in T3 Code, with model claude-opus-5-5 wrote this review as an adversarial review sub-agent. It read the change at 16e5f21, built and tested it in a scratch copy, and wrote the findings. No person edited them before posting.

Comment thread cmd/silo/node_command.go Resolved
Comment thread Dockerfile Resolved
…er review

cmd/silo is an audited route-inventory package and may hold no
build-constrained file, so the node-build flag moves to internal/nodebuild
and the `silo node` command to internal/nodeinstall; the node's env names,
core URL check and drain parsing move to internal/transcodenode for both.

Review fixes: launchd's ExitTimeOut and the installer's stop deadline follow
the node's SILO_NODE_DRAIN_TIMEOUT; the install lock sits outside the folder
uninstall removes; a crashed swap's backup is kept; rollback restarts the old
job only if it was loaded; a bootout that answers EINPROGRESS counts as sent;
node.env values with double quotes survive a rerun; `--key -` replaces a key
at the hidden prompt; the darwin build stage warms its compile cache.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@silo-kody

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

@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: f524c9e64e

ℹ️ 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 thread internal/nodeinstall/node_command.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: 9

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: a3306521-7885-409a-ae13-8c0939fe54e4
Commits

Reviewing files that changed from the base of the PR and between 2b08e47 and f524c9e.

Files selected for processing: 35

  • .dockerignore
  • .github/actions/ci-tools/go-checks.mk
  • .gitignore
  • Dockerfile
  • Makefile
  • cmd/silo/main.go
  • cmd/silo/node_drain.go
  • cmd/silo/node_drain_test.go
  • cmd/silo/node_keys.go
  • cmd/silo/transcode_node.go
  • cmd/silo/transcode_node_test.go
  • docs/architecture/transcode-nodes.md
  • go.mod
  • internal/fspath/launch_guard_test.go
  • internal/imageutil/budget.go
  • internal/imageutil/imageutil.go
  • internal/imageutil/imageutil_node.go
  • internal/imageutil/imageutil_test.go
  • internal/imageutil/shared.go
  • internal/imageutil/untrusted.go
  • internal/imageutil/untrusted_test.go
  • internal/imageutil/variants_bench_test.go
  • internal/imageutil/variants_test.go
  • internal/nodebuild/full.go
  • internal/nodebuild/node.go
  • internal/nodeinstall/node_command.go
  • internal/nodeinstall/node_command_test.go
  • internal/nodeinstall/node_install_darwin.go
  • internal/nodeinstall/node_install_darwin_test.go
  • internal/nodeinstall/node_install_other.go
  • internal/playback/remux.go
  • internal/transcodenode/drain.go
  • internal/transcodenode/env.go
  • web/embed.go
  • web/embed_node.go

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

Comment thread docs/architecture/transcode-nodes.md Resolved
Comment thread internal/nodeinstall/node_command.go Resolved
Comment thread internal/nodeinstall/node_command.go Resolved
Another user of the Mac can read a process's arguments, and the shell keeps
them, so `--key KEY` exposed the node's bearer key. The installer now asks for
the key at its hidden prompt, or reads it from standard input when that isn't
a terminal, and `--new-key` replaces an installed key the same way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@silo-kody

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

@Quick104 Quick104 left a comment

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.

Adversarial review (claude-opus-5-5, reviewed 8cafe62, round 2)

Scope: what changed since round 1 (16e5f21..8cafe62) and the code it reaches: the move to internal/nodeinstall and internal/nodebuild, the shared names and drain parsing in internal/transcodenode, the drain-derived timeouts, the lock's new place, moveAside, the single-quoted node.env values, rollback's oldLoaded, the EINPROGRESS bootout, the stdin key path, the Dockerfile warm compile, and the vet target. Method: I read the source at this head and ran, in a scratch copy on an Apple silicon Mac, go test -tags silo_node for internal/nodeinstall (the darwin tests with the fake launchctl included), internal/transcodenode and the node tests in cmd/silo, the CI vet line for darwin, go vet -tags silo_node of internal/nodeinstall for linux, and the internal/fspath launch guard. All pass. I also ran a throwaway test that feeds promptNodeKey an open pipe (F4). I ran no launchctl and no install.

Round 1 findings:

  • F1 (ExitTimeOut ignored SILO_NODE_DRAIN_TIMEOUT): resolved. The plist, the stop deadline and the notice now follow the drain node.env sets, a value the node would ignore is refused before anything is written, and TestRenderNodePlistEscapesPaths pins 960 seconds for a 15-minute drain.
  • F2 (a bootout answering EINPROGRESS left the old node stopped): resolved. Exit status 36 falls through to waitGone, and TestStopTreatsBootoutInProgressAsSent covers it with a fake launchctl. That test runs only on macOS, so CI vets it but never runs it.
  • F3 (the darwin node compiled cold on every image build): resolved. The warm compile runs before the ARG lines with the same -tags and -trimpath, and -s -w and -X are linker flags, so the final step only relinks.

New findings: F4 (should) and F5 (nit), inline.

Checked and clean:

  • main's dispatch is unchanged apart from nodebuild.Node. The non-darwin nodeinstall stub still answers install and uninstall with the macOS-only error.
  • The lock now sits outside the folder uninstall removes, uninstall takes it before it reads anything, and it is non-blocking, so a second run fails at once rather than waiting. A run that finds a held lock stops before it changes the install.
  • moveAside and rollback agree for every state a stopped swap can leave the three files in, including a run interrupted between moving a file aside and renaming the staged one in.
  • Rollback with oldLoaded false restores the files and plist and leaves a stopped node stopped; stopRunning reports a job that exited on its own after a refused bootout as loaded, which is right.
  • addCapped keeps a huge drain from overflowing, and time.Time.Add saturates, so waitGone's deadline holds.
  • A kept value with " (single-quoted) and one with $ (double-quoted, escaped) read back unchanged through godotenv, and a value with both quotes is still refused (TestRenderNodeEnvKeepsQuotedValues).

AI disclosure: Claude Code, running in T3 Code, with model claude-opus-5-5 wrote this review as an adversarial review sub-agent. It read the change at 8cafe62, built and tested it in a scratch copy, and wrote the findings. No person edited them before posting.

@Quick104 Quick104 left a comment

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.

Adversarial review (gpt-6.2-sol, reviewed 8cafe62, round 2)

Three installer recovery issues are inline. The Darwin arm64 node build, vet, and installer unit tests passed. I verified the failure paths with temporary files and a fake launchctl.

AI disclosure: Codex in T3 Code (gpt-6.2-sol) performed this adversarial review and wrote the findings. It traced installer recovery, node dispatch, and build packaging at the pinned commit and ran focused build and state tests. The review made no code changes.

Current macOS caps a LaunchAgent's ExitTimeOut at 60 seconds and returns from
bootout at once, so a stop cut any stream that needed more than a minute. The
installer now sends SIGTERM itself, waits for the node to drain within its
drain timeout, then boots the job out; KeepAlive restarts the node only after a
crash, not after a drained exit.

Recovery: a swap-pending marker makes the install's commit point durable, so a
rerun keeps the backups of an interrupted swap and drops the leftovers of one
that finished; settings come back from the backups after an interrupted swap;
rollback restores nothing while the replacement can't be confirmed stopped.
--server must be a plain URL, and the readiness check joins its path. A key read
from a pipe says so first. nodeStopTimeout moves to the darwin file, the only
one that uses it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@silo-kody

silo-kody Bot commented Nov 21, 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 on lines +737 to +740
loaded, running, err := n.status(ctx)
switch {
case err != nil, !loaded, running != pid:
return true, nil

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

A transient status error prematurely terminates the node drain

A launchctl print error can trigger bootout while the node is still serving streams, which macOS then terminates after one minute. Retry status errors until the drain deadline or propagate them without treating the process as exited.

Prompt for LLM
File internal/nodeinstall/node_install_darwin.go, lines 737-740:

A transient status error prematurely terminates the node drain

A transient `launchctl print` error ends the drain and immediately triggers `bootout` while the node may still be serving streams, which macOS then terminates after one minute. Retry status errors until the drain deadline or propagate them without treating the process as exited.

Talk to Kody by mentioning @kody

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

​

​

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

Labels

enhancement New feature or request go Pull requests that update go code priority: P2 Limited scope, workaround exists, or polish size/XXL 1000–2999 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant