Problem
When running wanman takeover against a GitHub-hosted repo, agents (dev, cto) follow the documented git workflow:
feature branch → write code → push → gh pr create → notify CTO
However, the gh pr create call fails (or silently skips) because the GitHub App / installation token that wanman provisions does not include the required scopes/permissions.
Observed in: takeover of nicgzlfly/-_the-crowd (2026-04-30)
Missing permissions
| Permission |
Needed for |
Observed state |
pull_requests: write |
gh pr create — agents opening PRs |
❌ missing |
actions: write (or read) |
Agents reading CI run status via gh run list / triggering re-runs |
❌ missing |
secrets: read |
Workflows that reference ${{ secrets.* }} (deploy pipeline uses SSH_PRIVATE_KEY, SERVER_HOST, etc.) |
❌ not accessible to App token |
Reproduction
- Install wanman and run
wanman takeover /path/to/repo against a private GitHub repo.
- Assign a dev task with a feature branch target.
- Dev agent pushes branch and calls
gh pr create.
- PR creation fails or is skipped because the GitHub App installation token lacks
pull_requests: write.
Expected behavior
wanman takeover setup flow (or docs) should verify that the configured GitHub App installation has at minimum:
pull_requests: write
actions: read (so agents can poll CI status)
contents: write (branch push)
- If permissions are insufficient, wanman should surface a clear error at startup rather than silently failing mid-task.
Suggested fix / detection
Add a pre-flight check in takeover-local.ts (or takeover-project.ts) that calls:
gh api repos/{owner}/{repo}/actions/permissions
gh api repos/{owner}/{repo} --jq '.permissions'
...and warns the user if pull_requests permission is absent before agents start working.
Alternatively, document the exact GitHub App permission set that must be granted before running wanman takeover.
Environment
- wanman CLI built from local source (
packages/cli/dist/index.js)
- Runtime:
claude (Claude Code subprocess)
- Repo type: GitHub public/private
- Auth: personal
gh token with repo, workflow scopes (agents inherit this; App token is separate)
References
packages/cli/src/takeover-project.ts lines 773–787 (CTO PR review workflow)
packages/cli/src/takeover-local.ts detectPullRequestUrl() (assumes PR already exists)
- Skill doc:
wanman/<task-slug> branch → gh pr create documented as required dev step
cc @chekusu
Problem
When running
wanman takeoveragainst a GitHub-hosted repo, agents (dev, cto) follow the documented git workflow:However, the
gh pr createcall fails (or silently skips) because the GitHub App / installation token that wanman provisions does not include the required scopes/permissions.Observed in: takeover of
nicgzlfly/-_the-crowd(2026-04-30)Missing permissions
pull_requests: writegh pr create— agents opening PRsactions: write(orread)gh run list/ triggering re-runssecrets: read${{ secrets.* }}(deploy pipeline usesSSH_PRIVATE_KEY,SERVER_HOST, etc.)Reproduction
wanman takeover /path/to/repoagainst a private GitHub repo.gh pr create.pull_requests: write.Expected behavior
wanman takeoversetup flow (or docs) should verify that the configured GitHub App installation has at minimum:pull_requests: writeactions: read(so agents can poll CI status)contents: write(branch push)Suggested fix / detection
Add a pre-flight check in
takeover-local.ts(ortakeover-project.ts) that calls:gh api repos/{owner}/{repo}/actions/permissions gh api repos/{owner}/{repo} --jq '.permissions'...and warns the user if
pull_requestspermission is absent before agents start working.Alternatively, document the exact GitHub App permission set that must be granted before running
wanman takeover.Environment
packages/cli/dist/index.js)claude(Claude Code subprocess)ghtoken withrepo,workflowscopes (agents inherit this; App token is separate)References
packages/cli/src/takeover-project.tslines 773–787 (CTO PR review workflow)packages/cli/src/takeover-local.tsdetectPullRequestUrl()(assumes PR already exists)wanman/<task-slug>branch →gh pr createdocumented as required dev stepcc @chekusu