Skip to content

Container sandbox doesn't pass GITHUB_TOKEN, causing git push 403 #202

Description

@danchild

ContainerRunner._build_env_vars passes LLM credentials, git config, and Langfuse settings to sandbox containers but omits GITHUB_TOKEN. When the container agent finishes implementing changes and tries to push to the fork, git push fails with a 403 because no GitHub credentials are available inside the container.

Observed behavior: Workflow reaches implement_bug_fix, container exits successfully (code changes made), but the subsequent git push -u fork <branch> fails:

Git command failed: git push -u fork forge/aisos-2281
remote: Permission to danchild/forge.git denied to danchild.
fatal: unable to access 'https://github.com/danchild/forge.git/': The requested URL returned error: 403

Root cause: src/forge/sandbox/runner.py _build_env_vars() never includes GITHUB_TOKEN in the container environment.

Fix: Add GITHUB_TOKEN to the env vars dict in _build_env_vars.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions