Skip to content

Feature: keep ACP conversation context when switching project folders - #150

Merged
DevMando merged 2 commits into
mainfrom
feature/acp-folder-history
Dec 2, 2026
Merged

DevMando merged 2 commits into
mainfrom
feature/acp-folder-history

Conversation

@DevMando

@DevMando DevMando commented Dec 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

Changing an ACP agent’s project folder previously restarted it with a fresh session and cleared its local conversation state. The pane now keeps its transcript and attempts to continue the existing agent session in the new folder. If the adapter starts fresh, users can choose whether to carry recent conversation text into that session.

For example, a user can ask an agent to remember a phrase, switch that pane to another project, and continue discussing it while the agent is told to use the new folder and re-read files.

What users will experience

  • Direct folder switching: Change Directory, /change-directory, and !cd move to the selected folder without an extra confirmation. Only that ACP agent restarts; other panes keep their own folders and conversations.

  • Conversation continuity: Retain the transcript and try the adapter’s supported session continuation with the new folder. If continuation is unavailable or rejected, offer Carry recent context or Start fresh. The handoff is a bounded excerpt of up to eight recent messages and 12,000 characters; attachments are not transferred.

  • Clear project context: Before the next user request, send a separate update naming the old and new folders and asking the agent to re-read files before relying on earlier paths or contents. The original request then follows unchanged, including slash commands and image attachments.

  • Familiar, quieter feedback: Use the same “Changed directory to…” and “Switching to the new project — this conversation is kept” wording as native Ollama conversations. Folder restarts skip the repeated connection card, and internal acknowledgments stay out of the transcript. Errors, warnings, and actual tool activity remain visible.

  • Predictable recovery: If the context update fails or is cancelled, keep it pending and explain that the user’s request was not sent. Failed startup retains the continuation attempt for retry. /clear, switching ACP agents, or returning to the native agent discards pending handoff context.

  • One documentation home: Keep essential ACP setup and usage in the README. Remove the standalone docs/acp.md and docs/acp-codex.md guides and update their links and CLI references.

Validation

  • Full .NET 10 Release suite: 1,966 passed, one existing symlink test skipped, zero failed.
  • Final focused context, presentation, and component checks: 56 passed.
  • After consolidating the guides, 64 setup and hardening checks passed, and no references to the deleted guide paths remain.
  • The project owner tested with Claude ACP: the agent retained the remembered phrase and identified the new project folder. The direct-switch flow and final wording were also checked interactively.
  • Real-process mock-agent tests cover adapters accepting and rejecting cross-folder resume. Additional tests cover pane isolation, transcript retention, optional handoff and cancellation, bounded context, unduplicated replay, separate context delivery before unchanged commands/images, /clear, compact restart output, and visible failures/tool output.
  • Patch whitespace checks passed. Builds used isolated output directories so existing conversations could stay open.

Scope

Session continuation depends on the adapter. The optional text handoff supplies recent context when a full session cannot be continued; it is not a full session restoration or a generated summary. Initial connection cards and normal explicit session-resume behavior are retained.

Related to the ACP integration work in #144. The separate README badge cleanup is excluded.

@DevMando
DevMando merged commit b8e2f3d into main Dec 2, 2026
2 checks passed
@DevMando
DevMando deleted the feature/acp-folder-history branch December 2, 2026 06:12
@DevMando DevMando mentioned this pull request Dec 2, 2026
8 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant