Active session intercept
Active session intercept is the agent runtime pattern where, when a user starts a new conversation while another is still in flight, the agent decides whether to cancel the in-flight one, queue the new one, or treat them as parallel. Prevents conflicting parallel agent sessions.
Why it matters
A user can text the agent on SMS, then call on voice, then send a WhatsApp message, all within 30 seconds. From the user's perspective these are three independent requests. From the agent's perspective they are three concurrent sessions on the same identity, potentially using the same tools.
Without active-session intercept, the failure modes are:
- Race conditions on shared tools. Two sessions both try to send an email; they overwrite each other's draft, or both send.
- Stale context. The voice session does not know what the SMS session is currently negotiating; the agent gives contradictory answers.
- Resource exhaustion. The user's agent runs three concurrent LLM streams instead of one; cost spikes and latency degrades.
The intercept pattern handles this by detecting concurrent activity and making a sensible call:
- Same intent on a different channel. Probably the user moved channels mid-conversation. Continue on the new channel; close the old.
- Different intent. Treat as separate sessions, with a shared memory layer.
- Long-running session interrupted. Pause the long-running one and pick up after the new one resolves.
The decision logic is heuristic; the goal is to do what the user almost certainly meant.
How Ajeris handles this
Ajeris's agent loop implements active-session intercept. When a new message arrives during an in-flight session, the agent evaluates whether the user moved channels (close old, continue on new), started a parallel intent (new session, shared memory), or interrupted a long-running task (pause, handle, resume).
For tools that mutate state (sending email, paying invoices, posting publicly), the agent enforces a serialization barrier: only one in-flight tool call per tool per user at a time. The other waits.