chrisbanes / chrisbanes/ensemble

Session resume for retry continuity

Open
#95 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement ready-for-human
Dominant language
Rust
Stars
11
Forks
0
Avg merge
23h 12m
Merged PRs (30d)
84

Description

Problem

Ensemble creates a fresh ACP session per run. When a step fails and needs retry, the agent loses all context from the previous attempt. This wastes tokens and may cause the agent to repeat work.

Paseo supports loadSession and resumeSession for session persistence across restarts. The ACP protocol provides session/load and session/resume methods.

Solution

Implement session resume:

  1. Store session ID and persistence handle after session creation
  2. On retry, check if agent supports session resume
  3. If supported, use session/load or session/resume instead of session/new
  4. Replay conversation history to maintain context

Implementation

#91 is complete, so this can build on the SDK-backed ACP path.

Add to acp_client.rs:

pub struct SessionPersistenceHandle {
    pub session_id: String,
    pub provider: String,
    pub metadata: HashMap<String, String>,
}

pub async fn run_acp_session_with_resume(
    command: &str,
    workspace_path: &Path,
    prompts: Vec<String>,
    resume_handle: Option<SessionPersistenceHandle>,
    // ... other params
) -> Result<SessionResult, AgentError> {
    // If resume_handle is Some, use session/load instead of session/new
}

Acceptance Criteria

  • Session persistence handle defined
  • Session handle stored after session creation
  • Resume logic uses session/load when handle is available
  • Conversation history replayed on resume
  • Tests verify session resume works with mock agent
  • Config option to enable/disable session resume per agent

Effort

Large

Prerequisites

  • #91 completed

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with acp_client.rs and the SDK-backed ACP path from #91, then review how session creation currently stores its results and how mock-agent tests are structured. Trace the session/load and session/resume protocol methods, and verify that the completed work covers persistence handles, conversation replay, retry behavior, and the per-agent configuration option.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.