Skip to content

fix(agents): let clawdbot agents open PRs — install gh + seed gh auth - #487

Merged
samxu01 merged 1 commit into
mainfrom
fix/agent-pr-gh-cli
Jun 26, 2026
Merged

fix(agents): let clawdbot agents open PRs — install gh + seed gh auth#487
samxu01 merged 1 commit into
mainfrom
fix/agent-pr-gh-cli

Conversation

@samxu01

@samxu01 samxu01 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Smoke-test finding → gap filled

Live multi-agent smoke test (2026-06-26): an agent wrote a TS util + Jest test and git-pushed a branch, but gh pr create failed — gh wasn't installed. Root cause: deploy-dev.yml passes --build-arg OPENCLAW_INSTALL_GH_CLI=1 but the openclaw Dockerfile never handled that arg (it handles browser/docker-cli/apt-packages but not gh).

Fix

  • openclaw (submodule bump → 16a62bc4): Dockerfile now honors OPENCLAW_INSTALL_GH_CLI — registers the cli.github.com apt source + installs gh. (Team-Commonly/openclaw main.)
  • commonly: clawdbot postStart seeds gh auth — writes $GH_CONFIG_DIR/hosts.yml (/state/gh on the PVC) from the trimmed GITHUB_PAT, plus a GH_CONFIG_DIR env so acpx_run sub-agents inherit it. gh pr create now works non-interactively.

Verified after deploy: which gh in the gateway + an agent opening a real PR.

🤖 Generated with Claude Code

Smoke test (2026-06-26) surfaced that openclaw agents could write code and
git-push a branch but `gh pr create` failed: gh wasn't installed. Root cause:
deploy-dev.yml passed --build-arg OPENCLAW_INSTALL_GH_CLI=1 but the openclaw
Dockerfile never handled it.

- Bump _external/clawdbot to include the Dockerfile fix that honors
  OPENCLAW_INSTALL_GH_CLI (adds the cli.github.com apt source + installs gh).
- Seed gh auth in the clawdbot postStart hook: write $GH_CONFIG_DIR/hosts.yml
  (/state/gh on the PVC) from the trimmed GITHUB_PAT, and add GH_CONFIG_DIR to
  the container env so acpx_run sub-agents inherit the same auth. Now
  `gh pr create` works non-interactively from agent coding sessions.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@samxu01
samxu01 force-pushed the fix/agent-pr-gh-cli branch from 4f3e879 to 44df6ba Compare June 26, 2026 10:49
@samxu01

samxu01 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

Merged to main (single clean commit on 75f0155).

@samxu01
samxu01 merged commit 44df6ba into main Jun 26, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant