fix: rerender wide mode request text

This commit is contained in:
2026-06-30 17:40:34 +08:00
parent 68d7250c6b
commit c85c7d896d
2 changed files with 107 additions and 32 deletions
+34
View File
@@ -109,6 +109,40 @@ class CodexRetryGatewayTUITests(unittest.TestCase):
}
self.assertEqual(mod.request_usage_summary(row), "in 75 | out 40 | cached 25 (25%)")
def test_request_row_cells_expand_with_wider_limits(self) -> None:
mod = load_module()
row = {
"seq": 1,
"request_id": "req_abcdefghijklmnopqrstuvwxyz0123456789",
"response_id": "resp_abcdefghijklmnopqrstuvwxyz0123456789",
"thread_id": "thread_abcdefghijklmnopqrstuvwxyz0123456789",
"started_at": "2026-06-30T12:00:00Z",
"status_code": 200,
"path": "/v1/responses/this/is/a/very/long/path/for/testing/truncation",
"model": "gpt-very-long-model-name-for-testing",
"requested_model": "",
"forwarded_model": "",
"reasoning_tokens": 516,
"input_tokens": 1200,
"output_tokens": 340,
"cached_tokens": 128,
"response_bytes_received": 363800,
"response_stream": True,
"stream_chunk_count": 587,
"first_response_delay_ms": 1500,
"duration_ms": 1542200,
"upstream_attempt_count": 2,
"error": "Selected model is at capacity. Please try a different model.",
"finished_at": "2026-06-30T12:25:00Z",
}
compact = mod.request_row_cells(row, {"id": 18, "thread": 18, "path": 22, "model": 16, "usage": 24, "note": 22})
wide = mod.request_row_cells(row, {"id": 36, "thread": 36, "path": 40, "model": 24, "usage": 72, "note": 48})
self.assertLess(len(compact[1]), len(wide[1]))
self.assertLess(len(compact[2]), len(wide[2]))
self.assertLess(len(compact[5]), len(wide[5]))
self.assertLess(len(compact[8]), len(wide[8]))
self.assertLess(len(compact[14]), len(wide[14]))
def test_request_rows_read_usage_from_nested_usage_object(self) -> None:
mod = load_module()
payload = {