Skip to main content
Langy runs on opencode as a separate service, langyagent, next to the LangWatch app. The app dispatches each chat turn to it; langyagent keeps one opencode process per conversation and reaps it when the conversation goes idle. The worker does the actual reading, testing, and code editing. Every tool call it makes streams back into the chat as a typed activity, and every turn is a traced run in your project.

The architecture

The agent service is cluster-internal only, never exposed outside; auth and networking details are on the self-hosting overview. The worker has exactly three ways out:
  • The langwatch CLI for your LangWatch data: trace search, analytics query, scenario create, experiment run. No MCP server, no internal API.
  • The LangWatch AI Gateway for every model call, never a provider directly, so each call is traced, rate-limited, and policy-checked on your own keys or Codex. See Models and Codex.
  • The GitHub App for code changes, only as pull requests. See Pull requests.

The session loop

1

You ask

You send a turn in plain language. The control plane admits it and dispatches it to the manager, which spawns (or reuses a warm) worker for that conversation with the turn’s credentials bound at spawn.
2

Langy reads the traces and evals

The worker runs langwatch CLI commands to pull the traces, analytics, and evals your question points at. Each command streams back into the conversation as an activity card, so you see what it searched.
3

It writes a failing Scenario test or evaluation

When the answer is a code change, Langy writes a Scenario multi-turn simulation or an evaluation that captures the problem, so the fix has something to prove against.
4

It drafts a fix and opens a pull request

Langy clones the installed repo inside the worker, drafts the change, and opens a bot-authored pull request. The clone lives only in the worker’s home and is wiped when the worker is reaped.
5

Your CI runs the tests it wrote

The Scenario tests Langy wrote run in your CI on that PR. The PR card returns with the result, so the receipts are the diff plus the check status.
6

A human reviews and merges

You read the PR and merge it. Langy never merges its own PR.
Every turn Langy takes re-enters LangWatch as its own traced, costed run in your project. You debug Langy with the same traces and evals you use to debug your own agents.
For how the sandbox isolates each worker and exactly what it can and cannot reach on the network, see Security and the sandbox. For running this stack yourself, see the self-hosting overview.