From 0e4704f3924b1ba3c4c3dd3efeebe46dee8c25b8 Mon Sep 17 00:00:00 2001 From: Igor Zalutski Date: Tue, 30 Jun 2026 15:23:31 +0100 Subject: [PATCH] fix(sandbox): install gh (GitHub CLI) in the default rootfs Agents 'cannot connect to github' because gh isn't in the sandbox. It's not in Ubuntu's default repos, so add GitHub's apt source (signed-by keyring via curl, which the main apt block installs) and install gh. The 'default' template is the image all agent sandboxes run on. arch-agnostic (dpkg --print-architecture) for amd64/arm64 VMs. Built/validated by scripts/build-rootfs.sh in CI (rootfs build isn't runnable locally). Other templates (node/python/ubuntu) can get the same block if agents ever use them. Co-Authored-By: Claude Opus 4.8 (1M context) --- deploy/firecracker/rootfs/Dockerfile.default | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/deploy/firecracker/rootfs/Dockerfile.default b/deploy/firecracker/rootfs/Dockerfile.default index ed431a296..c659936a3 100644 --- a/deploy/firecracker/rootfs/Dockerfile.default +++ b/deploy/firecracker/rootfs/Dockerfile.default @@ -79,6 +79,21 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libfuse3-3 \ && rm -rf /var/lib/apt/lists/* +# ── GitHub CLI (gh) ────────────────────────────────────────────────────────── +# Agents do GitHub operations (PRs, issues, auth) via `gh`. It isn't in Ubuntu's +# default repos, so add GitHub's apt source (keyring fetched with curl, installed +# above). The signed-by keyring means no apt-key / gnupg is needed, and +# dpkg --print-architecture keeps it correct on both amd64 and arm64 VMs. +RUN install -d -m 755 /etc/apt/keyrings \ + && curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \ + -o /etc/apt/keyrings/githubcli-archive-keyring.gpg \ + && chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \ + && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" \ + > /etc/apt/sources.list.d/github-cli.list \ + && apt-get update \ + && apt-get install -y --no-install-recommends gh \ + && rm -rf /var/lib/apt/lists/* + # Install rclone from upstream so we track current backend support. The # version pinned into the rootfs is whatever was current at image build # time; sandboxes surface it via `mounts.list().rcloneVersion` for ops triage.