Show reasoning mode in request views

This commit is contained in:
2026-07-04 02:57:59 +08:00
parent 5c7bea431a
commit 6fdedd997b
3 changed files with 47 additions and 4 deletions
+10 -2
View File
@@ -35,14 +35,16 @@ class CodexRetryGatewayTUITests(unittest.TestCase):
mod = load_module()
payload = {
"entries": [
{"seq": 1, "request_id": "req_a", "response_id": "resp_a", "thread_id": "thread_a", "path": "/responses"},
{"seq": 2, "request_id": "req_b", "response_id": "resp_b", "thread_id": "thread_b", "path": "/v1/responses"},
{"seq": 1, "request_id": "req_a", "response_id": "resp_a", "thread_id": "thread_a", "path": "/responses", "reasoning_effort": "high"},
{"seq": 2, "request_id": "req_b", "response_id": "resp_b", "thread_id": "thread_b", "path": "/v1/responses", "reasoning_effort": "xhigh", "reasoning_summary": "auto"},
]
}
rows = mod.normalize_request_rows(payload)
self.assertEqual([row["request_id"] for row in rows], ["req_b", "req_a"])
self.assertEqual(rows[0]["response_id"], "resp_b")
self.assertEqual(rows[0]["thread_id"], "thread_b")
self.assertEqual(rows[0]["reasoning_effort"], "xhigh")
self.assertEqual(rows[0]["reasoning_summary"], "auto")
def test_profile_rows_show_active_first(self) -> None:
mod = load_module()
@@ -84,6 +86,8 @@ class CodexRetryGatewayTUITests(unittest.TestCase):
"status_code": 200,
"upstream_status_code": 200,
"upstream_attempt_count": 1,
"reasoning_effort": "xhigh",
"reasoning_summary": "auto",
"first_response_delay_ms": 10,
"duration_ms": 20,
"request_body_bytes": 3,
@@ -100,6 +104,8 @@ class CodexRetryGatewayTUITests(unittest.TestCase):
self.assertIn("req r", mod.render_request_detail(row))
self.assertIn("resp resp_1", mod.render_request_detail(row))
self.assertIn("updated 1.0s", mod.render_request_detail(row))
self.assertIn("effort xhigh", mod.render_request_detail(row))
self.assertIn("summary auto", mod.render_request_detail(row))
self.assertEqual(mod.request_updated_elapsed(row), "1.0s")
self.assertEqual(mod.request_chunk_progress(row), "7 / 4.1KB")
@@ -164,6 +170,7 @@ class CodexRetryGatewayTUITests(unittest.TestCase):
"requested_model": "",
"forwarded_model": "",
"reasoning_tokens": 7,
"reasoning_effort": "xhigh",
"input_tokens": 20,
"output_tokens": 10,
"cached_tokens": 5,
@@ -182,6 +189,7 @@ class CodexRetryGatewayTUITests(unittest.TestCase):
self.assertEqual(cells[2], "resp_1")
self.assertEqual(cells[10], "1.5KB")
self.assertEqual(cells[11], "4.1KB")
self.assertIn("xhigh", cells[16])
def test_request_rows_read_usage_from_nested_usage_object(self) -> None:
mod = load_module()