Skip to content

fix(github-token): prefer App installation token over PAT in user fallbacks#31

Open
genisd wants to merge 2 commits intogynzyfrom
feat/use-github-app-token-over-pat
Open

fix(github-token): prefer App installation token over PAT in user fallbacks#31
genisd wants to merge 2 commits intogynzyfrom
feat/use-github-app-token-over-pat

Conversation

@genisd
Copy link
Copy Markdown
Member

@genisd genisd commented May 7, 2026

When a user has no stored GitHub OAuth token (e.g., logged in via a
non-GitHub OAuth provider) the cascade fell straight to the PAT,
ignoring a configured GitHub App. Deployments using only an App for
server-side auth therefore failed with "No GitHub token available" on
every task credential request, which broke scheduled tasks at the
agent's first git operation.

Route all user-token fallbacks through getServerToken so the order
becomes: user OAuth → App installation token → workspace PAT → global
PAT. getServerToken now accepts an optional workspaceId so the PAT
fallback still prefers a workspace-scoped GITHUB_TOKEN before global.

Summary

Changes

Testing

  • Tests pass (pnpm turbo test)
  • Typechecks pass (pnpm turbo typecheck)

Related

Closes #

Screenshots

genisd and others added 2 commits May 7, 2026 09:32
…lbacks

When a user has no stored GitHub OAuth token (e.g., logged in via a
non-GitHub OAuth provider) the cascade fell straight to the PAT,
ignoring a configured GitHub App. Deployments using only an App for
server-side auth therefore failed with "No GitHub token available" on
every task credential request, which broke scheduled tasks at the
agent's first git operation.

Route all user-token fallbacks through getServerToken so the order
becomes: user OAuth → App installation token → workspace PAT → global
PAT. getServerToken now accepts an optional workspaceId so the PAT
fallback still prefers a workspace-scoped GITHUB_TOKEN before global.
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.

2 participants