Artificial intelligence news.
Straight from the original announcements.

Mastra makes Agent Controller generally available for long-running agent sessions

October 6, 2026Source: Mastra
Mastra makes Agent Controller generally available for long-running agent sessions
Image: Mastra

Mastra has made Agent Controller generally available, a runtime that hosts long-running agent sessions and lets users watch, interrupt and steer them. The company says it built the tool for its own coding agent, Mastra Code, and now relies on it daily, with over 1800 commits authored by Mastra Factory this month alone.

Key points
  • Mastra has made Agent Controller, its runtime for long-running agent sessions, generally available.
  • It was released in June as Harness and renamed AgentController.
  • Each Session now owns its own conversation state, event bus and run engine, so one host can run many conversations.
  • Mastra says memory in long-running Mastra Code processes fell from 2, 20 GB to 300, 750 MB.
  • Artifact and Frontleap are named as customers using it.

What Agent Controller does

According to Mastra, Agent Controller is the layer around the agent loop. A single interaction with an agent is simple: it takes a prompt and returns an answer. Agent Controller keeps that conversation open and lets developers observe it, interrupt it and steer it.

Each user gets a session with its own threads, mode, model, approvals, memory and subagents. Every client subscribed to that session sees the live state.

The product shipped in June under the name Harness. Mastra says it renamed it to AgentController because Mastra already provides tools, memory, storage and the runtime around an agent, which made the old name confusing. In the company's words, the new name better reflects what it does.

Mastra extracted the best parts of Mastra Code to create it, then adjusted it to build Mastra Factory on top. The two products use it differently. Mastra Code serves one developer in one long session, where the user plans, approves, builds and steers for hours or days. Mastra Factory runs many sessions at once: every work item on the board opens into its own agent session, with chat, tool activity and workspace files, and people or other agents can join to adjust scope or approve actions.

Improvements since June

Mastra says most changes came from running Mastra Factory, where the controller went from serving one developer to serving a team plus several agents.

Separate sessions per user. The first release let a few people share one conversation, but Factory needed one host running many separate conversations, each with its own state so users could not overwrite each other's work. Mastra moved conversation-specific state out of AgentController and into a Session. Each Session now owns its conversation state, event bus and run engine. Calling createSession() twice with the same resourceId returns the same session, so a user returns to their own work.

Faster history browsing. In Factory, opening a thread page meant creating a session, which started a workspace and a sandbox. Reading old messages could stall the page for a few seconds and used up a sandbox slot. Reads now go straight to storage through queryThreads(), queryThreadById() and queryThreadMessages(), and initStorage() sets up storage without provisioning a workspace.

Lower memory use. Every small streamed update had triggered a full display-state snapshot, including the full message and every finished tool call with its arguments and result. Clients that kept event history could run out of memory. Mastra now groups frequent snapshots while keeping ordering and final state, and sends the initial message once followed by deltas. According to the company, memory usage in long-running Mastra Code processes dropped from 2, 20 GB to 300, 750 MB.

Customers and when to use it

Mastra cites two customers. Artifact builds tools for hardware engineers. Co-Founder Corbin Klett said: "For Artifact, Agent Controller is the harness of harnesses." He added that hardware engineers use it to design wire harnesses on aircraft, spacecraft and nuclear power systems.

Frontleap uses it behind an AI order management assistant that helps sales reps and in-store advisors turn a customer's project into a complete, correct order in SAP. Co-founder and CTO Thomas Laberge said Agent Controller handles persistent sessions, streaming, background sub-agents that report back, and visibility into token usage and cost per session. He said the company would otherwise have had to build and maintain that layer itself.

Mastra recommends AgentController when an agent is:

  • long-running or autonomous
  • a colleague you have long conversations with
  • sent off to work on a task for more than a few minutes
  • writing and executing a lot of code, especially in a loop
  • shared by several people or clients at the same time

For full control over a single request and response, Mastra points developers to the Agent class.

How it fits with the rest of the harness

AgentController hosts the session, and other harness capabilities support it. Signals let people and other agents steer a session while it runs. Schedules wake the agent on a timer. Goals keep it working until the job is done. Channels forward incoming messages to the session.

For teams building agent apps on Mastra, the release offers a hosted session layer for persistent, shared and observable agent work, with documentation available in the AgentController docs.

MastraAgent ControllerMastra CodeMastra FactoryAI agentscoding

Related news

Mastra launches program to build custom AI agent harnesses with companies
Products and toolsNovember 5, 2026

Mastra launches program to build custom AI agent harnesses with companies

Mastra has launched a Custom Harness Program that pairs forward-deployed engineers with company teams to build AI agent systems tailored to their goals, workflows and…

Mastra Adds TTFC and TTFT Metrics to Agent Observability
Products and toolsNovember 5, 2026

Mastra Adds TTFC and TTFT Metrics to Agent Observability

Mastra has added latency metrics for every agent and model call in its platform and Studio, allowing developers to track how long users wait for a response and how…

Mastra gives agents shared, editable knowledge stores
Products and toolsNovember 4, 2026

Mastra gives agents shared, editable knowledge stores

Mastra has introduced Knowledge, a shared store for documents, policies and decisions that lets its agents search, read and update information across defined access…