fix: remove misleading 'Since Last Shutdown' from active sessions title (#1072)#1074
fix: remove misleading 'Since Last Shutdown' from active sessions title (#1072)#1074
Conversation
The active-sessions table title in _render_active_section_from hardcoded 'Since Last Shutdown', which is inaccurate for pure-active sessions (has_shutdown_metrics=False) that have never had a shutdown event. Change the title to '🟢 Active Sessions' unconditionally (Option A from issue #1072). The columns already convey what data is being shown. - Update existing resumed-session test to assert absence of qualifier - Add new test for pure-active sessions verifying no 'Since Last Shutdown' - Update e2e _ACTIVE_MARKER constant to match new title Closes #1072 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Removes the misleading “Since Last Shutdown” qualifier from the Active Sessions table title so it is accurate for both resumed sessions and pure-active sessions.
Changes:
- Update the Rich table title in the interactive summary active section to “🟢 Active Sessions”.
- Adjust unit tests to assert the qualifier is absent, and add a regression test for pure-active sessions.
- Update the e2e active-section marker to match the new title text.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/copilot_usage/report.py |
Updates the active sessions table title to remove the “Since Last Shutdown” qualifier. |
tests/copilot_usage/test_report.py |
Updates existing assertions and adds a new unit test ensuring the qualifier never appears for pure-active sessions. |
tests/e2e/test_e2e.py |
Updates the string marker used to split historical vs active output in interactive e2e tests. |
The Table() constructor call was left in multi-line format after shortening the title string. With the shorter title, the call fits on a single line (66 chars < 88 line limit), so ruff format requires it to be collapsed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
CI Fix Applied 🔧 The Root cause: The Fix: Collapsed the Warning
|
| table = Table(title="🟢 Active Sessions", border_style="green") | ||
| table.add_column("Name", style="bold", max_width=40) | ||
| table.add_column("Model") | ||
| table.add_column("Model Calls", justify="right") |
There was a problem hiding this comment.
The render_full_summary docstring still says “Section 2: Active sessions since last shutdown.” (see report.py around lines 593–596), but the section title is now unqualified and the active stats can represent full-lifetime data for pure-active sessions. Please update the docstring to match the new behavior to avoid misleading future maintainers.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Commit pushed:
|
|
❌ Pipeline orchestrator: review-response loop reached 5 rounds. Marking as stuck for human review. |
Summary
_render_active_section_frominreport.pyhardcoded the table title "🟢 Active Sessions (Since Last Shutdown)" for all active sessions — including pure-active sessions that have never had a shutdown event (has_shutdown_metrics=False).This changes the title to "🟢 Active Sessions" unconditionally (Option A from the issue). The columns already indicate what data is being shown; the parenthetical qualifier only added confusion for pure-active sessions.
Changes
src/copilot_usage/report.py: Change table title from"🟢 Active Sessions (Since Last Shutdown)"to"🟢 Active Sessions"tests/copilot_usage/test_report.py: Update existing resumed-session test to assert absence of qualifier; add newtest_pure_active_section_title_no_since_last_shutdowntesttests/e2e/test_e2e.py: Update_ACTIVE_MARKERconstant to match new titleCloses #1072
Warning
The following domains were blocked by the firewall during workflow execution:
astral.shindex.crates.iopypi.orgTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.