Fixes and pull requests from GitHub
Connect GitHub so drafts can read your code, propose code and data fixes, and open a pull request once someone on your team approves.
With source control on, AI drafts can read your product's code on GitHub to check how it really behaves before answering. When a draft finds the cause of a customer's problem, it can propose a fix. Nothing is written until someone on your team approves it, and then the fix arrives as a pull request for your engineers to review and merge. Administrators connect GitHub under Settings → Source control. Agents, admins and owners decide on proposed fixes.
Before you start:
- Turn on Source control under Settings → Capabilities.
- Set up AI: see Setting up AI.
- You need to be able to install apps on your GitHub organization, or ask an owner of it to approve.
Connecting GitHub
- Go to Settings → Source control and press Connect GitHub.
- On GitHub, choose your organization (or personal account) and the repositories the app may see, and install it. GitHub also asks you to authorize the app, which is how Lagotto confirms the installation is yours.
- GitHub sends you back to Settings → Source control, which now shows your GitHub account as Connected and lists the repositories.
Finish in the same browser, signed in as the person who pressed Connect GitHub, within 15 minutes.
- If you are not an owner of the organization, GitHub sends them a request instead. Once they approve it on GitHub, come back and press Connect GitHub again.
- A workspace connects one GitHub account, and a GitHub account can be connected to only one workspace.
Choosing repositories
You choose repositories twice: on GitHub when you install the app, and again in Lagotto, where every repository starts Off. Only a repository that is on can be read by the AI or receive a pull request.
- On Settings → Source control, press Edit beside a repository.
- Switch on Let the AI use this repository.
- Write a Description of what it is, such as "The customer-facing web app, Rails". The AI reads it to decide where to look.
- Check the Scripts folder, where a data fix script goes. It starts as
scripts. - Press Save.
To change which repositories the app can see, change its repository access on GitHub. Lagotto picks up the change, or you can press Sync repositories. A repository removed on GitHub disappears from Lagotto, along with its proposed fixes and pull request links on tickets.
What drafts do with your code
A draft can search and read files in repositories that are on. Files that usually hold secrets, such as .env files, private keys and encrypted credentials, are never read.
Drafts are instructed never to put code, file paths or internal names in a reply, and never to promise a customer a fix or a date until its pull request has merged.
Proposed fixes
When a draft finds a problem it can fix, it files a proposal. It appears under Proposed fixes, below the AI draft on the ticket, marked Needs a decision, and the queue shows the ticket as Decision needed. To list those tickets, choose Decision needed in the queue's AI status filter.
There are two kinds:
- Code fix: a change to your product's code.
- Data fix: a one-off correction to this customer's data, delivered as a single script in the repository's scripts folder, named with the date, the ticket number and a short description, such as
scripts/20261204_ticket_1042_reset_trial_end.rb. Lagotto never runs it: your engineers review it and run it the way they run any script.
A ticket has at most one waiting proposal of each kind. A newer one replaces it. Open What the AI found to read what is wrong, where, and what would change.
Approving or declining
- Press Open a pull request and confirm to approve. The proposal shows Working while the change is written, then Pull request opened with a link to it.
- Press Don't to decline. Nothing is written.
Read-only seats see the proposal but cannot decide. Approving needs source control on, the repository still on, and AI able to run. Writing the change is an AI run, so it uses AI credits when your workspace uses Lagotto's key.
If the pull request could not be opened, the proposal shows Failed with the reason. Press Try again, or Don't to give up. A proposal still working after 45 minutes shows Stalled.
The pull request
- Lagotto creates a new branch named
lagotto/ticket-<number>-<title>-<code>from your default branch, makes one commit, and opens a pull request into the default branch. The description ends with the ticket number and who approved it. - It never pushes to an existing branch, never merges, and never deletes a branch.
- It can add or change files, but not delete them, and it never touches files under
.github/workflowsor files that hold secrets. - An internal note on the ticket links the pull request.
When the pull request is merged on GitHub, the ticket gets an internal note saying so, and its badge changes to Merged. A pull request closed without merging shows Closed. The next draft knows which: only after a merge may it tell the customer a fix has been made, still without a date.
Disconnecting
- On Settings → Source control, press Disconnect GitHub and confirm.
- Uninstall the app on GitHub, at
https://github.com/settings/installations, or for an organization under its settings, GitHub Apps.
Disconnecting removes Lagotto's record of your GitHub account, its repositories, and the proposed fixes and pull request links on tickets. Pull requests already open on GitHub stay as they are. Uninstalling the app on GitHub also disconnects it here.
If the app is suspended on GitHub, the page shows Suspended: nothing can be read and no pull request opened until an owner of the organization lifts the suspension.
Connecting, disconnecting, switching repositories on or off, and approving fixes are recorded in the audit log.