- Duale AI
- Documentation
- Agent harness
- Context continuity
Context continuity: continuations, recall, and retention
Explains how response.next() continuations inherit Task history, how Recall reads earlier Tasks of the same Agent Identity, and 30-day and 90-day retention limits.
This page explains how continuations build on earlier Task history, what Recall can reach, inheritance rules, and retention limits.
- Stored history versus active context and Recall capabilities.
- Choosing between a new Task, continuation, or separate Agent Identity.
- What a continuation Task inherits from its parent.
- History retention windows and continuation chain limits.
- Branching from a running Task with independent outcomes.
Summaries were generated by AI.
Use a continuation when you want a new instruction to build on work from an earlier Task. response.next() creates a new
Task with selected Task history and its own deadline, result, and Stop. You can continue a running Task or one
that completed, failed, or stopped. This page also explains what any Task can recall from earlier Tasks of the same
Agent Identity.
Stored history and active context are different
A Task records its Task history: its instructions, messages, Tool Calls, and Tool Results. For each model turn, long material can be selected or shortened, so retained history does not mean every earlier word appears in every answer. The full history stays available, and the model can use Recall to reread the original when it needs more detail. Retrieved Library, Web, or recalled content remains source material to assess, not authority to perform an action.
The SDK provides no method to list, read, export, or selectively delete Task history. Keep authoritative inputs and observed outcomes in your own system. The limits below describe what a continuation can use; the Privacy notice and the applicable agreement govern Tenant or account erasure.
What a Task can recall from earlier Tasks
Recall is a set of Built-in Tools. During a Task, the model can use them to:
- reread the Task’s own earlier work in full, including material that was shortened for later model turns;
- search and read the requests and final answers of earlier Tasks of the same Agent Identity.
Recall reaches the earlier Tasks of every application and person that used that Agent Identity, for a limited period after those Tasks ran. It is not a permanent archive, so a Task cannot rely on finding older work. Tasks of another Agent Identity are out of its reach.
The Agent Identity is the boundary for what Recall can reach. When Tasks must not see each other’s requests and final answers, for example Tasks for different end customers, run them under separate Agent Identities. Design your Libraries shows that layout.
A recalled request or final answer is text that the current Task did not write, and it can come from another person who used the same Agent Identity. Treat it like other retrieved content: the Threat model explains how to assess it. An image in recalled history reaches the model only while the Agent Identity can still read it, under the Grant rule.
Choose a new Task, a continuation, or another Agent Identity
- Application need
- A new objective with no inherited Task history
- Use
ask(). Recall can still find earlier Tasks of the same Agent Identity
- Application need
- A new instruction based on selected work from an earlier Task
- Use
response.next()
- Application need
- The earlier answer must be validated before you decide what to ask next
- Use
- Await
response.model(), then submit the next request
- Application need
- Tasks that must not see each other’s requests and final answers
- Use
- A separate Agent Identity for each
Work that contributes to one answer can stay within one Task. A continuation creates a separate outcome for the application. Continue a Task defines the SDK contract; Task execution explains what to observe.
What a continuation Task inherits
You choose the parent Task. When the continuation starts, Duale AI selects the parent’s most recent usable history. The continuation receives that Task history, including available Tool Results and images. It does not inherit the parent’s final answer text or work added beyond that point. When a parent ended before it produced usable work, the continuation starts from the parent’s original request.
A Tool Call that had no reply when the continuation started receives a reply saying that its status is unknown. The Task must check the operation’s state with a Tool before it relies on an outcome.
The to-do list follows the selected work. A Tool Call already included in that work can finish later and update the inherited list. Changes from later parent work or another continuation stay outside the branch, and a continuation’s own to-do changes leave the lists of its parent and siblings unchanged. Inherited images follow the Grant rule and the image limits.
When a continuation waits or fails
A continuation waits while a running parent has no usable history yet, or while the parent is not yet available. If
the parent is still unavailable and waiting longer cannot fit the time left to start the continuation, it fails with
PARENT_TASK_UNAVAILABLE. This can happen before your deadline. An unknown parent also returns
PARENT_TASK_UNAVAILABLE, which does not prove that its history expired. Check the parent ID, and submit a new
continuation later if the parent can become available.
How long history stays usable
- A Task can be continued for 30 days after its submission. A recognized parent past that limit returns
PARENT_TASK_NOT_FOUND. - History older than 30 days leaves the context. To-do changes also expire 30 days after the submission of the Task that made them. The first Task’s instruction is kept for 30 days, so restate lasting rules in a later continuation’s own message.
- A chain of continuations stays usable for at most 90 days from its first Task.
CONTINUATION_UNAVAILABLEmeans that the chain no longer holds the history it needs, for example after that limit. Start a new Task.
SDK errors gives the next action for each result.
Branch from a running Task
Keep the AgentResponse for each Task your application starts. When an end user wants a different direction from the
same work, call next() on that response. The parent and each continuation have independent outcomes, deadlines, and
Stop requests. Stopping one does not stop the others.
This excerpt uses an already connected sdk and your application’s show_stream function:
import asyncio
from dualeai import ask
parent = await ask("Summarize the supplier contract.", streaming=True, sdk=sdk)
branch = await parent.next("List only the termination clauses.")
await asyncio.gather(
show_stream("Summary", parent.stream()),
show_stream("Termination clauses", branch.stream()),
)
branch_result = await branch.model()The SDK sends the continuation after Duale AI accepts the parent’s request, without waiting for its outcome. Show the branch stream beside the parent stream, and obtain each result from its own response handle. The inheritance rules above define what the branch keeps and when it waits.
The caller needs agent:continue_task and agent:read_task on the parent, plus agent:read_task on the new Task
(Task actions).