Pin srt to a tested version; support only Pop!_OS 26.04 and later

srt is pinned to 0.0.83, the version the smoketest passed with. A computer
with another version sees the agents item as to do in configure, which
installs the pinned one. Move the pin only after smoketest/run 50 80 passes.

The installer and configure stop on Pop!_OS (or Ubuntu) older than 26.04.
The smoketest builds on Ubuntu 26.04, with checks that 24.04 is refused.
26.04's own AppArmor profile lets bubblewrap make user namespaces, so the
connector's profile for it, and the code that offered to add it, are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-28 20:49:54 -07:00
co-authored by Claude Opus 5.5
parent c84e6d3aa0
commit b609252e1c
17 changed files with 95 additions and 75 deletions
+32 -7
View File
@@ -4,11 +4,18 @@
# sandbox. Source this file after lib/agents.sh; it uses
# confirm_yes from configure.
#
# srt needs Node.js 22.12 or later, and Pop!_OS 24.04's is 18. So unless a
# new enough one is installed already, the current long-term support release
# is downloaded from nodejs.org into FC_TOOLS/node, checked against the
# SHA-256 sums it publishes, and used only for srt: nothing in /usr or your
# shell changes.
# srt needs Node.js 22.12 or later, which Pop!_OS doesn't install. So unless
# one is installed already (Pop!_OS 26.04's nodejs package is new enough), the
# current long-term support release is downloaded from nodejs.org into
# FC_TOOLS/node, checked against the SHA-256 sums it publishes, and used only
# for srt: nothing in /usr or your shell changes.
#
# srt is pinned to a version the smoketest passed with: a new release once
# broke opencode's sandbox on Pop!_OS. To move the pin, change SRT_VERSION,
# run smoketest/run 50 80, and commit only if it passes. Computers that have
# the old version see the agents item as to do in configure, which installs
# the new one.
SRT_VERSION=0.0.83
# srt needs Node.js 22.12 or later
node_ok() {
@@ -61,12 +68,30 @@ install_srt() {
node_dir="$(dirname "$(PATH="$FC_TOOLS/node/bin:$PATH" command -v node)")"
echo "Installing the sandbox runtime (srt) from npm..."
PATH="$node_dir:$PATH" "$node_dir/npm" install --global --prefix "$FC_TOOLS/srt" \
--no-fund --no-audit --ignore-scripts @anthropic-ai/sandbox-runtime > /dev/null
--no-fund --no-audit --ignore-scripts "@anthropic-ai/sandbox-runtime@$SRT_VERSION" > /dev/null
}
# The version of Federated Connector's own srt, or nothing
srt_version() {
jq -r '.version // empty' \
"$FC_TOOLS/srt/lib/node_modules/@anthropic-ai/sandbox-runtime/package.json" 2> /dev/null
}
# Federated Connector's own srt is installed, at the version it's pinned to
srt_current() {
[ "$(srt_version)" = "$SRT_VERSION" ] && srt_path > /dev/null
}
# Updating srt is installing it again
srt_ensure() {
srt_path > /dev/null && return 0
srt_current && return 0
if [ -n "$(srt_version)" ]; then
echo "The sandbox runtime (srt) is at $(srt_version); this version of Federated Connector"
echo "was tested with $SRT_VERSION."
confirm_yes "Install $SRT_VERSION?" || return 1
install_srt
return
fi
echo "The sandbox is Anthropic's sandbox runtime (srt), which runs on Node.js."
node_ok || echo "This computer's Node.js is older than srt needs, so it gets its own, from nodejs.org."
confirm_yes "Install it (into $FC_TOOLS)?" || return 1