Skip to content

fix: rename 'Model Calls' to 'API Requests' in shutdown-cycles table (#863)#868

Merged
microsasa merged 1 commit intomainfrom
fix/863-rename-model-calls-to-api-requests-a0951e44c94a44e8
Apr 8, 2026
Merged

fix: rename 'Model Calls' to 'API Requests' in shutdown-cycles table (#863)#868
microsasa merged 1 commit intomainfrom
fix/863-rename-model-calls-to-api-requests-a0951e44c94a44e8

Conversation

@microsasa
Copy link
Copy Markdown
Owner

Closes #863

Summary

The shutdown-cycles detail table (_render_shutdown_cycles) had a column labelled "Model Calls" that actually displayed API request counts from the session.shutdown payload's modelMetrics. This conflicted with the summary session table's "Model Calls" column, which shows assistant.turn_start event counts — a fundamentally different metric.

Changes

  • src/copilot_usage/render_detail.py: Renamed column header from "Model Calls" to "API Requests" in _render_shutdown_cycles
  • tests/copilot_usage/test_render_detail.py:
    • Added TestShutdownCyclesColumnHeader with two tests:
      • test_api_requests_header_present — asserts "API Requests" appears in rendered output
      • test_model_calls_header_absent — asserts "Model Calls" does not appear in shutdown-cycles output
    • Updated docstrings and comments to reflect the new column name
  • tests/copilot_usage/test_report.py: Updated comment referencing the column

Verification

All 1242 unit tests pass, 86 e2e tests pass, pyright strict mode passes with 0 errors, and coverage remains at 99%.

Generated by Issue Implementer · ● 6.5M ·

…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>
@microsasa microsasa added the aw Created by agentic workflow label Apr 8, 2026
Copilot AI review requested due to automatic review settings April 8, 2026 18:48
@microsasa microsasa enabled auto-merge April 8, 2026 18:48
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_cycles to 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.

@microsasa microsasa added the aw-quality-gate-approved Quality gate approved the PR label Apr 8, 2026
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@microsasa microsasa merged commit b4c502e into main Apr 8, 2026
8 checks passed
@microsasa microsasa deleted the fix/863-rename-model-calls-to-api-requests-a0951e44c94a44e8 branch April 8, 2026 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aw Created by agentic workflow aw-quality-gate-approved Quality gate approved the PR

Projects

None yet

2 participants