Python: Align DevUI Responses parsing - #7968
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Aligns DevUI’s local Responses conversion with OpenAI semantics while preserving multimodal content and response metadata.
Changes:
- Preserves message roles, boundaries, images, files, MIME types, and hosted IDs.
- Stabilizes response IDs and removes estimated token usage.
- Rejects unsupported-only inputs and expands conversion tests.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
_executor.py |
Expands Responses input conversion. |
_conversations.py |
Preserves supported conversation parts. |
_mapper.py |
Stabilizes IDs and usage handling. |
test_multimodal_workflow.py |
Tests multimodal input conversion. |
test_mapper.py |
Tests IDs and missing usage. |
test_conversations.py |
Tests conversation round-tripping. |
test_approval_validation.py |
Updates rejection expectations. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
MAF Automated Review — Iteration 1
Result: Findings reported
Scope: full PR (1 commit(s)): 3294e694cb22
Model: gpt-5.6-sol
Overview
The change substantially improves preservation of Responses message boundaries, multimodal content, stable response IDs, and measured usage, with focused regression coverage for the intended conversions. Validation of roles, server-side approval reconstruction, atomic conversation mutation, and mapper cleanup provide useful guardrails. Two lifecycle gaps remain: failed streams are finalized with a contradictory completion event, and unsupported-only messages can still disappear when another valid message is present.
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
2 verified findings remained after source verification (1 high, 1 medium) across 2 files. Details are attached to the affected lines below.
Affected areas: python/packages/devui/agent_framework_devui/_executor.py, python/packages/devui/agent_framework_devui/_mapper.py
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
MAF Automated Review — Iteration 2
Result: Findings reported
Scope: 1 net-new commit(s): 5dfaef081c2a
Model: gpt-5.6-sol
Overview
This iteration correctly recognizes assistant text variants, rejects each unsupported-only message, preserves partial output on failed streams, and emits one terminal event with a stable response ID. The accompanying tests cover the principal message and stream regressions. One approval-lifecycle edge case remains: validating a batch can consume a pending approval before a later message causes conversion to fail.
Reviewed the supplied incremental change set across correctness, security/reliability, architecture, and failure behavior.
1 verified finding remained after source verification (1 medium) across 1 file. Details are attached to the affected lines below.
Affected areas: python/packages/devui/agent_framework_devui/_executor.py
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 832e81b1-76ee-47ca-981f-be365d987336
Motivation & Context
DevUI's local Responses API conversion could flatten multiple input messages into one user message, drop conversation content after the first part, and replace unsupported input with an empty user text message. Completion conversion also estimated token usage from character counts and generated unrelated response IDs during one streamed lifecycle. These mismatches make local agent behavior diverge from the OpenAI Responses contract and lose information needed by multimodal and conversation scenarios.
Description & Review Guide
Related Issue
N/A — follow-up from the Responses conversion consistency sweep
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.