Back to blog
EngineeringDate unavailable· min read

One Path for All Agent Responses

We unified streaming and non-streaming agent responses to flow through the same post-task dispatch logic, eliminating architectural drift and simplifying maintenance.

We shipped a fix this week that you won't see in the UI but matters a lot under the hood. The streaming agent entrypoint—the path that handles real-time token-by-token responses—now routes through the same post-response dispatch logic as the standard agent path.

The Problem

When we added streaming support, we took a shortcut. The streaming path had its own dispatch logic—separate from the batch path. Both did roughly the same things after an agent finished a task: write to memory, update Linear issues, trigger callbacks. But they did it differently.

That kind of duplication is dangerous. When you fix a bug in one path, you have to remember to fix it in the other. When you add a feature to one, you have to port it to the other. Eventually, they drift. One path gets smarter. The other doesn't. Users notice.

The Fix

We refactored the streaming entrypoint to route through the shared post-response dispatch function. Now there's one canonical path for all post-task behavior, regardless of streaming mode. Memory writes happen consistently. Linear callbacks fire reliably. State updates are atomic.

The commit included new parity tests that enforce this architectural constraint. If someone tries to add streaming-specific dispatch logic in the future, the tests will fail. The system now has an opinion about how dispatch should work, and it enforces that opinion automatically.

Why It Matters

This is the kind of work that pays dividends over months, not days. Every feature we add to the post-response pipeline—better memory compression, smarter Linear state transitions, richer telemetry—now applies to both streaming and batch modes automatically. No porting required. No drift possible.

It also makes the system easier to reason about. When you look at the code, there's one place to understand post-task behavior. Not two. Not three. One. That makes debugging faster. Onboarding simpler. Code review more focused.

What's Next

Now that dispatch is unified, we're looking at richer post-task hooks. Think automatic PR quality scoring, intelligent task chaining based on outcomes, and adaptive memory policies that learn from agent success patterns. All of that becomes easier to ship when there's one consistent place to plug it in.

This is infrastructure work. Unglamorous. Essential. The kind of thing that makes everything else possible.