Skip to content

Python: Update agentserver to 2.1.0 - #7621

Draft
Tao Chen (TaoChenOSU) wants to merge 1 commit into
mainfrom
taochen/update-agentserver-to-2.1.0
Draft

Python: Update agentserver to 2.1.0#7621
Tao Chen (TaoChenOSU) wants to merge 1 commit into
mainfrom
taochen/update-agentserver-to-2.1.0

Conversation

@TaoChenOSU

@TaoChenOSU Tao Chen (TaoChenOSU) commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Motivation & Context

WIP: more testing is needed

Description & Review Guide

  • What are the major changes?
  • What is the impact of these changes?
  • What do you want reviewers to focus on?

Related Issue

Fixes #

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

@TaoChenOSU Tao Chen (TaoChenOSU) self-assigned this Aug 11, 2026
Copilot AI balanced review requested due to automatic review settings August 11, 2026 21:48
@TaoChenOSU Tao Chen (TaoChenOSU) added python Usage: [Issues, PRs], Target: Python foundry Usage: [Issues, PRs], Target: all Foundry integrations hosting Usage: [Issues, PRs], Target: all hosting related solutions labels Aug 11, 2026
@github-actions github-actions Bot changed the title Update agentserver to 2.1.0 Python: Update agentserver to 2.1.0 Aug 11, 2026
@agent-framework-automation agent-framework-automation Bot added the documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs label Aug 11, 2026

Copilot AI 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.

Pull request overview

Updates Python Foundry hosting for AgentServer 2.1, durable local storage, stable conversation identifiers, and custom Cosmos DB session storage.

Changes:

  • Upgrades AgentServer dependencies and storage providers.
  • Uses conversation-chain IDs for sessions and workflow checkpoints.
  • Adds a custom Cosmos DB storage sample and updates tests/docs.

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
custom_storage/requirements.txt Adds sample dependencies.
custom_storage/README.md Documents custom storage usage.
custom_storage/main.py Implements Cosmos-backed sessions.
custom_storage/Dockerfile Packages the sample.
custom_storage/.env.example Lists required configuration.
custom_storage/.dockerignore Excludes local artifacts.
tests/test_state_store.py Updates provider expectations.
tests/test_responses.py Replaces removed in-memory approval store.
foundry_hosting/README.md Documents durable local persistence.
foundry_hosting/pyproject.toml Updates AgentServer dependencies.
_state_store.py Uses Foundry stores in all environments.
_responses.py Revises session and checkpoint scoping.
_request_context.py Removes obsolete path validation.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

"azure-ai-agentserver-responses>=2.0.0b1,<3",
"azure-ai-agentserver-invocations>=1.0.0b8,<2",
"azure-ai-agentserver-core>=2.1.0b1,<3",
"azure-ai-agentserver-responses>=2.0.0,<3",
Comment on lines +375 to +376
context_id = context.conversation_chain_id
session = await session_storage.get(context_id)
Comment on lines +501 to +503
context_id = context.conversation_chain_id
checkpoint_storage = self._checkpoint_storage_provider.get_store(config=self.config, context_id=context_id)

Comment on lines +42 to +44
Set all variables in `.env.example`, including the Cosmos settings, and follow
[Deploying the Agent to Foundry](../../README.md#deploying-the-agent-to-foundry)
in the parent README. The hosted provider initializes Cosmos DB lazily on its first
config=self.config,
context_id=write_context_id,
)
latest_checkpoint = await checkpoint_storage.get_latest(workflow_name=self._agent.workflow.name)

@github-actions github-actions 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.

Automated Code Review

Reviewers: 1

✗ Deep Review

Deep review found 2 verified inline finding(s).


Automated review by TaoChenOSU's agents

session = self._agent.create_session()
else:

context_id = context.conversation_chain_id

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.

This key no longer restores regular-agent state for previous_response_id requests in the actual endpoint path: the existing generated-ID chain test observes [1, 1, 1] instead of restoring the prior session, and a missing previous response silently creates a fresh session. That breaks the core multi-turn workflow and discards conversation state without notifying the caller. Please ensure the first response and its continuations resolve to the same persisted key, while preserving an error for a genuinely unknown previous response.

# any future async resources owned by the workflow are entered here.
await self._ensure_agent_ready()

context_id = context.conversation_chain_id

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.

The new SDK safely hashes malformed context values into opaque IDs, but the three existing checkpoint-context tests still require these inputs to produce response.failed; all three now complete successfully and fail the suite. Please update the tests to assert the new safe-key behavior, or retain explicit rejection if that remains the package contract.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs foundry Usage: [Issues, PRs], Target: all Foundry integrations hosting Usage: [Issues, PRs], Target: all hosting related solutions python Usage: [Issues, PRs], Target: Python

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants