Skip to content

[DRAFT] fix(agent): route copilot-acp through non-streaming request flow - #5336

Closed
MestreY0d4-Uninter wants to merge 2 commits into
NousResearch:mainfrom
MestreY0d4-Uninter:fix/acp-run-agent-integration
Closed

[DRAFT] fix(agent): route copilot-acp through non-streaming request flow#5336
MestreY0d4-Uninter wants to merge 2 commits into
NousResearch:mainfrom
MestreY0d4-Uninter:fix/acp-run-agent-integration

Conversation

@MestreY0d4-Uninter

@MestreY0d4-Uninter MestreY0d4-Uninter commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

Depends on #4536.
Please review/merge this after the ACP tool-call bridge lands, since this follow-up assumes that base behavior.

I’m opening it early to reduce the risk of upstream drift while #4536 is still pending.

Summary

This PR fixes the run_agent.py integration path for copilot-acp.

ACP should not go through the generic streaming request flow used by other providers. Doing so can lead to double-send behavior and makes interruption/abort handling less reliable.

What changed

  • bypass the generic streaming path for copilot-acp
  • route ACP through the non-streaming request path
  • ensure shared ACP client interruption/abort is handled correctly
  • detect ACP both by provider and ACP marker base URL
  • add focused integration tests around ACP request routing and notice behavior

Why

The ACP client became much stronger after the tool-call bridge, but run_agent.py still treated it too much like a generic provider.

This PR fixes that integration mismatch.

Validation

Automated

  • python3 -m py_compile agent/copilot_acp_client.py run_agent.py tests/test_run_agent.py
  • uv run --extra dev python -m pytest -o addopts='' tests/test_run_agent.py -q -k 'CopilotAcpIntegration or CopilotAcpNotice'
  • Result: 5 passed, 226 deselected

Manual

Validated end-to-end on the rebased branch with a real AIAgent(provider='copilot-acp') run:

  • prompt: Reply exactly ACP_OK
  • result: ACP_OK

Notes

This PR is about correct ACP integration in the main agent loop.
It does not change broader routing policy beyond the ACP-specific request path.

Mateus Scheuer Macedo added 2 commits April 5, 2026 21:15
(cherry picked from commit 0e7d26a88def809478f4136d4cdfeeebb8d1d76a)
@MestreY0d4-Uninter

Copy link
Copy Markdown
Contributor Author

Stacked follow-up to #4536.

Opened as draft to avoid upstream drift while the base ACP tool-call bridge is still pending.
Please review/merge this after #4536.

Related follow-ups in the same stack:

@MestreY0d4-Uninter

Copy link
Copy Markdown
Contributor Author

Closing as stale/superseded by later ACP integration changes. I re-audited this against a clean origin/main worktree: the copilot-acp/run_agent integration area has evolved since this stacked draft was opened, so this PR is no longer the right review unit on top of current main. If there is still a remaining non-streaming gap, I'll re-extract it as a fresh focused PR against current main.

@MestreY0d4-Uninter
MestreY0d4-Uninter deleted the fix/acp-run-agent-integration branch April 27, 2026 01:42
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