API referenceConsole
code agent
Polylane investigates the issue and hands the fix to Amp, the coding agent by Sourcegraph, which opens the pull request on your GitHub using your Amp token.

Connect

Connect Amp from the terminal. Pass --help for the flags Amp accepts.

Terminal
polylane integration connect --type amp

How it works

Polylane hands the fix to Amp

When a fix run confirms the root cause of an issue, Polylane writes a brief: the root cause, the change to make, and how to check it. Every brief tells Amp to run the typecheck, the lint and the tests of the repository, and to list each check in the pull request description. A fix from a chat thread also includes the change that Polylane wrote in its sandbox.

Before Amp starts, Polylane applies the same gates as for its own fixes: the autofix switch, the autofix quota, a fix already in progress, and an open pull request for the same fix.

Amp starts hosted runs only through its CLI. Polylane runs the official Amp CLI in a Polylane sandbox and starts one private thread in an orb, on the Amp project of the repository. When the thread exists, the CLI stops and the orb continues the work. The brief gives Amp a branch name and a marker, polylane-autofix: <id>, to put in the pull request description.

Code hosts

Amp works only with GitHub repositories. For a repository on GitLab, Polylane writes the fix in its own sandbox.

The pull request comes back

Polylane reads the thread every three minutes, for a maximum of six hours. Polylane accepts a pull request that Amp opened after the launch, on the branch from the brief or with the marker in its description. Polylane then records it on the autofix and adds a section with its evidence and the history of the fix. If the thread stops without a pull request, Polylane records the autofix as skipped.

When a run fails

If the thread fails or does not finish in six hours, Polylane's own agent takes the fix and writes it. If Polylane cannot reach Amp on five reads in sequence, the run stops and Polylane's agent takes over. A run that opened a pull request always counts as a success.

If Polylane cannot confirm that Amp started a thread, it does not start a second one. If Amp refuses the token, Polylane sends one notice and gives new fixes to its own agent until you reconnect or verify the integration.

Troubleshooting

When an Amp run fails, Polylane's own agent writes the fix. To let Amp do the next fix, correct the cause:

What Polylane reportsWhat to do
The repository is not an Amp projectAdd the repository as a project in Amp.
The Amp account is out of creditsAdd credits in Amp.
Polylane could not confirm that Amp started the fixStart the fix again.
Amp did not finish in the time limitGive Amp a smaller task.
Amp refused the tokenCopy a new token and reconnect Amp.

Disconnecting

Disconnect Amp in Polylane. After you disconnect, Polylane's own agent writes new fixes.

Disconnect

Disconnecting stops every sync and check and deletes the credentials Polylane held. Everything Polylane set up in Amp is removed as well; nothing is left behind.

Terminal
polylane integration disconnect <id>