Split effort into its own request column
This commit is contained in:
+20
-28
@@ -472,27 +472,21 @@ def request_chunk_progress(row: dict[str, Any]) -> str:
|
||||
return f"{row.get('stream_chunk_count') or 0} / {format_bytes(row.get('response_bytes_received'))}"
|
||||
|
||||
|
||||
def request_reasoning_mode_summary(row: dict[str, Any]) -> str:
|
||||
effort = str(row.get("reasoning_effort") or "").strip()
|
||||
summary = str(row.get("reasoning_summary") or "").strip()
|
||||
bits = []
|
||||
if effort:
|
||||
bits.append(effort)
|
||||
if summary:
|
||||
bits.append(f"summary {summary}")
|
||||
return " | ".join(bits)
|
||||
def request_effort_text(row: dict[str, Any]) -> str:
|
||||
return str(row.get("reasoning_effort") or "").strip() or "-"
|
||||
|
||||
|
||||
def request_retry_note(row: dict[str, Any]) -> str:
|
||||
attempts = as_int(row.get("upstream_attempt_count"))
|
||||
if attempts <= 1:
|
||||
return ""
|
||||
return str(row.get("error") or "").strip()
|
||||
|
||||
|
||||
def request_row_cells(row: dict[str, Any], text_limits: dict[str, int] | None = None) -> tuple[Any, ...]:
|
||||
limits = text_limits or {}
|
||||
note_prefix = f"{row['upstream_attempt_count'] or 0}x "
|
||||
note_width = max(4, limits.get("note", 22) - len(note_prefix))
|
||||
note_parts = []
|
||||
reasoning_mode = request_reasoning_mode_summary(row)
|
||||
if reasoning_mode:
|
||||
note_parts.append(reasoning_mode)
|
||||
if row.get("error"):
|
||||
note_parts.append(str(row["error"]))
|
||||
note_width = max(4, limits.get("note", 22))
|
||||
retry_note = request_retry_note(row)
|
||||
return (
|
||||
str(row["seq"]),
|
||||
short_text(request_id_text(row), limits.get("req_id", 18)) or "-",
|
||||
@@ -502,7 +496,7 @@ def request_row_cells(row: dict[str, Any], text_limits: dict[str, int] | None =
|
||||
f"{status_symbol(row)} {row.get('status_code') or '-'}",
|
||||
short_text(row["path"], limits.get("path", 22)),
|
||||
short_text(row["model"] or row["requested_model"] or row["forwarded_model"], limits.get("model", 16)),
|
||||
row["reasoning_tokens"] if row["reasoning_tokens"] is not None else "-",
|
||||
short_text(request_effort_text(row), limits.get("effort", 10)),
|
||||
short_text(request_usage_summary(row), limits.get("usage", 24)),
|
||||
format_bytes(row.get("request_body_bytes")),
|
||||
format_bytes(row.get("response_bytes_received")),
|
||||
@@ -510,7 +504,7 @@ def request_row_cells(row: dict[str, Any], text_limits: dict[str, int] | None =
|
||||
format_duration_ms_as_seconds(row["first_response_delay_ms"]),
|
||||
format_duration_ms_as_seconds(row["duration_ms"]),
|
||||
request_updated_elapsed(row),
|
||||
f"{note_prefix}{short_text(' | '.join(note_parts), note_width)}",
|
||||
short_text(retry_note, note_width),
|
||||
)
|
||||
|
||||
|
||||
@@ -706,7 +700,6 @@ def request_match_score(row: dict[str, Any], needle: str) -> bool:
|
||||
"requested_model",
|
||||
"forwarded_model",
|
||||
"reasoning_effort",
|
||||
"reasoning_summary",
|
||||
"error",
|
||||
"upstream_origin",
|
||||
"upstream_path",
|
||||
@@ -828,8 +821,6 @@ def render_request_detail(row: dict[str, Any]) -> str:
|
||||
bits.append(f"forwarded {row['forwarded_model']}")
|
||||
if row.get("reasoning_effort"):
|
||||
bits.append(f"effort {row['reasoning_effort']}")
|
||||
if row.get("reasoning_summary"):
|
||||
bits.append(f"summary {row['reasoning_summary']}")
|
||||
if row.get("reasoning_tokens") is not None:
|
||||
bits.append(f"reasoning {row['reasoning_tokens']}")
|
||||
if row.get("input_tokens") is not None or row.get("output_tokens") is not None or row.get("total_tokens") is not None or row.get("cached_tokens") is not None:
|
||||
@@ -1252,7 +1243,7 @@ def run_textual(
|
||||
"status": 7,
|
||||
"path": 22,
|
||||
"model": 16,
|
||||
"reasoning": 10,
|
||||
"effort": 8,
|
||||
"usage": 36,
|
||||
"req": 10,
|
||||
"resp": 10,
|
||||
@@ -1271,7 +1262,7 @@ def run_textual(
|
||||
"status": 7,
|
||||
"path": 40,
|
||||
"model": 24,
|
||||
"reasoning": 10,
|
||||
"effort": 8,
|
||||
"usage": 72,
|
||||
"req": 12,
|
||||
"resp": 12,
|
||||
@@ -1312,7 +1303,7 @@ def run_textual(
|
||||
"status": requests.add_column("Status", width=width_profile["status"], key="status"),
|
||||
"path": requests.add_column("Path", width=width_profile["path"], key="path"),
|
||||
"model": requests.add_column("Model", width=width_profile["model"], key="model"),
|
||||
"reasoning": requests.add_column("Reasoning", width=width_profile["reasoning"], key="reasoning"),
|
||||
"effort": requests.add_column("Effort", width=width_profile["effort"], key="effort"),
|
||||
"usage": requests.add_column("Usage", width=self.request_usage_width, key="usage"),
|
||||
"req_bytes": requests.add_column("Req Size", width=width_profile["req"], key="req_bytes"),
|
||||
"resp_bytes": requests.add_column("Resp Size", width=width_profile["resp"], key="resp_bytes"),
|
||||
@@ -1598,10 +1589,11 @@ def run_textual(
|
||||
"thread": width_profile["thread"],
|
||||
"path": width_profile["path"],
|
||||
"model": width_profile["model"],
|
||||
"effort": width_profile["effort"],
|
||||
"usage": self.request_usage_width,
|
||||
"note": width_profile["note"],
|
||||
}
|
||||
for name in ("req_id", "resp_id", "thread", "path", "model", "usage", "note"):
|
||||
for name in ("req_id", "resp_id", "thread", "path", "model", "effort", "usage", "note"):
|
||||
key = self.request_table_column_keys.get(name)
|
||||
column = table.columns.get(key) if key is not None else None
|
||||
if column is None or not getattr(column, "width", 0):
|
||||
@@ -1827,9 +1819,9 @@ def print_once(snapshot: dict[str, Any], filter_text: str = "") -> None:
|
||||
try:
|
||||
print(
|
||||
f"{row['seq']:>6} {short_text(request_id_text(row), 16):<16} {short_text(response_id_text(row), 16):<16} {short_text(row.get('thread_id'), 14):<14} {short_time(row.get('started_at')):<19} {status_symbol(row)} {row.get('status_code') or '-':<4} "
|
||||
f"{short_text(row['path'], 20):<20} {short_text(row['model'] or row['requested_model'] or row['forwarded_model'], 16):<16} "
|
||||
f"{short_text(row['path'], 20):<20} {short_text(row['model'] or row['requested_model'] or row['forwarded_model'], 16):<16} {short_text(request_effort_text(row), 6):<6} "
|
||||
f"{short_text(request_usage_summary(row), 26):<26} {format_bytes(row.get('request_body_bytes')):<8} {request_chunk_progress(row):<14} {format_duration_ms_as_seconds(row['duration_ms']):<8} {request_updated_elapsed(row):<8} "
|
||||
f"{format_count(row['upstream_attempt_count'] or 0):<4} {short_text(row['error'], 30)}"
|
||||
f"{short_text(request_retry_note(row), 30)}"
|
||||
)
|
||||
except BrokenPipeError:
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user