This is the “team” page for Agents, intended to be read by internal teammates working on agents.
For user installation docs, see Sourcegraph Agents (EAP).
We announced “AI Agents” on January 29th as part of our Sourcegraph 6.0 release
https://sourcegraph.com/blog/introducing-enterprise-ai-agents
The scope of this Notion page is to aggregate various internal docs on Agents in one place.
Quinn wrote the following notes during the early phases of Agents
First, read the customer-facing installation docs Sourcegraph Agents (EAP). This section describes the additional steps you need to make the installed GitHub App work with your locally running https://sourcegraph.test:3443 instance.
Run sg start minimal-sveltekit
like normal.
Add a private personal repo to your local instance via enterprise/dev/external-services-config.json
in dev-private. Update the GitHub token
to a PTA (gh auth token
). Confirm that the Sourcegraph instance has access to this repo by visiting the URL (example: https://sourcegraph.test:3443/github.com/sanjayesn/test-sg-review-agent).
"token": <YOUR_GH_TOKEN>, // user: sourcegraph-bot-devx token: dev-private-public-only
"repos": [
"sourcegraph/sourcegraph",
## Add your repo here
"sanjayesn/test-sg-review-agent",
...
]
Create an agent and GitHub App like normal. Make sure to update the agent connections to link with your GitHub App.
Update the GitHub App webhook in the GitHub UI. By default, the GitHub App will send webhook events to https://sourcegraph.test:3443/webhook/WEBHOOK_NAME, which isn't going to work because it's running locally. Solve this problem by visiting https://webhook.site to create a unique webhook URL for your local instance. Manually update the webhook URL on the GitHub App (on the GitHub UI, not Sourcegraph!) to point to the webhook.site URL (example: https://webhook.site/#!/view/7adc5f8a-1dee-49bc-9106-f7ccdfa7a14c/505cb973-30e6-BLAH-FOO-BAR) Manually confirm in the webhook.site UI that GitHub is sending webhook events to the webhook.site URL.
Install the whcli
tool locally (pnpm install -g @webhooksite/cli
) and let it forward webhooks to your local instance.
# update this to the webhook URL that the GitHub App had originally configured
SOURCEGRAPH_INCOMING_WEBHOOK_URL=https://sourcegraph.test:3443/.api/webhooks/7014f1c2-ce26-4d34-b0fd-fd8e7ac5413d
# update this to the webhook.site token that you updated GitHub to send webhooks to
WEBHOOK_SITE_TOKEN=4ab4cbb5-3072-47bd-bdd2-599f77758a0e
# Start forwarding webhooks to your locally running Sourcegraph instance
NODE_TLS_REJECT_UNAUTHORIZED=0 whcli forward --token=$WEBHOOK_SITE_TOKEN --target=$SOURCEGRAPH_INCOMING_WEBHOOK_URL
@sourcegraph review
to trigger
the review agent. If everything is working, you should see a review comment from
the review agent.Our internal API docs document several agent-related API endpoints