Background-agent can't access private packages for bundle and yarn installs

Describe the Bug

I was trying to use the Dockerfile setup to spin up a background agent, but our project uses private gems and private packages. When I tried to run bundle and yarn as part of the install hook it failed. I then tried to add my GITHUB_TOKEN as a secret in the background agent secrets and as an ARG to my Dockerfile so that it would be available in the install step. My assumption was that any secrets would also be passed as arguments to the docker build, but that does not seem to be the case. I’m assuming the install step is being run at image build time. Any suggestionf for how to access private github repos during the install step. I can get it to work as part of the start command, but that adds about 5 minutes to our spin-up of an agent. The following is snippet from our Dockerfile where that I was hoping would work, but did not

ARG GITHUB_TOKEN
ENV GITHUB_TOKEN=${GITHUB_TOKEN}
ENV BUNDLE_GITHUB__COM="x-access-token:${GITHUB_TOKEN}"

Steps to Reproduce

Add Dockerfile for background-agent setup. The associated repository has a Gemfile or package.json that requires authentication to obtain certain libraries. You cannot use bundle or yarn commands as part of the install commands in environment.json because authentication to github can’t be established.

Expected Behavior

Cursor secrets should also be passed to the image build, or a separate set of env vars should be able to be specified for passing to the build.

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.1.5 (Universal)
VSCode Version: 1.96.2
Commit: ef5eeb47a684b4c217dfaf0463aa7ea952f8ab90
Date: 2025-06-21T05:26:18.966Z
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.5.0

Does this stop you from using Cursor

No - Cursor works, but with this issue