- Langy pull requests. Langy opens pull requests through the App. They are authored by the App and credit the requesting user with a
Co-authored-bytrailer and aRequested by @<login> via LangWatchnote in the body. - Coding-agent pull request linkage. LangWatch matches each coding-agent session to the pull request its branch became, so the Pull Requests page can report what each pull request cost in assistant usage. This part only reads.
Also check: What Langy can do in your GitHub, Setup, Environment variables.
Registering the app is independent of the Langy runtime, which the umbrella chart deploys by default. See Setup first if you have not enabled the pod yet. If the private key is unset, the GitHub feature is silently off and Langy returns findings without opening PRs.
Register the app
Go to GitHub, then your org settings > Developer settings > GitHub Apps > New GitHub App. Self-hosted registration is manual for now; the App Manifest one-click flow is a deferred follow-up. Fill in these fields:/api/github-langy/setup and /api/github-langy/webhook are the earlier paths. They stay mounted on the same handlers, so an App already registered with them keeps working. Use the paths above for a new registration.
Under Subscribe to events, select Pull request. GitHub sends the installation lifecycle events (
installation, installation_repositories) on its own. Subscribe to nothing else.
The pull_request event links a pull request to its coding-agent sessions as soon as GitHub announces it. Without the event, linkage still works, but it waits for the periodic sweep, which can take up to a day for a branch that has been asked about a few times already.
Click Create GitHub App. On the resulting page:
- copy the App ID
- note the app slug (the last segment of the app’s own URL)
- Generate a private key and download the
.pem
Plumb the secrets
Add these to the control-plane env (.env or your secret manager). All are optional in the schema (platform/app/src/env-create.mjs); when the private key is unset the feature is silently off, the connect card reports the integration as unavailable, and no token can be minted.
.env
CREDENTIALS_SECRET (already required for any production install) signs the install round-trip’s state, so nothing new is needed there.
For the full env-var reference, see Environment variables.
Helm
The chart has noGITHUB_LANGY_* keys of its own. Set the variables with app.extraEnvs or app.extraEnvFrom.
GITHUB_LANGY_PRIVATE_KEY is a multi-line PEM, so put all four values in a Secret you manage and reference it with app.extraEnvFrom. That keeps the PEM out of your values file and lets you rotate it without a chart change.
values.yaml
workers when you run the LangWatch workers as their own deployment. The periodic branch recheck runs there, and without the private key it cannot mint a token.
The LangWatch workers deployment is part of the control plane. It is not the Langy agent pod, which runs customer code in a sandbox and never receives the private key.
GitHub Enterprise Server
One LangWatch instance connects to exactly one GitHub. To use GitHub Enterprise Server instead of github.com:- Register the App on the Enterprise Server instance, at
https://<HOSTNAME>/settings/apps/newunder your organization or site admin settings. An App registered on github.com cannot be installed on an Enterprise Server, so this is a separate registration with its own id, key and slug. - Set
GITHUB_LANGY_HOSTto the Enterprise Server hostname, for examplegithub.acme-corp.internal. Give the hostname only, with no scheme and no path. - Set the other four
GITHUB_LANGY_*variables from the new registration.
https://<HOSTNAME>/api/v3, the install link at https://<HOSTNAME>/github-apps/<slug>/installations/new, and the uninstall link in settings. Egress from the control plane goes to the Enterprise Server host instead of api.github.com.
Sessions are matched by the host their git remote reports, so an instance bound to an Enterprise Server links sessions on that host and leaves github.com sessions unlinked.
GITHUB_LANGY_HOST covers the control plane: the connection, token minting, and coding-agent pull request linkage. Langy’s own pull requests still go to github.com, because the worker clones with the gh command line, which reads its own host setting. Enterprise Server support for Langy pull requests is separate work.Restricted networks
GitHub must be able to reach<BASE_URL>/api/github/webhook to deliver webhooks. Many self-hosted instances sit behind a VPN or a private network, where that is not true.
The webhook is optional. An instance with no inbound path connects and works. Connecting is a browser redirect through /api/github/setup, so only the admin’s own browser has to reach the instance, not GitHub. You can leave Webhook > Active off, or leave it on and accept the failed deliveries.
What changes without webhooks:
Everything else is outbound only and is not affected: minting installation tokens, Langy opening pull requests, the post-connect backfill, and the live pull request status the page reads.
Install the app
An org admin installs the app from Settings > Integrations > GitHub > Install the LangWatch GitHub App, or from the in-chat card the first time Langy needs GitHub access. GitHub walks them through choosing the repositories, then redirects to the Setup URL, which records the installation against their LangWatch organization. The installation is the access boundary: Langy can only open PRs on repositories the app is installed on. A single LangWatch organization can install the app on several GitHub accounts; each installation is listed separately in settings.Verify
In a session, ask Langy something like “open a PR on<a repo the app is installed on>”. You should see:
1
Install card (if not yet installed)
The “Install the LangWatch GitHub App” card appears in chat if the org has not installed the app yet.
2
Chat continues
After installing, the popup closes and the chat continues.
3
PR card
Langy clones the repo into the per-session worker home, branches, commits, pushes, and posts the PR URL, rendered as a PR card. The PR is authored by the app, with the requester credited as co-author.
pull_request subscription, open a pull request on a repository the app is installed on, from a branch a coding-agent session ran on. GitHub records the delivery under Advanced > Recent Deliveries on the app registration, and the pull request appears on the LangWatch Pull Requests page without waiting for the sweep.
If anything goes wrong, the audit log (langy.github.install, langy.github.disconnect) and Sentry capture the failure paths.
Disconnect
Go to Settings > Integrations > Disconnect, which opens GitHub’s uninstall page (GitHub cannot be uninstalled via the API). Once GitHub confirms, theinstallation.deleted webhook removes the local record.
Operational notes
- Token in the agent pod, not on disk. Langy workers receive a 1-hour installation token via
GH_TOKENenv. The github skill wiresgit config credential.helper '!gh auth git-credential'so git pushes read it from env, with no.gitconfigand no.git-credentials. The clone directory lives inside the per-worker home that the idle reaper deletes (within 10 min). - Nothing at rest. No token or refresh token is stored control-plane side. The app private key is the only credential; it never leaves the control plane and never reaches the Langy agent pod. Tokens are minted per turn, cached in Redis a hair under their 1h lifetime, and self-expire. The cache key carries the GitHub host, so two GitHub instances cannot share an entry.
- Least privilege at mint time. Tokens are minted with only
contents:writeandpull_requests:write, scoped to the installation’s repositories (or a single repository when the turn targets one). - Sticky worker tokens. A worker spawned with token T keeps T until the idle reaper kills it. Removing the installation cuts off new turns immediately; a live worker may hold a token for up to the idle TTL (within 10 min) or until it self-expires (within 1h).
- Egress. The control plane reaches
api.github.comto mint installation tokens and read installation metadata, or<GITHUB_LANGY_HOST>when one is set. Workers needgithub.com,api.github.com, andcodeload.github.comto clone and push, which requires outbound egress to be enabled. See Networking and egress.