Skip to content

Add time-range, session, and prompt reporting - #5

Closed
suutari wants to merge 18 commits into
springernature:mainfrom
suutari:main
Closed

suutari wants to merge 18 commits into
springernature:mainfrom
suutari:main

Conversation

@suutari

@suutari suutari commented Sep 21, 2026

Copy link
Copy Markdown

This PR expands occe with more flexible reporting and interactive TUI navigation.

New features:

  • Installable occe console script.
  • Calendar selectors for:
    • Months via --month YYYY-MM
    • ISO weeks via --week
    • Days via --day
    • Hours via --hour
  • Session-level reporting with --sessions.
  • Filtering by OpenCode session with --session.
  • Prompt reporting with --prompts, including:
    • Short, long, and full display modes
    • Prompt timestamps and project/session metadata
    • Per-prompt token and credit usage
    • Table and JSON output
  • TUI session, model, and prompt breakdown views.
  • TUI navigation between adjacent periods using f/b or arrow keys.
  • Derived time ranges across the hour, day, week, and month tabs.

Additionally includes some fixes:

  • Today and week chart labels now use local time consistently.
  • Month chart boundaries and daily buckets now use local calendar dates.
  • Month chart points align correctly with their displayed day labels.

Package the top-level modules so uv installs a working launcher when the
project environment is synchronized.  Record the new command in the
Unreleased changelog and ignore generated setuptools metadata.
Group OpenCode messages by session and expose the breakdown through with
table or JSON output.  Preserve the existing model-based output and
document the new report.
Allow reports and the TUI to estimate a selected calendar month with .
Label historical output and the TUI tab with the selected period while
preserving the existing session reports.
Limit TUI charts and non-interactive reports to a selected OpenCode
session while keeping month and session aggregation options composable.
Give project and session names more room and align session IDs under the
Session column for the existing unreleased session report.
Print user prompts and their token, cache, request, and credit data for
a selected OpenCode session.  Support short, long, and full text modes
with table and JSON output.
Support week, day, and hour selectors across the TUI and non-interactive
reports.  Derive the other TUI tabs from the selected anchor so
historical periods remain internally consistent.
Allow browsing adjacent periods with the arrow keys or N/P and return to
live ranges with R.  Keep the configured refresh interval active while
the TUI follows current time.
Allow the TUI breakdown table to switch between model and OpenCode
session views while retaining the current time range and refresh
behavior.
Use local-midnight boundaries and local-time bucket labels for the Today
chart so its visible timeline matches the selected local calendar day.
Align local-month buckets and cumulative chart points with calendar-day
labels, including the current day and the final day boundary.
Provide a prompt view in the TUI for inspecting timestamps, projects,
prompt content, and usage data in the existing breakdown table.
Use the remaining table width for Session names while keeping the Project and usage columns fixed, matching the prompt table layout.
Let Textual clip session titles according to the flexible Session column
width instead of truncating them to the model-name limit before
rendering.
Use `p` for the prompt view and `f`/`b` for forward/backward period
navigation while retaining the arrow keys as aliases.
Map the TUI `today` tab name to the `day` selector before deriving
ranges so commands such as `--day ... --sessions` complete successfully.
@sonniesedge

Copy link
Copy Markdown
Collaborator

Thanks for contributing these reporting improvements! Before we merge, could you please address two issues I found during review?

  • The built wheel does not include resources/github-copilot-pricing-snapshot.json (uv build and unzip -l confirm this). pricing.py relies on it as the bundled fallback, so a fresh installation without a successful pricing fetch may show zero credit estimates. Please include the snapshot in the distributable and verify a fresh offline install.
  • scripts/preflight.sh currently fails 3 of 67 tests: test_today_series_starts_at_local_midnight, test_current_month_series_includes_today_bucket, and test_august_month_and_day_series_use_the_same_local_day. Could you fix the local-time day/month chart buckets and rerun preflight?

Once these are fixed, we would be happy to merge the PR. Thanks again!

@suutari suutari closed this Oct 21, 2026
@suutari

suutari commented Oct 21, 2026

Copy link
Copy Markdown
Author

I fixed the issues you mentioned and have them in my fork's main branch, but the PR didn't seem to update. I'll create another PR to get them here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants