Always-On Agent Architecture: Multi-Task Scheduling and Reliability in Practice
This article explains how to move AI agents from single-shot conversations to continuously running systems. It covers task definition and context boundaries, a two-layer architecture that separates scheduling from execution, event-driven wakeup, asynchronous multi-channel interaction, separation of state from compute, external watchdogs, consistency and resource conflicts under parallelism, performance evaluation pitfalls, and a phased rollout path—helping readers build reliable, recoverable multi-task agent systems.
1. From Single Conversations to Continuously Running Systems
Once an agent can decompose tasks, call tools, and check results on its own, the system bottleneck is no longer just “can the model complete this step.” For users who need to handle document organization, code changes, business queries, and result notifications at the same time, a more practical question emerges: must they constantly switch sessions, restate context, and manually confirm whether each task has stalled?
Traditional conversational architectures organize input, reasoning, tool execution, and replies into a relatively serial pipeline. This design works well for tasks with clear goals and short durations, but it is not inherently suited to long-running work and parallel tasks.
For example, one task may be waiting for external approval while another has just received new data. If all work shares a single execution chain, the waiting action can block subsequent processing. If all information is placed in one shared context, goal confusion, context bloat, and cross-task interference become likely.
Therefore, an always-on agent should not be understood as “one model call that never ends,” but as a system that manages the lifecycles of multiple tasks. The model handles understanding and decision-making; the runtime system handles state persistence, work scheduling, event delivery, and failure recovery.
2. Define the Task Before Discussing Parallelism
The foundation of a multi-task system is not adding more execution units, but clearly defining what counts as an independent task.
A manageable task should carry at least the following information:
- Goal and acceptance criteria: what output is required, and under what conditions it can be considered complete.
- Task identity: used to associate events, execution records, results, and audit information.
- Current state: such as pending, running, waiting for external input, succeeded, failed, or canceled.
- Dependencies: whether it must wait for other tasks or an external condition.
- Permission boundaries: which information it may read, which resources it may modify, and which actions it may perform.
- Budget constraints: allowed execution time, model-call quota, and retry counts.
Tasks should also have clear context boundaries. User preferences can be shared, but temporary assumptions, sensitive materials, and intermediate conclusions from one task should not automatically propagate to others.
So-called “cross-session continuity” is essentially authorized state reuse, not endlessly concatenating all historical messages. Only when task identity, state, and permissions can be managed independently does parallel scheduling become controllable.
3. Two-Layer Architecture: Separate Scheduling from Execution
3.1 The Control Layer Decides When to Act and Who Acts
The control layer receives user requests and system events, determines whether they belong to an existing task or a new one, and decides whether to execute immediately, wait for dependencies, merge processing, or request human confirmation.
It is closer to a scheduling system than to an “omniscient model” that does everything. Common responsibilities include:
- Maintaining task states and priorities;
- Determining inter-task dependencies and resource conflicts;
- Allocating execution budgets and concurrency quotas;
- Aggregating阶段性 (stage-level) progress summaries;
- Triggering approvals for high-risk actions.
For events that can be handled by explicit rules, there is no need to call the model every time. For example, if a task has subscribed to a specific approval event, the arrival of that event can directly wake the task—no open-ended semantic judgment is required to decide where it goes.
3.2 The Execution Layer Advances Concrete Work
The execution layer handles intra-task analysis, tool calls, and result verification. Different execution units should have independent working contexts as much as possible and exchange structured results with the control layer.
The core value of this layering is avoiding a single global session that simultaneously handles intent understanding, resource scheduling, and all detailed execution. The control layer only needs task summaries and scheduling information; the execution layer loads working materials on demand.
However, layering alone does not automatically improve performance. If the control layer is involved in every small action, it can become a new serial bottleneck. A sensible boundary is: the control layer manages task lifecycles, while the execution layer autonomously advances local steps within its authorization.
4. Event-Driven Design: Let Waiting Release Execution Resources
A continuously running service should not rely on the model repeatedly checking “is there anything new.” A better approach is to represent external changes as events.
Event sources can include follow-up user requests, tool results, file updates, timer expirations, completed approvals, and task exceptions. After entering the system, events go through authentication, deduplication, and routing, then trigger the corresponding state transitions.
A typical flow looks like this:
External event → ingress validation → persistent record → subscription matching → state check → scheduled execution → result archival and notification
Subscription mechanisms reduce unnecessary central decision-making. For example, when a task is waiting for a document upload, it can register the corresponding condition; once the document arrives, the system resumes the task directly instead of asking the model again who should handle this message.
Two engineering issues deserve attention here.
First, events may be delivered more than once. The system should deduplicate using event identifiers, business-level uniqueness constraints, or operation records, to prevent the same event from triggering repeated side effects.
Second, events may arrive out of order. A message produced earlier is not necessarily consumed earlier, so processing logic must check the current task state and version rather than blindly overwriting results in receive order.
5. Asynchronous Multi-Channel Interaction: Tasks Are Not Bound to One Window
A user might submit a task through an instant messaging entry point, add materials via a web page, and receive a completion reminder through a notification channel. Different entry points should be interaction channels, not separate task worlds.
To achieve this, three kinds of identity must be distinguished:
- User identity: determines who can initiate, view, or approve operations.
- Task identity: determines which ongoing piece of work information belongs to.
- Channel identity: determines where input comes from and where results are delivered.
Once a task has been reliably accepted, it should not be automatically lost just because a client disconnects. But “continuously running” does not mean ignoring cancellation requests, expired authorizations, or business deadlines.
Notification design matters as well. If the agent pushes every thought and every tool call to the user, automation increases but the human attention burden may not decrease. A more reasonable approach is to tier notifications by importance:
Log routine steps to the execution log; batch stage-level progress into consolidated notifications; explicitly request input for blockers; require separate approval for high-risk actions; and provide acceptance evidence with final results.
6. Separating State from Compute: Make Execution Processes Replaceable
For long-running tasks, critical state must not live only in the memory of one execution process. Processes restart, machines fail, and execution resources get reclaimed.
Separating state from compute in an agent system means persisting task state, necessary context, and results, so execution units can be started, paused, and replaced on demand. Resuming a task should continue from persisted state rather than depend on the original process still being alive.
It is advisable to store the following separately:
Task state records: the current stage, dependency conditions, state version, and budget consumption.
Event and execution logs: what happened and which actions have completed, for auditing and failure analysis.
Working materials and artifacts: original documents, intermediate files, and final results—avoid repeatedly placing bulky content into the model context.
Reconstructible context summaries: the current goal, confirmed facts, open questions, and the next-step plan, to help resume execution.
Summaries should not be the sole source of truth. They can omit details, so they should retain references to the original materials and execution records.
Also, strictly distinguish cache from persistent storage: caches serve performance and can be evicted; task state serves correctness and must not be lost due to cache eviction.
7. External Watchdogs: Check Progress, Not Just Liveness
Letting an agent decide for itself whether it needs recovery has an obvious limitation: if the execution process is stuck, the self-check logic may not run either. The watchdog should therefore be deployed outside the monitored execution flow.
It typically watches three levels:
- Process health: whether the execution unit is still running and heartbeats are normal.
- Task progress: whether there has been no state change for a long time, or the same action keeps repeating.
- Business outcomes: whether key artifacts were produced and external operations actually succeeded.
A healthy heartbeat does not mean a healthy task. An execution unit may keep emitting logs while repeating a failing tool call. The watchdog should therefore combine timeouts, retry counts, step progress, and result verification in its judgments.
Recovery strategies should be layered: first check whether the task is merely waiting on an external condition, then consider retrying the current step, replacing the execution unit, or escalating to a human. For side-effecting actions—sending notifications, submitting approvals, modifying business records—the outcome must be verified before recovery; blind replay is not acceptable.
8. The Core Challenges of Parallel Execution: Consistency and Resource Conflicts
Running tasks in parallel does not mean all tasks can modify the same resource at the same time.
For example, one task updates a configuration while another generates results based on the old configuration. Without version checks, both tasks may succeed individually while their combined results contradict each other.
Common control mechanisms include:
- Using mutual exclusion or leases for shared resources;
- Conditional updates with version numbers to prevent stale results from overwriting newer state;
- Parallelizing independent computations while serializing writes to shared resources;
- Designing compensation flows for failures that span multiple steps;
- Adding approval and outcome verification for irreversible operations.
In systems where messages may be delivered repeatedly, design as if “an action may execute again.” Idempotency keys, uniqueness constraints, execution ledgers, and result queries matter more than relying on retry counts alone.
Permissions should also be isolated per task. Write access granted to one task should not automatically extend to other tasks under the same user, and instructions read from external materials must not be directly promoted to system authorization.
9. Performance Evaluation: Completion Time Alone Is Not Enough
The benefits of this architecture should be evaluated jointly across completion latency, reliability, resource consumption, and human effort.
A preliminary experiment in the reference material reported that half of the tasks completed within 12.4 minutes and 95% within 15.7 minutes. Removing the subscription-based direct routing increased routing decisions by about 30%, and cached token reads grew from roughly 23.23 million to 31.77 million. With batching, the amortized inference time per decision dropped from 6.4 seconds to 1.6 seconds.
These numbers help explain the mechanisms, but they should not be treated as performance guarantees for real workloads. The experiments were based on synthetic loads and a simplified environment, with insufficient information to judge whether the results generalize to other task scales, model configurations, and tool latencies.
Three distinctions are especially important:
Batching lowers amortized cost, but does not make every request faster. Waiting to fill a batch can increase response time under low load.
Subscription-based direct routing reduces repeated scheduling, but does not bypass permission checks. Direct wakeups must still be constrained by state, authorization, and budgets.
Concurrency shortens overall elapsed time, but does not reduce total cost. Multiple execution units loading contexts simultaneously can increase token consumption and storage access.
Evaluation should therefore record median and high-percentile completion latency, success rate, the number of duplicated side effects, recovery time, per-task cost, and the number of times each task requires user intervention.
10. Start with a Small Closed Loop
Always-on agents should not aim for full autonomy from day one. A safer path is to build verifiable closed loops in stages.
Stage one: establish the task state machine, persistent records, and human acceptance mechanisms, so the system can reliably answer “where is this task right now.”
Stage two: introduce independent execution units and event subscriptions so waiting tasks release resources, and verify failure recovery through checkpoints.
Stage three: enable parallelism in low-risk, reversible tasks, gradually adding resource locks, version control, idempotent processing, and compensation logic.
Stage four: optimize batching, caching, and context loading based on real workloads, while establishing budget limits, anomaly circuit breakers, and audit mechanisms.
Each stage should include failure drills covering duplicate messages, execution timeouts, process exits, unavailable dependencies, and user cancellations. Completing tasks on the happy path only proves the features work; keeping state explainable, operations traceable, and results recoverable on failure paths is what demonstrates the architecture is ready for continuous operation.
Conclusion
The key breakthrough of always-on agents is not making the model generate nonstop, but keeping clear task boundaries through waiting, parallelism, failures, and cross-channel interaction.
The two-layer architecture separates scheduling from execution; event-driven design eliminates wasteful waiting; asynchronous interaction reduces the user’s follow-up cost; separating state from compute enables execution replacement; and external watchdogs provide independent recovery. But these mechanisms must land together with permission control, idempotent design, state consistency, and cost governance.
Whether the architecture works ultimately comes down to three questions: are users interrupted less, is the system easier to recover, and are task results easier to verify. Only when all three improve does a multi-task agent truly evolve from a one-shot assistant into a reliable continuous service.
