Skip to content

feat(acp): support persistent session loading - #5365

Merged
Johannes du Plessis (johannes117) merged 4 commits into
mainfrom
johannes117/acp/session-load-persistence
Aug 11, 2026
Merged

feat(acp): support persistent session loading#5365
Johannes du Plessis (johannes117) merged 4 commits into
mainfrom
johannes117/acp/session-load-persistence

Conversation

@johannes117

@johannes117 Johannes du Plessis (johannes117) commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

ACP agents can now opt into durable session/load, restoring session configuration and replaying complete conversation history after process restarts.


AgentServerACP previously exposed only in-process threads. This adds an explicit load_sessions capability backed by the graph checkpointer, persists ACP ownership, cwd, mode, and model metadata, and returns protocol errors for unknown sessions or mismatched working directories.

Replay is reconstructed across checkpoint history so messages removed from the latest state by compaction are still included, as required by ACP v1. Tool calls and multimodal message content are converted back into their ACP session-update forms. The feature remains opt-in so existing adapters retain their current behavior.

The follow-up dcode integration is stacked separately because deepagents-acp and deepagents-code are independently released.

Test plan
  • PYTHONPATH=libs/acp:libs/deepagents libs/code/.venv/bin/python -m pytest -q libs/acp/tests
  • ACP Ruff format and lint checks
  • SQLite close/reopen exercise, including messages removed from current state by compaction

Made by Open SWE

@open-swe open-swe Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open SWE Review found 3 potential issues.

Open in WebView Open SWE trace

Comment thread libs/acp/deepagents_acp/server.py Outdated
Comment thread libs/acp/README.md Outdated
Comment thread libs/acp/deepagents_acp/server.py Outdated

@open-swe open-swe Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open SWE Review found 1 potential issue.

Open in WebView Open SWE trace

Comment thread libs/acp/deepagents_acp/server.py Outdated
@github-actions github-actions Bot added acp Agent Client Protocol feature New feature/enhancement or request for one internal User is a member of the `langchain-ai` GitHub organization size: L 500-999 LOC labels Aug 6, 2026
@johannes117
Johannes du Plessis (johannes117) force-pushed the johannes117/acp/session-load-persistence branch 2 times, most recently from 6c617be to 65505fd Compare August 7, 2026 16:59
Drop defensive branches the message and tool-call types already preclude,
validate a load request before mutating session state, and fold the repeated
server/client setup in the new tests into shared helpers.
Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
@johannes117
Johannes du Plessis (johannes117) force-pushed the johannes117/acp/session-load-persistence branch from 65505fd to b6252f1 Compare August 11, 2026 21:48
@johannes117
Johannes du Plessis (johannes117) merged commit aaefb1e into main Aug 11, 2026
53 checks passed
@johannes117
Johannes du Plessis (johannes117) deleted the johannes117/acp/session-load-persistence branch August 11, 2026 21:53
Johannes du Plessis (johannes117) added a commit that referenced this pull request Aug 11, 2026
Depends on #5365

`dcode --acp` sessions now survive process restarts and can switch among
discovered models without losing checkpointed context.

---

ACP mode now keeps dcode’s SQLite checkpointer open, builds each session
for its cwd and selected model, and advertises the installed model
catalog through `session/set_config_option`.

<details>
<summary>Test plan</summary>

- `PYTHONPATH=../acp:../deepagents:. .venv/bin/python -m pytest -q
tests/unit_tests/test_main_acp_mode.py`
- Ruff and `ty` checks for the changed files

</details>

Made by [Open
SWE](https://openswe.vercel.app/agents/019fdd2c-6961-769a-95e8-e808b66d23d4)

---------

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
Mason Daugherty (mdrxy) pushed a commit that referenced this pull request Aug 12, 2026
> [!CAUTION]
> Merging this PR will automatically publish to **PyPI** and create a
**GitHub release**.

For the full release process, see
[`.github/RELEASING.md`](https://github.com/langchain-ai/deepagents/blob/main/.github/RELEASING.md).

---

_Release notes preview: keep this section in sync with the package
`CHANGELOG.md`. Publish reads the merged CHANGELOG via `release.yml`,
not this PR description — keep them aligned anyway so the PR stays an
accurate historical record for reviewers and anyone returning later._

---


##
[0.0.10](deepagents-acp==0.0.9...deepagents-acp==0.0.10)
(2026-08-12)

### Features

- Added support for loading persistent ACP sessions
([#5365](#5365)).

_End release notes preview._

---

> [!NOTE]
> A **New Contributors** section is appended to the GitHub release notes
automatically at publish time (see [Release
Pipeline](https://github.com/langchain-ai/deepagents/blob/main/.github/RELEASING.md#release-pipeline),
step 2).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: langchain-oss-automated-triage[bot] <248757908+langchain-oss-automated-triage[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

acp Agent Client Protocol feature New feature/enhancement or request for one internal User is a member of the `langchain-ai` GitHub organization size: L 500-999 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants