fix: derive streaming status from retry firsts

This commit is contained in:
2026-07-10 07:26:15 +08:00
parent ccecee2a44
commit f67cbbda65
4 changed files with 50 additions and 9 deletions
+14
View File
@@ -143,6 +143,18 @@ class CodexRetryGatewayTUITests(unittest.TestCase):
"first_response_at": "2026-07-10T11:59:55Z",
"last_activity_at": "2026-07-10T11:59:55Z",
}
retry_streaming = {
"lifecycle_state": "sent",
"started_at": "2026-07-10T11:59:00Z",
"reasoning_retry_current_firsts": [
{
"round": 1,
"slot": 1,
"first_response_at": "2026-07-10T11:59:58Z",
"first_delay_ms": 2200,
}
],
}
complete = {"lifecycle_state": "finish", "status_code": 200}
discarded = {
"lifecycle_state": "finish",
@@ -161,6 +173,8 @@ class CodexRetryGatewayTUITests(unittest.TestCase):
self.assertEqual(mod.request_status_label(waiting, now), "waiting")
self.assertEqual(mod.request_status_label(streaming, now), "streaming")
self.assertEqual(mod.request_status_label(retry_streaming, now), "streaming")
self.assertEqual(mod.request_activity_at(retry_streaming), "2026-07-10T11:59:58Z")
self.assertEqual(mod.request_status_label(complete, now), "HTTP 200")
self.assertEqual(mod.request_status_label(discarded, now), "discarded")
self.assertEqual(mod.request_status_label(slow_waiting, now), "waiting 30.0s")