[Feature] Task-level agent conversation continuity across terminal sessions and closed tasks
Problem
An agent conversation can finish while the related task remains the durable unit of work. A later comment on the same task may start a new agent conversation, including after the task is closed, but the new conversation cannot reliably recover the previous agent conclusion.
In a smoke test on a self-hosted Paca instance:
- A task comment with a structured agent mention started an agent conversation.
- The agent completed normally and produced a final answer in the conversation event history.
- That final answer was not automatically persisted as a task comment or task-level summary; the task activity stream contained only
agent.session.started. - After the task was moved to
Closed, another structured mention successfully started a new conversation without reopening the task. - The new conversation could read the task state and activities, but correctly reported that the previous conclusion was missing because it was only stored inside the old conversation.
This makes task-level continuity depend on every agent prompt explicitly instructing the agent to call add_task_comment before it finishes. If it does not, future agents and team members lose the conclusion even though the conversation still exists internally.
Expected behavior
The task should be the durable context boundary, while individual agent conversations remain execution sessions.
- A closed task should still allow comments and new agent conversations without being reopened automatically.
- When a task-linked agent conversation finishes, Paca should persist its final response or a structured handoff summary into task-level history.
- A later conversation on the same task should automatically receive the relevant prior agent conclusions, regardless of whether the previous conversation is terminal.
- Reopening the task should be a separate explicit business decision, not a side effect of continuing discussion.
Suggested design
- Store an explicit relationship between each agent conversation and its task.
- On successful completion, persist a durable task activity such as
agent.session.finishedcontaining the final-response reference and a human-readable summary/comment. - Build new task-triggered conversation context from task fields, comments, attachments and prior task-linked agent handoffs.
- Keep full transcripts available through conversation history, while using bounded summaries for normal context assembly.
- Make persistence idempotent so retries do not produce duplicate comments.
- Clearly mark agent-authored comments and link them back to the originating conversation.
Acceptance criteria
- After an agent finishes, its final conclusion is visible from the task without opening the old conversation.
- Mentioning the agent again on the same task starts a new session that can accurately summarize the previous conclusion.
- The behavior works after the previous conversation is terminal and after the task is closed.
- Continuing discussion does not change the task status unless the agent explicitly invokes an authorized status transition.
- Failed/cancelled sessions have a distinct activity and do not publish an incomplete answer as a successful conclusion.
- Retried completion events do not create duplicate task comments.
Related issue
This is related to, but broader than, #316. That issue addressed replying in terminal conversations and closing the floating chat. This request concerns durable task-level context and handoff across separate conversations, including task-comment-triggered sessions and closed tasks.
Hi @s7952452 Thanks a lot for the detailed feedback and suggestions! Due to isolated environments between agent sessions, maintaining direct seamless context is currently quite tricky However, your idea of storing and handing off a conversation summary across sessions makes total sense, we’ll be taking this approach as our future direction for this feature.
Thanks for confirming the summary-handoff direction. I run a self-hosted Paca instance and can reproduce and validate this workflow end to end.
I noticed this issue is currently assigned to @pikann. Has implementation already started?
If not, would you be open to assigning it to me so I can take it? If work is already underway, I would also be happy to help with a bounded part, integration tests, or real-world validation.
My initial implementation boundary would be:
- persist an idempotent task-level handoff after a task-linked agent conversation completes successfully;
- keep successful, failed, and cancelled terminal events distinct;
- provide bounded prior handoffs to later conversations on the same task;
- never reopen or change the task status merely because a new conversation starts;
- cover retries, closed tasks, failed sessions, and next-session recovery with tests.
If this boundary matches your direction, I can first post a code-level implementation plan based on the current architecture before starting development.
Awesome! I've gone ahead and assigned the issue to you. Thanks a lot for jumping in to help!
One important note: I'm currently working on a big agent update on master, transitioning from OpenHands to Goose to improve performance and slim down container sizes.
Your proposed boundary and plan sound great, feel free to drop the code-level implementation plan whenever you're ready!
