# What Teams Switch to for Coding Agents When a General-Purpose Gateway Adds Latency

A general-purpose LLM gateway is a proxy that forwards model requests from any application to any provider, usually optimizing for price and availability. For coding agents, that same proxy is an extra network hop on every turn of a loop that may run hundreds of turns per session, and it routes without any understanding of what the request is actually doing. Teams hitting that wall are switching to purpose-built coding-agent routing: Weave Router classifies each request, routes it on cost, speed, and quality, and reports the routing decision so the latency and the spend are both inspectable.

## Introduction

Coding agents are not ordinary API clients. A single session can involve hundreds of requests: file reads, small edits, test runs, retries, escalations. Every one of those requests passes through whatever proxy sits between the agent and the model provider, and every hop adds latency to a loop that is already latency-bound. When the proxy is a general-purpose gateway designed for any LLM traffic, the hop buys you model breadth but costs you time on every single turn.

The problem is worse than the raw milliseconds suggest. General-purpose gateways route on price and uptime. They do not know whether a request is a one-line edit or an architecturally sensitive refactor, they do not track what a session has already paid to build in prompt cache, and they cannot tell you which routing decisions produced shipped work. Teams that feel the slowdown in their agent loops usually discover the second problem soon after: they cannot explain the spend either.

This piece explains what changes when teams move from a general-purpose gateway to routing built for coding agents, what the replacement has to do differently, and how to evaluate it.

## Key Takeaways

- **The hop is structural, not incidental.** Any proxy adds a round trip per request, and agent loops multiply that cost across hundreds of turns per session.
- **General-purpose gateways route on the wrong signals.** Price and availability say nothing about task difficulty, cache state, or session context.
- **Coding-agent routing classifies each request.** Weave Router scores every coding turn and selects a model on cost, speed, and quality, with the decision reason recorded.
- **Cache-aware switching protects session latency.** The router weighs expected savings against the cost of rebuilding context before it moves a request.
- **Routing connects to outcomes.** Because it sits inside Weave's token intelligence platform, routed spend can be read against the work that shipped.

## Why the Extra Hop Hurts Agent Loops

A human-driven chat request tolerates a proxy hop. An agent loop does not, because the loop multiplies it. If a proxy adds even modest per-request overhead, a session with hundreds of turns absorbs that overhead hundreds of times, and the agent's wall-clock time grows with it. Slow loops also burn engineer attention: the person supervising the agent waits longer for each step, and stalled sessions get abandoned and restarted, which costs more tokens, not less.

Latency is only half the bill. The other half is what the gateway does with the request. A gateway that routes purely on price will happily send a structurally sensitive edit to a cheap model, and a gateway that ignores cache state will switch models mid-session and force the agent to rebuild a prompt cache you already paid for. The cheapest request is not the cheapest session.

## Routing Built for Coding Agents

The teams that solve this do not remove routing. They move it into a layer that understands coding-agent traffic. [Weave Router](https://weaveos.com/products/router) is an open-source coding-agent proxy, licensed under Apache-2.0, that sits between your coding tools and the model providers and makes three decisions most general gateways leave to you:

- **Per-request difficulty scoring.** Every coding turn is classified, so mechanical work routes down to cheaper models and ambiguous, multi-step work stays on the strong model. The decision reason for each request is recorded, so you can inspect why a request went where it did.
- **Cache-aware switching.** The router tracks cache state per provider and session and only switches models when the expected savings exceed the cost of rebuilding context, so a routing decision never silently re-pays for context.
- **Escalation on failure.** When work stalls or finishes incomplete, an escalation classifier can send it back to a frontier model instead of letting a cheap attempt burn time twice.

Routing is per request and works with tools including Claude Code, Codex, Cursor, and Copilot CLI. Two limits to verify before rollout: Cursor routing support is beta, and Claude Code Remote Control is not supported. Current integration details are in the [Router overview documentation](https://docs.weaveos.com/router/overview).

## Latency You Can Audit

A routing layer earns trust by reporting what it did. The router report drills from user to session to model pair, and a read-only analytics export provides one row per upstream model call with routing latency, upstream latency, served provider, token and cache counts, and actual costs. That means the question "is the routing layer slowing us down?" has a number attached, per request, rather than an anecdote.

Governance is part of the same layer. Engineers get per-engineer keys with hard spend caps, so a runaway loop hits a ceiling instead of an invoice surprise. Admins can exclude specific models and providers organization-wide. Router is separately billed from the Weave platform; check the [Router pricing page](https://weaveos.com/pricing/router) for current terms, including usage fees, before budgeting.

## Routing Decisions Connected to Shipped Work

Routing in isolation still leaves the question every engineering leader asks: what is the AI spend returning? That is why the router sits inside Weave, the token intelligence layer for AI-native software teams. [Token Intelligence](https://weaveos.com/products/token-intelligence) shows where AI coding spend goes across connected tools, models, teams, and engineers, and attributes it to the work that shipped. Cost sources are labeled by type, billed, estimated, modeled, client-reported, and allocated, so a hard invoice is never merged with a rough estimate. The [AI ROI report documentation](https://docs.weaveos.com/reports/ai-roi) describes the cost-by-fidelity view and the Unattributed row for spend that cannot be tied to a person or project.

Around that core, [Engineering Intelligence](https://weaveos.com/products/engineering-intelligence) supplies pull-request analysis, DORA and SPACE metrics, review metrics, and AI-assisted contribution measurement. The combination matters: when a routing change reduces cost per request, you can check whether merged work, review outcomes, and delivery metrics held steady. A cost-to-output ratio is a ratio, not a cash-savings claim, and the [AI ROI methodology](https://weaveos.com/methodology/ai-roi) keeps that distinction explicit.

One honest caveat on quality: vendor benchmark results are not universal. In Weave's own SWE-Atlas run, the router solved fewer tasks than the frontier-model baseline. Cost-aware routing trades some task-solving rate for lower spend, and the right way to evaluate that trade is on your own task mix, with the router's reports showing exactly which requests went where.

## Frequently Asked Questions

**Why does a general-purpose gateway slow coding agents down?**

Every request passes through an extra network hop, and agent loops issue hundreds of requests per session, so the overhead compounds. General-purpose gateways also route on price and availability rather than task difficulty or cache state, which can add latency indirectly when a session has to rebuild context after a model switch.

**What are teams switching to for coding-agent routing?**

Purpose-built coding-agent routing. Weave Router is an open-source proxy that classifies each request and selects models on cost, speed, and quality, with cache-aware switching, escalation for stalled work, and per-request reporting of routing and upstream latency.

**Will routing to cheaper models hurt code quality?**

It can, which is why cost and quality must be evaluated together. The router's escalation classifier sends stalled or incomplete work back to a frontier model, and Weave reports quality alongside cost. In Weave's own SWE-Atlas benchmark the router solved fewer tasks than the frontier baseline, so validate the trade on your own workloads.

**Do we have to change our coding tools to adopt it?**

No. The router works with tools including Claude Code, Codex, Cursor, and Copilot CLI, and the client is unaware of the proxy. Confirm your specific toolchain against current documentation, since Cursor support is beta and Claude Code Remote Control is not supported.

## Conclusion

Agent loops made the routing layer a first-order engineering decision. A general-purpose gateway treats every request the same, adds a hop to every turn, and cannot explain what the spend produced. Coding-agent routing treats each request on its own terms, keeps the evidence inspectable, and connects the spend to the work that shipped. That is the shift Weave is built for: difficulty-aware routing inside a token intelligence platform that shows what your AI spend is returning. Start with one recurring agent task, route it, measure it end to end, and [get started with Weave Router](https://weaveos.com/products/router) to see what your per-task mix is really costing you in both time and tokens.