Summary
Two code branches in render_detail._build_event_details are never exercised by the current test suite, so regressions there can't be caught by CI.
Gap 1 — SESSION_SHUTDOWN with shutdownType=None
Location: src/copilot_usage/render_detail.py:156
case EventType.SESSION_SHUTDOWN:
if (data := _safe_event_data(ev, ev.as_session_shutdown)) is None:
return ""
return f"type={data.shutdownType}" if data.shutdownType else ""
SessionShutdownData.shutdownType is typed str | None, so the field is legitimately absent in some real events. When the field is None or "", the function returns "".
TestBuildEventDetails.test_session_shutdown_details only exercises the truthy case (shutdownType="routine"). The else branch (shutdownType is None → "") has zero test coverage.
Expected test: An EVENT_TYPE.SESSION_SHUTDOWN event with a SessionShutdownData whose shutdownType is None (or omitted from the raw data dict) should make _build_event_details return "".
Gap 2 — TOOL_EXECUTION_COMPLETE with non-None model field
Location: src/copilot_usage/render_detail.py:149–150
if data.model:
parts.append(f"model={data.model}")
ToolExecutionData.model is optional. When present it should appear in the detail string as model=<name>. All three existing TestBuildEventDetails tests for TOOL_EXECUTION_COMPLETE omit the model field from the raw dict, so the truthy branch is never reached.
Expected test: A TOOL_EXECUTION_COMPLETE event whose raw data includes "model": "claude-sonnet-4" should produce a details string containing "model=claude-sonnet-4".
Regression risk
Both are display-path branches — a silent regression would cause incorrect or missing information in copilot-usage session <id> detail output without failing any test. The branches are simple enough that a single parametrized test covers each case.
Generated by Test Suite Analysis · ● 8.6M · ◷
Summary
Two code branches in
render_detail._build_event_detailsare never exercised by the current test suite, so regressions there can't be caught by CI.Gap 1 —
SESSION_SHUTDOWNwithshutdownType=NoneLocation:
src/copilot_usage/render_detail.py:156SessionShutdownData.shutdownTypeis typedstr | None, so the field is legitimately absent in some real events. When the field isNoneor"", the function returns"".TestBuildEventDetails.test_session_shutdown_detailsonly exercises the truthy case (shutdownType="routine"). The else branch (shutdownType is None→"") has zero test coverage.Expected test: An
EVENT_TYPE.SESSION_SHUTDOWNevent with aSessionShutdownDatawhoseshutdownTypeisNone(or omitted from the rawdatadict) should make_build_event_detailsreturn"".Gap 2 —
TOOL_EXECUTION_COMPLETEwith non-NonemodelfieldLocation:
src/copilot_usage/render_detail.py:149–150ToolExecutionData.modelis optional. When present it should appear in the detail string asmodel=<name>. All three existingTestBuildEventDetailstests forTOOL_EXECUTION_COMPLETEomit themodelfield from the raw dict, so the truthy branch is never reached.Expected test: A
TOOL_EXECUTION_COMPLETEevent whose raw data includes"model": "claude-sonnet-4"should produce a details string containing"model=claude-sonnet-4".Regression risk
Both are display-path branches — a silent regression would cause incorrect or missing information in
copilot-usage session <id>detail output without failing any test. The branches are simple enough that a single parametrized test covers each case.