Problem
PR #3387 (fix: reject failed and incomplete Responses statuses) only handles the non-streaming path. The streaming path is not covered by this PR despite the title claiming both statuses.
Impact
- A streaming agent that returns a failed/incomplete status would NOT be rejected
- The PR is misleading about what it fixes
- A real bug in the streaming path could ship undetected
What was audited
MCE audit Toaiagents3387 (2026-07-19) caught 3 HIGH attacks:
- The tests do not actually exercise the new code path in AnyLLMModel - they instantiate a fake provider with a canned response, so the assertion only proves the PR raises on the fake; it does not prove it raises on the real code path
- The new check is placed AFTER prompt=prompt is set on the request in openai_responses.py, meaning a failed/incomplete response still incurs the full request construction cost and has already mutated state
- The streaming path is not covered by this PR. Both edited files only add the status check on the non-streaming get_response branch. The PR title says 'fix: reject failed and incomplete Responses statuses' which implies both paths
Recommended fix
- The author (ioleksiuk) should either:
a. Extend the fix to cover the streaming path as well
b. Rename the PR to reflect the actual scope (e.g., 'fix: reject failed and incomplete Responses statuses in non-streaming context')
- The check should be placed BEFORE the request is constructed (to avoid the wasted work)
- Add a test that exercises the real code path (not just a fake provider)
Cross-references
Problem
PR #3387 (fix: reject failed and incomplete Responses statuses) only handles the non-streaming path. The streaming path is not covered by this PR despite the title claiming both statuses.
Impact
What was audited
MCE audit Toaiagents3387 (2026-07-19) caught 3 HIGH attacks:
Recommended fix
a. Extend the fix to cover the streaming path as well
b. Rename the PR to reflect the actual scope (e.g., 'fix: reject failed and incomplete Responses statuses in non-streaming context')
Cross-references