Moving a cloud coding agent to a Mac with consumer-driven contracts
Running a cloud coding agent on one Mac by building shims from its call sites, mirroring upstream unedited, and reviewing each change from the goal and diff alone.

Take a coding agent built for a cloud platform and try to run it on a single laptop, and you quickly see how much of the agent actually lives in hosted infrastructure: a remote runtime for sandboxes, a model gateway, a version store emulating git, and a service handling identity and storage. Forking that stack drags distributed machinery onto a local machine where none belongs, while rewriting the agent discards what it already does and cuts it off from active development. A hard clean-room rule closed the middle path too: nothing from the services another team owns could be copied, installed, or even read as a reference.
Under those constraints, a consumer-driven contract is the architecture: when you cannot inspect the provider, the caller’s code is the specification, and you build and verify against that contract rather than the implementation behind it. In November 2026 I used that model to bring the coding agent I built on my company’s cloud platform, roughly 320,000 lines of TypeScript, down to one Mac for local development. A single Bun daemon runs each agent in its own OS process under a macOS Seatbelt sandbox profile, operates on real git checkouts in ordinary folders, serves the platform’s web client in Electron over a Unix socket, and is designed to route inference through Sign in with ChatGPT on the user’s own plan.
Building local shims from call sites
Because the hosted services’ client packages could not even be installed to typecheck against, the port began with type-only contract packages declaring the exact symbols and signatures the agent imports. Only once the agent compiled against those declarations did local implementations go in behind them. Each replacement answers only the names and shapes the calling code uses, paired with an index mapping every exported symbol to the call sites that require it, so dead names surface as soon as callers stop referencing them.
Scoping replacements to observed call sites keeps the local layer small and auditable. Across the port, the replacements total tens of thousands of lines; by comparison, the hosted runtime client alone was 52,000 lines, most of it plumbing to survive a network boundary that disappears on one machine. Moving off the network does not remove the need for isolation, so each agent stays in its own process under its own Seatbelt profile, preventing blocking work or a crash in one session from taking down the interface or another agent.
With the surface constrained to actual callers, going from architecture documents to a signed, packaged desktop app took about seven hours. In end-to-end scenarios on the local runtime, the agent edited files, ran a test and a background job, was killed mid-turn, and resumed with the interrupted call reported, while the unmodified web client ran against the local daemon and passed its checks in headless Chrome.
Keeping upstream unedited above local shims
Forking a fast-moving codebase and patching it locally is the quickest way to get a prototype running, right until upstream keeps shipping. In nine days, upstream moved roughly 2,200 commits against about 500 locally edited files, making ongoing merges unworkable. The fix is to stop editing the fork altogether: the upstream source is mirrored at a recorded commit, hash-verified, and never modified locally. Any change the agent needs, including macOS fixes, goes upstream and returns on the next sync, while owned shims underneath satisfy whatever upstream calls.
Once nothing in the build, typecheck, or test suite depends on a locally edited copy, it is deleted with no fallback. “Eradicate all of it” was my instruction for the cutover, because legacy fallbacks during a migration only leave stale paths that mask gaps in the shim layer.
Reviewing from the goal and diff alone
Handing a reviewer the author’s reasoning feels helpful, because shared context normally speeds up a review. In practice, that narrative anchors the reviewer to the same assumptions, so the review ends up validating the explanation instead of testing the code. To keep verification tied to the contract, every change is split into units under roughly 1,500 changed lines and sent to a fresh reviewer agent that never sees the implementer’s conversation. It receives only the unit’s goal and acceptance checks, the diff, and read access to the repository to inspect callers and run the tests. Each round starts another fresh reviewer, so prior reasoning never carries forward.
Without an author’s framing, reviewers probe the boundary directly. In one review of the commit-landing path, a reviewer tested the gate by getting a change approved, amending the commit afterwards, and submitting the altered commit under the prior approval; the landing code pushed the unreviewed change anyway, and the check was fixed before the unit passed.
Whenever a review caught a defect that a deterministic check could detect, it became a lint rule or verification script rather than something left for the next reviewer to rediscover. That practice produced 185 rules and checks.
Chris Chabot, November 2026