GitHub¶
Connect Crios to GitHub to back projects with GitHub repositories, have sessions push their work to those repositories, and turn issues into working sessions.
GitHub is configured per organization. An organization owner or admin sets it up under Organization → Connectors → App credentials by clicking Configure on the GitHub card. Every member of the organization then works through that connection; it is not a per-user account. The screen itself is described in Connectors & certificate authorities.
Members see the connection on their Connectors page as your organization's connection: a GitHub App, or an Access token for a device-flow account. A GitHub App reads Error when GitHub refuses it, for example after the app was uninstalled or suspended; an Access token reads Error only after it fails an admin's Test Connection.
What the integration enables¶
- GitHub as a repository kind. GitHub appears under Repository Kind in the New Project dialog once a connection is configured. The Repository field becomes a searchable picker over up to 300 repositories the connection can see: type any part of the owner or name (Search GitHub repositories…), and picking one fills in its default branch. With a GitHub App, those are exactly the repositories you granted at install time. Organization members, admins and owners can browse it; viewers and the agents running in sessions cannot, because the connection can see repositories no project uses. See Creating a project.
- Work lands in your repository. Sessions on a GitHub-backed project
push their session branches to the repository and merge them into
crios/mainthere. They do not open pull requests as part of their normal flow: you review and mergecrios/maininto your own branches, for example with a pull request you open yourself. Sessions started from an issue are asked to open a pull request, and when a session opens one, its link appears as View PR. See Repositories. - Issue intake. Label an issue, assign it to the Crios bot, or @-mention the bot, and Crios picks it up as an external intake ticket.
Gitea (Built-in), the repository host that ships with Crios, is always available and needs no connector.
What a session's GitHub token can reach
A session gets a GitHub token when its sandbox starts, and anything the session runs can read it. With a GitHub App, that token works for the project's own repository only, with write access to its contents and pull requests, so code in a session cannot reach your other repositories. A device-flow account cannot be narrowed that way: its token reaches every repository the account can. Crios only sends the token to github.com.
App tokens expire after about an hour. A running session asks for a fresh one every 30 minutes, and again when GitHub refuses the one it has, so a long session keeps pushing.
Ways to connect¶
The GitHub card offers three ways in. When several are configured, Crios uses the first that works: the GitHub App, then the OAuth device-flow account, then a token from the deployment's environment. That last fallback applies only to the deployment's oldest organization.
One-click GitHub App (recommended)¶
Crios creates a GitHub App for you from a manifest, so you never copy credentials by hand.
- In Organization → Connectors → App credentials, click Configure on GitHub. Under Connect GitHub (one-click), enter the GitHub organization that should own the app in GitHub organization (optional), or leave it empty to create the app on your own GitHub account, then click Connect GitHub.
- Your browser is sent to GitHub with a pre-filled app manifest. Confirm to create the app. It is named after your Crios host, with a short random suffix.
- GitHub redirects back to Crios, which stores the app ID, private key, webhook secret and bot login in your organization's connector settings.
- You land on the app's installation page. Select the repositories Crios may access. You can change the selection later in GitHub under the app's settings.
- After installation you return to the Organization page with the toast GitHub connected. The card now reads App connected, followed by the bot's login.
Until the app is installed somewhere, it reaches no repository, and the card says so: App created, not installed. That happens when you close GitHub's installation page, or when an owner has yet to approve the installation (see below). Click Finish Install to reopen the app's installation page, or Disconnect to remove the app.
The app requests write access to repository contents, pull requests and issues, and read access to metadata. It subscribes to issue and issue comment events, the only ones Crios acts on. Each of the two redirects back from GitHub must arrive within 15 minutes.
Finish the connect in the browser you started it in. Connect GitHub leaves a short-lived cookie there, and Crios accepts GitHub's redirects only together with it, once each: a redirect link opened in another browser, or opened a second time, ends in GitHub connect failed. Please try again. and stores nothing. Start from the Crios address GitHub returns to (the public base URL below), since the cookie belongs to the address you start from. Finish Install leaves a new cookie in the browser you click it in.
If another admin of your organization connects GitHub while you are on the installation page, the app they create replaces yours. Your installation is then not stored, because it belongs to an app whose key the organization no longer holds: Crios says That GitHub install was not saved, and you remove that app on GitHub.
Public URL required
GitHub has to redirect your browser back to Crios and deliver webhooks to
it, so the one-click flow needs the deployment's public base URL
(CRIOS_PUBLIC_BASE_URL, Helm value orchestrator.config.publicBaseURL)
and an API that github.com can reach. Without the public base URL,
Connect GitHub fails with a message saying so; enter the credentials
manually instead.
Personal account or organization
GitHub lets a private app be installed only on the account that owns it. To install on a GitHub organization, name it in GitHub organization (optional) so the app is created there; you need to be allowed to create apps in that organization. Left empty, the app is created under the GitHub account you are signed in with.
Organization approval
If you are a member but not an owner of the GitHub organization, the installation may be created as a request. Crios then shows The GitHub App install now waits for an owner of the GitHub account to approve it. Nothing works until an owner approves it. Once they do, GitHub reports the installation to the app's webhook, and the card turns to App connected without anyone reconnecting.
Manual App credentials¶
If you already have a GitHub App, or cannot use the redirect flow, enter its
credentials on the GitHub card: App ID, Installation ID, App
private key (PEM), Webhook secret and Bot login (the app's name
followed by [bot]). Click Save & Apply, then Test Connection. The
test mints an installation token and reports the app and installation IDs.
Secret fields are write-only and shown masked afterwards.
The card's Setup guide lists the steps in GitHub's console: the permissions, the events, and where to find the installation ID.
OAuth device flow¶
As an alternative to an app, OAuth device flow connects a single GitHub
account and uses it for the whole organization. Click Connect; a dialog
shows a code to enter at GitHub's device page, and Crios waits until you
authorize. It checks at the pace GitHub sets: the first check after GitHub's
interval (at least 5 seconds), and slower whenever GitHub asks it to, so the
dialog can take a few seconds after you authorize to show the account. The
account is asked for the repo and read:user scopes, so
Crios can reach every repository that account can. The deployment needs a
GitHub OAuth App with device flow enabled, and its client ID set on the
orchestrator (GITHUB_OAUTH_CLIENT_ID).
The token belongs to your organization alone. Connecting, reconnecting or disconnecting here never changes another organization's GitHub connection, and another organization's account never shows on your card.
Webhooks¶
GitHub delivers issue events to Crios, signed with the app's webhook secret
(X-Hub-Signature-256). Crios rejects deliveries whose signature does not
match, and answers 503 until a webhook secret is configured.
A delivery whose signature checks out is answered at once, and Crios handles it right after: it records the work, then comments and labels the issue. GitHub counts a delivery as failed when the answer takes more than 10 seconds, so slow GitHub calls no longer turn a delivery red in the app's Recent Deliveries. Handling a delivery stops after a minute; a comment or label that fails is logged by the orchestrator and not retried.
- An app made with Connect GitHub registers your organization's own
address,
https://<crios-host>/api/v1/webhooks/github/<organization-id>. - The Webhook URL shown on the card is the shared address
https://<crios-host>/api/v1/webhooks/github. Use it when you register an app by hand. Crios gives each delivery to the one organization whose webhook secret verifies it; when several secrets do, the app ID GitHub sends with the delivery decides. A delivery that still fits several organizations is refused with409, and one that no secret verifies with401.
Issue triggers and labels¶
Crios starts work on an issue when any of the following happens:
| Trigger | Example |
|---|---|
| Issue opened or labeled with the intake label | Add the crios or crios-eligible label |
| Issue assigned to the Crios bot | Assign the app's bot user |
| Bot @-mentioned in the issue or a comment | @crios please fix this |
| Command in a comment | /crios fix, /crios work, or @crios work <details> |
The label and mention keyword is crios unless your administrator changed
the deployment's intake keywords (CRIOS_INTAKE_KEYWORDS). The bot's own
login from Bot login also counts as a mention and as an assignee. Events
the bot itself causes are ignored, so its own comments never start new work.
The ticket goes to the project in your organization whose repository URL matches the issue's repository; when several do, the oldest. Only your organization's projects are considered, even when another organization links the same repository. If none matches, it waits in the intake inbox as Needs Project.
Steering from comments¶
While a session is working on an issue, comment @crios focus <guidance>
on the issue to steer it, for example @crios focus prioritize the API
change, skip the UI polish. The guidance reaches the session like a chat
message (see steering), and the "Crios Progress"
comment switches to in_progress. The comment must start with the
mention; the bot's own login works as well as @crios, as for the triggers
above. Nothing happens when no session is linked to the issue yet, or when
its session has finished.
As work progresses, Crios keeps one "Crios Progress" comment on the issue up to date and manages progress labels:
crios: accepted for intakecrios:in-progress: a session is working on itcrios:pr-ready: a pull request is opencrios:resolved: finishedcrios:needs-help: Crios could not complete the work
Track and manage all tickets in the intake panel.
Disconnecting¶
To remove a one-click app, click Disconnect under Connect GitHub (one-click) and confirm Disconnect the GitHub App?. Crios deletes the app's installation on GitHub, which revokes its repository access, and always clears the stored credentials. If GitHub cannot be reached, the credentials are still cleared and Crios tells you to remove the app under GitHub Settings → Applications. The app registration itself stays in your GitHub developer settings until you delete it there.
To remove a device-flow account, click Disconnect under OAuth device flow. Once no connection is left, issue intake and pull requests stop for your organization until you reconnect.
Creating, installing and disconnecting the app, an installation request, and connecting or disconnecting a device-flow account are recorded in the audit log. An installation or uninstallation that GitHub reports through the app's webhook is recorded without an actor.