[DRAFT] fix(agent): preserve copilot-acp session context across requests - #5335
Closed
MestreY0d4-Uninter wants to merge 2 commits into
Closed
[DRAFT] fix(agent): preserve copilot-acp session context across requests#5335MestreY0d4-Uninter wants to merge 2 commits into
MestreY0d4-Uninter wants to merge 2 commits into
Conversation
added 2 commits
April 5, 2026 21:15
(cherry picked from commit 6517c52)
(cherry picked from commit 84ef973ff0f6cc13eb7a05ca479793fb8c21e8a6)
Contributor
Author
|
Stacked follow-up to #4536. Opened as draft to avoid upstream drift while the base ACP tool-call bridge is still pending. Related follow-ups in the same stack:
|
This was referenced Apr 5, 2026
Contributor
Author
|
Closing as stale/superseded by later ACP integration changes. I re-audited this against a clean origin/main worktree: parts of the ACP/session behavior were covered by later ACP follow-ups, but this stacked draft no longer represents a clean, mergeable delta on top of current main. If any residual gap still matters, I'll re-extract it as a small focused PR against current main. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #4536.
Please review/merge this after the ACP tool-call bridge lands, since this follow-up assumes that base.
I’m opening it early to reduce the risk of upstream drift while
#4536is still pending.Summary
This PR improves the
copilot-acpintegration by making session behavior much closer to a native conversational backend.Instead of rebuilding ACP state in a brittle way on every request, this change keeps the session/process alive across turns and replays only the incremental delta when the message history is an exact prefix extension.
What changed
tool_calls, tool results, and richer message content survive the ACP bridgesession.model.switchTois unavailable in the current ACP runtimeWhy
The tool-call bridge fixed the biggest behavioral bug, but ACP conversations still felt less native than other providers because context/session handling was weaker.
This PR improves continuity and makes ACP much more usable for multi-turn workflows.
Validation
Automated
python3 -m py_compile agent/copilot_acp_client.py tests/agent/test_copilot_acp_client.pyuv run --extra dev python -m pytest -o addopts='' tests/agent/test_copilot_acp_client.py -q5 passedManual
Validated with a real ACP multi-turn flow on the rebased branch:
OKCONTEXTO_OKNotes
This PR does not claim strong model enforcement in ACP. It improves session/context behavior on top of the current runtime.