Open SWE

LangChain's open-source framework for internal coding agents — the reference implementation for the async GitHub issue → sandbox → PR workflow.

Overview

Open SWE is the open-source version of the internal coding agents built at Stripe, Ramp, and Coinbase. Built on LangGraph and Deep Agents, it provides the architecture those companies built internally: cloud sandboxes, Slack and Linear invocation, subagent orchestration, and automatic PR creation — ready to customize for your own codebase and workflows.

AttributeValue
Language / StackPython (75%) + TypeScript (25%)
GitHubgithub.com/langchain-ai/open-swe
LicenseMIT
Built OnLangGraph + Deep Agents
MaturityProduction patterns

Architecture

Open SWE makes six core architectural decisions that define the state of the art for internal coding agents:

1. Agent Harness

Rather than forking an existing agent, Open SWE composes on the Deep Agents framework. This gives you an upgrade path (pull in upstream improvements) while letting you customize orchestration, tools, and middleware.

2. Sandbox

Every task runs in its own isolated cloud sandbox — a remote Linux environment with full shell access. The repo is cloned in, the agent gets full permissions, and the blast radius is fully contained. Supports Modal, Daytona, Runloop, LangSmith, and custom providers.

3. Tools

Stripe's key insight: tool curation matters more than tool quantity. Open SWE follows this with ~15 focused tools: execute, fetch_url, http_request, linear_comment, slack_thread_reply, plus Deep Agents' built-in file operations and task spawning.

4. Context

Two sources: AGENTS.md (repo-level conventions) and source context (full Linear issue or Slack thread history). The agent starts with rich context rather than discovering everything through tool calls.

5. Orchestration

Subagents: The task tool spawns child agents for parallel subtasks. Middleware: Deterministic hooks run around the agent loop for message injection, error handling, and circuit breaking.

6. Invocation

Slack (mention in thread), Linear (comment @openswe), and GitHub (tag in PR comments). Each invocation creates a deterministic thread ID for follow-up routing.

Comparison to Production Systems

DecisionOpen SWEStripeRampCoinbase
HarnessComposed (Deep Agents)Forked (Goose)Composed (OpenCode)Built from scratch
SandboxPluggable (Modal/Daytona/Runloop)AWS EC2 devboxesModal containersIn-house
Tools~15 curated~500 curatedOpenCode SDKMCPs + Skills
ContextAGENTS.md + issue/threadRule filesOpenCode built-inLinear-first + MCPs
OrchestrationSubagents + middlewareBlueprintsSessionsThree modes
InvocationSlack/Linear/GitHubSlack + buttonsSlack + webSlack-native

Relevance to xCoder

Open SWE is our primary reference architecture. We are not forking it (it's Python) but we are porting its patterns to TypeScript:

  • LangGraph TS — Already used in packages/flow-engine/; same state machine concepts.
  • Middleware hooks — Ported to TypeScript with xCoder-specific additions (PhaseGate, PolicyGate).
  • Pluggable sandbox — Our container providers (Local/Docker/E2B) mirror Open SWE's sandbox abstraction.
  • AGENTS.md — First-class support, extended for monorepos with multiple AGENTS.md files.
  • Subagents — Planned for xCoder M2.0 via LangGraph subgraphs.

xCoder's advantage

Where Open SWE has no phase machine (single-loop agent), xCoder adds the FlowEngine with explicit phases (scope → issue → branch → spec → implement → test → commit → qa → pr → review → merge). This gives us deterministic progress tracking, phase-specific policies, and granular cost attribution.