Skip to content

Commit a832404

Browse files
igerberclaude
andcommitted
Add regression test for non-completed status with valid content
Pin the content-first parsing behavior: status='incomplete' with usable output should return content, not exit. Addresses P2 from gpt-5.4-pro review. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent cf45f2a commit a832404

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

tests/test_openai_review.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,6 +1710,20 @@ def test_status_none_with_valid_output_succeeds(self, review_mod, mock_urlopen):
17101710
content, _ = review_mod.call_openai("test", "gpt-5.4", "fake-key")
17111711
assert content == "Good review."
17121712

1713+
def test_incomplete_status_with_valid_content_succeeds(self, review_mod, mock_urlopen):
1714+
"""Non-completed status should still return content when output is usable."""
1715+
mock_urlopen["response_data"] = {
1716+
"status": "incomplete",
1717+
"output_text": None,
1718+
"output": [{
1719+
"type": "message",
1720+
"content": [{"type": "output_text", "text": "Partial but usable."}],
1721+
}],
1722+
"usage": {"input_tokens": 10, "output_tokens": 5},
1723+
}
1724+
content, _ = review_mod.call_openai("test", "gpt-5.4", "fake-key")
1725+
assert content == "Partial but usable."
1726+
17131727
def test_output_text_convenience_field_used(self, review_mod, mock_urlopen):
17141728
"""When output_text is populated (SDK-style), use it directly."""
17151729
mock_urlopen["response_data"] = {

0 commit comments

Comments
 (0)