Replat azure-ai-agentserver-githubcopilot onto agentserver-core 2.0 + responses 1.0#46101
Open
jodeklotzms wants to merge 11 commits intomainfrom
Open
Replat azure-ai-agentserver-githubcopilot onto agentserver-core 2.0 + responses 1.0#46101jodeklotzms wants to merge 11 commits intomainfrom
jodeklotzms wants to merge 11 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Re-platforms azure-ai-agentserver-githubcopilot onto the new agentserver hosting + responses streaming model, removing the bespoke request/response converter layers in favor of ResponseEventStream builders and the new AgentHost/ResponseHandler composition approach.
Changes:
- Rewrites
_copilot_adapter.pyto host viaAgentHost+ResponseHandlerand to stream viaResponseEventStreambuilders. - Removes the old
_copilot_request_converter.py/_copilot_response_converter.pyand their unit tests. - Updates packaging + integration test agent image to pull new prerelease dependencies and adjusts docs/changelog for the replat.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/agentserver/azure-ai-agentserver-githubcopilot/azure/ai/agentserver/githubcopilot/_copilot_adapter.py | New hosting/streaming implementation using AgentHost + ResponseHandler + ResponseEventStream. |
| sdk/agentserver/azure-ai-agentserver-githubcopilot/azure/ai/agentserver/githubcopilot/init.py | Docstring updated to reflect new composition model. |
| sdk/agentserver/azure-ai-agentserver-githubcopilot/azure/ai/agentserver/githubcopilot/_copilot_request_converter.py | Deleted (request conversion/attachment materialization removed). |
| sdk/agentserver/azure-ai-agentserver-githubcopilot/azure/ai/agentserver/githubcopilot/_copilot_response_converter.py | Deleted (manual RAPI event construction removed). |
| sdk/agentserver/azure-ai-agentserver-githubcopilot/tests/unit_tests/test_copilot_request_converter.py | Deleted (unit tests for removed request converter). |
| sdk/agentserver/azure-ai-agentserver-githubcopilot/tests/integration/test_agent/Dockerfile | Updated to install new prerelease agentserver deps from ADO feed and install package from local source. |
| sdk/agentserver/azure-ai-agentserver-githubcopilot/pyproject.toml | Dependency set updated for new agentserver packages; removes explicit OTel exporter dependency. |
| sdk/agentserver/azure-ai-agentserver-githubcopilot/CHANGELOG.md | Adds 1.0.0b2 (Unreleased) entry describing replat + behavior changes. |
| sdk/agentserver/azure-ai-agentserver-githubcopilot/.foundry-agent.json | New file with environment-specific session/conversation IDs. |
...er/azure-ai-agentserver-githubcopilot/azure/ai/agentserver/githubcopilot/_copilot_adapter.py
Show resolved
Hide resolved
...er/azure-ai-agentserver-githubcopilot/azure/ai/agentserver/githubcopilot/_copilot_adapter.py
Show resolved
Hide resolved
...er/azure-ai-agentserver-githubcopilot/azure/ai/agentserver/githubcopilot/_copilot_adapter.py
Show resolved
Hide resolved
...er/azure-ai-agentserver-githubcopilot/azure/ai/agentserver/githubcopilot/_copilot_adapter.py
Show resolved
Hide resolved
...er/azure-ai-agentserver-githubcopilot/azure/ai/agentserver/githubcopilot/_copilot_adapter.py
Outdated
Show resolved
Hide resolved
sdk/agentserver/azure-ai-agentserver-githubcopilot/.foundry-agent.json
Outdated
Show resolved
Hide resolved
sdk/agentserver/azure-ai-agentserver-githubcopilot/tests/integration/test_agent/Dockerfile
Outdated
Show resolved
Hide resolved
...er/azure-ai-agentserver-githubcopilot/azure/ai/agentserver/githubcopilot/_copilot_adapter.py
Show resolved
Hide resolved
sdk/agentserver/azure-ai-agentserver-githubcopilot/tests/integration/test_agent/Dockerfile
Outdated
Show resolved
Hide resolved
jodeklotzms
added a commit
that referenced
this pull request
Apr 3, 2026
- Fix duplicate kwargs bug: remove explicit skill_directories/tools from create_session() calls — already present in sdk_config via _session_config - Bump version to 1.0.0b2 to match CHANGELOG - Remove .foundry-agent.json (contained real session/conversation IDs) - Close AsyncDefaultCredential in _load_conversation_history to prevent async transport/socket leak - Restore attachment handling: _extract_input_with_attachments() extracts input_file and input_image items from RAPI requests and appends to prompt - Observe cancellation_signal in event loop to stop early on client disconnect - Drop [tracing] extra from test Dockerfile to match pyproject.toml deps Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Major architecture change: FoundryCBAgent (inheritance) → AgentHost +
ResponseHandler (composition). Hypercorn replaces uvicorn.
Fixes:
- SSE streaming truncation (correct RAPI event ordering works natively)
- Duplicate text in streaming (only emit ASSISTANT_MESSAGE_DELTA)
- Eliminates heartbeat hack (built-in SSE keepalive)
Deleted:
- _copilot_response_converter.py (355 lines) — replaced by ResponseEventStream builders
- _copilot_request_converter.py (313 lines) — replaced by get_input_text()
- Unit tests for deleted converter
Preserved:
- Public API: GitHubCopilotAdapter.from_project(".").run()
- All env vars unchanged
- BYOK auth, model discovery, Tool ACL, skill/tool discovery
- Conversation history bootstrap (now uses own AsyncOpenAI client)
Dependencies:
- azure-ai-agentserver-core>=2.0.0a1 (was >=1.0.0b14,<1.0.0b18)
- azure-ai-agentserver-responses>=1.0.0a1 (new)
- Removed opentelemetry-exporter-otlp-proto-http (tracing via core[tracing])
Validated on ADC as trove-replat-v4 with correct streaming.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The ResponseHandler expects the create_handler to be an async generator (with __anext__), not a coroutine. Fixed by using async for delegation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The Azure DevOps feed is public — pip just needs --no-input to suppress the interactive auth prompt in non-interactive builds (like ACR Tasks). Removes wheel download/copy from deploy script and Dockerfile. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The Azure DevOps feed proxies github-copilot-sdk but requires auth for upstream packages it hasn't cached. Fix: install base packages from dev feed in a separate pip call, then install our package + deps from PyPI only. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix duplicate kwargs bug: remove explicit skill_directories/tools from create_session() calls — already present in sdk_config via _session_config - Bump version to 1.0.0b2 to match CHANGELOG - Remove .foundry-agent.json (contained real session/conversation IDs) - Close AsyncDefaultCredential in _load_conversation_history to prevent async transport/socket leak - Restore attachment handling: _extract_input_with_attachments() extracts input_file and input_image items from RAPI requests and appends to prompt - Observe cancellation_signal in event loop to stop early on client disconnect - Drop [tracing] extra from test Dockerfile to match pyproject.toml deps Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…issing The ResponseHandler context only populates conversation_id when the request includes an explicit "conversation" field. Most callers (invoke scripts, Playground) only send session_id. Without this fallback, conversation_id is always None and the adapter creates a fresh Copilot SDK session on every request, breaking multi-turn. Also fixes Windows --no-logs in integration test deploy script. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
conversation_id is only set when the request includes an explicit "conversation" field. Most callers (invoke scripts, Playground) only send session_id. The adapter now falls back to context.raw_body ["session_id"] and sets it on context.conversation_id so session reuse and history bootstrap work transparently. Also adds build tag canary for deployment verification. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ound The Playground sends conversation identity via raw_body['conversation']['id'] (from Chat Completions API translation), not session_id. The fallback now checks both session_id and conversation.id in the raw body. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
9b73232 to
1b6103a
Compare
Covers input extraction with attachments, conversation_id fallback (session_id and conversation.id from raw_body), session config building, BYOK URL derivation, project endpoint resolution, and skill directory discovery. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
tendau
approved these changes
Apr 3, 2026
pradeepkintali
approved these changes
Apr 3, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
pvaneck
reviewed
Apr 3, 2026
| @@ -1,16 +1,28 @@ | |||
| FROM mcr.microsoft.com/mirror/docker/library/python:3.11-slim | |||
| FROM python:3.11-slim | |||
Member
There was a problem hiding this comment.
Can we keep this from the mcr registry? This will get flagged again for not being from an approved registry.
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.
Summary
Re-platforms the
azure-ai-agentserver-githubcopilotadapter onto the new agentserver packages:azure-ai-agentserver-core2.0 (AgentHost + Hypercorn)azure-ai-agentserver-responses1.0 (ResponseHandler + ResponseEventStream builders)+282 lines, -1,484 lines (net -1,202 lines).
Why
completedbeforetext_done) is removed.sse_keep_alive_interval_secondshandles the thinking gap._copilot_response_converter.pyand_copilot_request_converter.pydeleted, replaced byResponseEventStreambuilders.AgentHostcomposition model.What Changed
_copilot_adapter.py: Rewritten fromclass CopilotAdapter(FoundryCBAgent)toAgentHost+ResponseHandler+@responses.create_handlercomposition._copilot_response_converter.py: Deleted (355 lines) — replaced byResponseEventStreambuilders._copilot_request_converter.py: Deleted (313 lines) — replaced byget_input_text()from responses package.test_copilot_request_converter.py: Deleted — tests for deleted module.pyproject.toml: Dependencies updated (core>=2.0.0a1,responses>=1.0.0a1, removedopentelemetry-exporter-otlp-proto-http).What Stays the Same
GitHubCopilotAdapter.from_project(".").run()— unchanged.GITHUB_TOKEN,AZURE_AI_PROJECT_ENDPOINT,AZURE_AI_FOUNDRY_RESOURCE_URL, etc. — unchanged._foundry_model_discovery.py,_model_cache.py,_tool_acl.py,_tool_discovery.py.Test Plan
replat-pkg-v3(NCUS)fa invoke --remoteDependencies
New base packages from Azure DevOps dev feed:
azure-ai-agentserver-core[tracing]==2.0.0a20260331006azure-ai-agentserver-responses==1.0.0a20260331006Feed:
https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/🤖 Generated with Claude Code