Conversation
…863) The shutdown-cycles detail table displayed a column labelled 'Model Calls' whose values were actually API request counts from the session.shutdown payload. This conflicted with the summary table's 'Model Calls' column which shows turn-start event counts — a different metric. Rename the column to 'API Requests' to accurately reflect its content and avoid the cross-view naming collision. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Renames the shutdown-cycles detail table column header from “Model Calls” to “API Requests” to correctly reflect that the value is derived from session.shutdown modelMetrics[*].requests.count, avoiding confusion with the summary table’s turn-start-based “Model Calls” metric.
Changes:
- Updated
_render_shutdown_cyclesto label the requests-count column as “API Requests”. - Added focused unit tests to assert the new header is present and the old header is absent in shutdown-cycles output.
- Updated test comments/docstrings to match the new terminology.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/copilot_usage/render_detail.py |
Renames the shutdown-cycles table column header to “API Requests”. |
tests/copilot_usage/test_render_detail.py |
Adds/updates tests and docstrings validating the header rename in shutdown-cycles rendering. |
tests/copilot_usage/test_report.py |
Updates a comment to reflect the new column name. |
Contributor
There was a problem hiding this comment.
Low-impact column header rename with good test coverage. Auto-approving for merge.
Evaluated:
- 1 production line changed (
render_detail.py): string literal rename only - 2 meaningful tests added (
TestShutdownCyclesColumnHeader): positive and negative assertions - Existing test names, docstrings, and comments updated consistently
- CI green (all 8 checks pass), follows coding guidelines
- No logic, API, or data model changes — purely cosmetic display fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #863
Summary
The shutdown-cycles detail table (
_render_shutdown_cycles) had a column labelled "Model Calls" that actually displayed API request counts from thesession.shutdownpayload'smodelMetrics. This conflicted with the summary session table's "Model Calls" column, which showsassistant.turn_startevent counts — a fundamentally different metric.Changes
src/copilot_usage/render_detail.py: Renamed column header from"Model Calls"to"API Requests"in_render_shutdown_cyclestests/copilot_usage/test_render_detail.py:TestShutdownCyclesColumnHeaderwith two tests:test_api_requests_header_present— asserts"API Requests"appears in rendered outputtest_model_calls_header_absent— asserts"Model Calls"does not appear in shutdown-cycles outputtests/copilot_usage/test_report.py: Updated comment referencing the columnVerification
All 1242 unit tests pass, 86 e2e tests pass, pyright strict mode passes with 0 errors, and coverage remains at 99%.