Skip to content

Fix response internal metadata persistence - #48590

Draft
Shanmukha Pasumarthy (shanmukha1200) wants to merge 2 commits into
Azure:mainfrom
shanmukha1200:users/spasumarthy/fix-response-internal-metadata
Draft

Fix response internal metadata persistence#48590
Shanmukha Pasumarthy (shanmukha1200) wants to merge 2 commits into
Azure:mainfrom
shanmukha1200:users/spasumarthy/fix-response-internal-metadata

Conversation

@shanmukha1200

Copy link
Copy Markdown
Member

Description

Response-level internal_metadata regressed during the TypedDict migration from a compact JSON string to a nested dictionary under ResponseObject.metadata. Foundry response metadata accepts string values, so resilient checkpoint state could be rejected or lost by hosted storage.

This change:

  • restores compact, deterministic JSON-string encoding while preserving the dict-like stream.internal_metadata API
  • decodes historical string values and normalizes short-lived nested-dictionary snapshots before persistence
  • enforces Foundry's 512-character value and 16-key metadata limits
  • preserves public response metadata and leaves item-level internal metadata unchanged
  • adds checkpoint, Foundry provider, egress, and memory/file round-trip coverage

Validation

  • 1147 passed, 3 skipped across unit and contract tests
  • azpysdk pyright .
  • Black check for the new helper
  • git diff --check

Restore compact JSON-string encoding for response-level internal metadata so Foundry storage accepts and round-trips checkpoint state. Normalize nested-dictionary snapshots and enforce metadata service limits.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: bdc32ee9-9e8f-4a1c-ba27-bdfa318afa1e
@github-actions github-actions Bot added the Hosted Agents sdk/agentserver/* label Aug 14, 2026
Resolve the Responses changelog conflict by retaining the 2.1.0b2 fix entry and the updated 2.1.0b1 release date.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: bdc32ee9-9e8f-4a1c-ba27-bdfa318afa1e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Hosted Agents sdk/agentserver/*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant