You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Commits made by Junior are attributed to a random GitHub user junior ([email protected], user ID MDQ6VXNlcjU1MTAwNw==) instead of the sentry-junior[bot] app account. This affects all PRs Junior creates — example: getsentry/sentry#113900.
Root cause: No git config user.name / user.email is set in the sandbox environment. When git commits with a GitHub App installation token and no explicit identity, GitHub resolves the author from the token's associated slug. Since the app slug is junior, GitHub matches it to an unrelated existing user account named "junior".
Desired fix
Set the git author identity to the bot's proper noreply address before any commits:
The {app-user-id} is the numeric GitHub user ID for the sentry-junior[bot] account (retrievable via gh api /users/sentry-junior%5Bbot%5D --jq .id).
Open question
A global git identity config baked into the sandbox would fix this, but it's unclear how to make that configurable across different GitHub App installations or plugin configurations. Ideally the git identity would derive from the active GitHub plugin credentials rather than being hardcoded.
Reported by Nick Meisenheimer. Action taken on behalf of David Cramer.
noninteractive-command.ts sets GIT_CONFIG_NOSYSTEM=1 and GIT_CONFIG_COUNT=2 (for credential isolation), but never configures user.name / user.email. Git falls back to the installation token's associated slug, which GitHub resolves to an unrelated user account named "junior" (MDQ6VXNlcjU1MTAwNw==).
Inject GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL from github-app-broker.ts into the CredentialLease.env.
Why this approach:
Commit identity is credential-scoped (sandbox is reused across turns, so persistent git config --global is unsafe)
Dynamic — derives identity from the GitHub App via GET /app + GET /users/{slug}[bot], works for any app installation
No conflicts with existing GIT_CONFIG_COUNT mechanism — these are separate git env vars
All plumbing already exists: lease env flows through inject-credentials.ts → buildNonInteractiveShellScript() → sandbox bash. Only github-app-broker.ts needs changes.
Implementation: At broker creation, call GET /app (JWT) to get app slug, call GET /users/{slug}[bot] to get bot user ID, cache both, add the four env vars to every lease.
Activity
sentry-junior commentedon May 13, 2026
Research findings
Root cause detail
noninteractive-command.tssetsGIT_CONFIG_NOSYSTEM=1andGIT_CONFIG_COUNT=2(for credential isolation), but never configuresuser.name/user.email. Git falls back to the installation token's associated slug, which GitHub resolves to an unrelated user account named "junior" (MDQ6VXNlcjU1MTAwNw==).The correct bot identity is:
sentry-junior[bot]264270552264270552+sentry-junior[bot]@users.noreply.github.comRecommended long-term fix: Dynamic broker-derived lease env (A3)
Inject
GIT_AUTHOR_NAME,GIT_AUTHOR_EMAIL,GIT_COMMITTER_NAME,GIT_COMMITTER_EMAILfromgithub-app-broker.tsinto theCredentialLease.env.Why this approach:
git config --globalis unsafe)GET /app+GET /users/{slug}[bot], works for any app installationGIT_CONFIG_COUNTmechanism — these are separate git env varsenvflows throughinject-credentials.ts→buildNonInteractiveShellScript()→ sandbox bash. Onlygithub-app-broker.tsneeds changes.Implementation: At broker creation, call
GET /app(JWT) to get app slug, callGET /users/{slug}[bot]to get bot user ID, cache both, add the four env vars to every lease.Interim fix deployed
https://github.com/getsentry/junior-prod/pull/71 — patches the
@sentry/junior-githubplugin.yamlviapnpm patchto add staticcommand-envwith the four git identity env vars. This is junior-prod-only and hardcoded for thesentry-juniorapp. It should be removed once the dynamic broker fix lands.Alternatives evaluated
NON_INTERACTIVE_ENVcommand-envin plugin.yamlGIT_CONFIG_COUNTgit config --globalat sandbox bootKey files
packages/junior/src/chat/plugins/auth/github-app-broker.ts— add identity to lease envpackages/junior/src/chat/sandbox/noninteractive-command.ts— existingNON_INTERACTIVE_ENV(no changes needed)packages/junior/src/chat/tools/execution/inject-credentials.ts— existing env injection (no changes needed)fix(sandbox): Attribute GitHub commits to app bot
fix(sandbox): Simplify egress provider authorization
feat(sandbox): Add credential egress proxy (#338)
fix(sandbox): Scope egress and adapt sandbox v2 (#346)