Python: Hosted Responses lose CostControl budget failure metadata
@eavanvalkenburg is already working on this.
Since Sep 18, 2026.
Assessment
This issue has not been assessed yet.
Description
When a Foundry-hosted Agent Framework Responses agent receives a streaming model failure caused by a CostControl budget block, the raw model response includes x-ms-budget-cause: budget_exceeded and related budget headers. The OpenAI streaming SDK later raises a generic APIError from the SSE error event, and the hosting adapter currently emits a generic response.failed with error.code: server_error.
Expected behavior:
- Preserve the allowlisted CostControl response headers across the streaming exception boundary.
- Emit
response.failed.error.codeasbudget_exceeded. - Include compact CostControl details in response metadata so streaming and non-streaming Responses clients can render the correct budget-block experience.
The outer Responses HTTP status should remain protocol-compatible; this issue concerns the terminal failure body and metadata.
- Dominant language
- Python
- Stars
- 13.6k
- Forks
- 2.3k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 342
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/agent-framework
-
python triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
microsoft/agent-framework#8523 · 1 comment ·
-
.NET compaction documentation
Difficulty 1/5 Under an hour Newbie friendliness 82/100
microsoft/agent-framework#4629 · 1 comment ·
-
harness python reproduced
microsoft/agent-framework#8567 · 2 comments · 1 assignee ·
-
.NET agents reproduced
microsoft/agent-framework#8566 · 1 comment · 1 assignee ·
-
.NET agents python
microsoft/agent-framework#8562 · 1 assignee ·
All issues in microsoft/agent-framework
Similar issues
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
simonw/sqlite-utils#872 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100