> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aurinfer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Start Sessions from GitHub

> Let people start coding sessions by mentioning your character in GitHub issues, pull requests and comments.

With **Inbound Webhooks & Triggers** turned on, your character can pick up work straight from GitHub. When someone mentions it in an issue, a pull request or a comment, a Studio session starts, the character plans the work, and you review it in Studio.

***

## How it works

**1. Someone mentions the character on GitHub**

For example, a comment on an issue says *"@luna can you fix this?"*. The mention is `@` followed by the name in the character's dashboard link (`labs.aurinfer.com/luna`), or the character's name without spaces.

**2. AurInfer checks the event**

The person must have write access to the repository, or be on your allow list. Bots are ignored, so the character never answers itself.

**3. A session starts**

The session starts in **Plan** mode with **Ask before committing**, so nothing is changed or pushed without you. It works on a branch for the issue, or on the pull request's own branch, and uses the character's **Primary Coding Engine**.

**4. The character posts a link**

If **Post Progress Comments to GitHub** is on, the character comments on the issue or pull request with a link to the session.

**5. You review it in Studio**

The session shows up in your Studio list as **Awaiting Approval** once the plan is ready. Approve the plan, then commit as usual. See [Working in a Session](https://docs.aurinfer.com/Integrations/GitHub/workspace-session.md#plans).

Sessions started from GitHub belong to the character's owner, and they use the owner's credits and plan limits.

***

## Before you start

* The character needs the [GitHub integration](https://docs.aurinfer.com/Integrations/GitHub/setup.md) set up.
* **Start at least one Studio session in the repository first.** The character only answers events from repositories it has worked on in Studio.
* The character's owner needs GitHub access to the repository, through the GitHub App or their connected GitHub account. See [GitHub Access](https://docs.aurinfer.com/Integrations/GitHub/accounts.md).

***

## Set it up

Open **Coder → Settings** and find **Inbound Webhooks & Triggers**.

> [tab] With the GitHub App
>
> If the repository is covered by your AurInfer GitHub App installation, GitHub already sends its events to AurInfer. You don't need to add a webhook on GitHub.
>
> **1. Turn on Inbound Webhooks & Triggers**
>
> Switch on **Inbound Webhooks & Triggers**.
>
> **2. Choose the options**
>
> Pick the **Trigger Events** and any of the [options](#options) below.
>
> **3. Save**
>
> Click **Save Webhook Settings**.

> [tab] With a repository webhook
>
> For a repository the GitHub App doesn't cover, add a webhook to the repository on GitHub.
>
> **1. Turn on Inbound Webhooks & Triggers**
>
> Switch on **Inbound Webhooks & Triggers**.
>
> **2. Copy the Payload URL**
>
> Click **Copy** next to **Payload URL**. This address is your character's own.
>
> **3. Create a secret**
>
> Under **Secret (HMAC SHA-256)**, click **Generate New Secret**, then **Copy**. The secret is shown only once. You can also type your own secret instead. GitHub's deliveries are rejected until a secret is set.
>
> **4. Add the webhook on GitHub**
>
> In the repository on GitHub, open **Settings → Webhooks → Add webhook**. Paste the **Payload URL** and the secret. Either content type works. Under events, select the ones you picked in AurInfer, such as issues, issue comments, pull requests and pull request review comments. Save the webhook.
>
> **5. Save in AurInfer**
>
> Pick the **Trigger Events** and options, then click **Save Webhook Settings**.
>
> > [!WARNING]
> >
> > Generating a new secret makes the old one stop working at once. Paste the new secret into the webhook settings of every repository that uses it, or their deliveries fail.

***

## Options

| Option | What it does |
| - | - |
| **Trigger Events** | Which GitHub events can start a session: **Issues Opened**, **Issues Labeled**, **Issue Comments**, **Pull Requests Opened** and **PR Review Comments**. |
| **Required Issue/PR Label (Optional)** | If set, only issues and pull requests carrying this label start sessions, including comments on them. |
| **Also allow these GitHub users** | GitHub usernames whose mentions start sessions even if they can't write to the repository. |
| **Post Progress Comments to GitHub** | Posts a comment with a link to the session on the issue or pull request that started it. |

New issues, new pull requests and comments only start a session when they mention the character. Adding a label to an issue starts a session without a mention, if **Issues Labeled** is selected. Use **Required Issue/PR Label** so that only your chosen label does this.

> [!TIP]
>
> A label such as `aurinfer` makes a good switch: add it to the issues you want the character to handle, and set it as the **Required Issue/PR Label**.

***

## Recent deliveries

Under the options, **Recent deliveries** shows what GitHub sent in the last 24 hours and what came of it. Click **Refresh** to update the list.

| Status | Meaning |
| - | - |
| **Started a session** | A session started. Click **Open** to go to it. |
| **Ignored** | The event didn't qualify. The reason is shown, for example the character wasn't mentioned or the sender has no write access. |
| **Already handled** | The same event arrived twice, for example through both the GitHub App and a webhook. It ran only once. |
| **Limit reached** | Too many sessions started from GitHub, or the owner's plan limit was reached. |
| **Failed** | Something went wrong while handling the event. |

The number of sessions GitHub can start is limited per repository each hour, and in how many can run at once, so a busy repository can't start sessions without end.

***

## Troubleshooting

> [accordion] Nothing shows under Recent deliveries
>
> With a repository webhook, check the webhook's **Recent Deliveries** on GitHub. A red result usually means the Payload URL or the secret doesn't match. With the GitHub App, make sure the App installation covers the repository and is linked to the character owner's account.

> [accordion] Deliveries show as Ignored
>
> Read the reason under the delivery. The most common ones are a missing mention, a missing required label, a sender without write access, or a repository the character hasn't worked on in Studio yet.

> [accordion] Mentions don't start sessions after I paused the integration
>
> When **Integration Enabled** is off in **Workflow Settings**, GitHub events don't start sessions. Turn it back on and click **Save Settings**.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.