Skip to content

feat(command): add stats + end of session stats#48

Merged
CLEMENTINATOR merged 7 commits intomainfrom
edgee-gain
Apr 9, 2026
Merged

feat(command): add stats + end of session stats#48
CLEMENTINATOR merged 7 commits intomainfrom
edgee-gain

Conversation

@CLEMENTINATOR
Copy link
Copy Markdown
Member

  • refactor: extract config_dir() helper to centralize config path logic
  • feat: fetch and display rich session stats after tool exit
  • feat: add stats command to view stored session history

Checklist

  • I have read the Contributor Guide
  • I have read and agree to the Code of Conduct
  • I have added a description of my changes and why I'd like them included in the section below

Description of Changes

Describe your changes here

Related Issues

List related issues here

@CLEMENTINATOR CLEMENTINATOR requested a review from a team as a code owner April 7, 2026 16:31
Copy link
Copy Markdown
Member

@SachaMorard SachaMorard left a comment

Choose a reason for hiding this comment

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

I can't make it work. It seems to be an API problem, but get_session_stats always returns a 404

@SachaMorard
Copy link
Copy Markdown
Member

I can't make it work. It seems to be an API problem, but get_session_stats always returns a 404

@CLEMENTINATOR forget it, I get why now.

@CLEMENTINATOR
Copy link
Copy Markdown
Member Author

I can't make it work. It seems to be an API problem, but get_session_stats always returns a 404

@CLEMENTINATOR forget it, I get why now.

needs an api update on prod :D

CLEMENTINATOR and others added 5 commits April 9, 2026 09:34
Co-Authored-By: Clement <noreply@users.noreply.github.com>
After a session ends, call the API to retrieve token usage, cost, and
compression stats. Persist each session to ~/.config/edgee/session-stats/
as JSON, then render a formatted summary in the terminal. Falls back
gracefully to the plain URL if the API call fails.

Deduplicates the session-end display block that was repeated across
claude.rs, codex.rs, and opencode.rs into a single shared
print_session_stats() function in launch/mod.rs.

Co-Authored-By: Clement <noreply@users.noreply.github.com>
The new `edgee stats` command reads all persisted session JSON files,
prints an aggregate summary (requests, cost, savings, tokens, errors),
renders the latest session in full detail, then lists all sessions in
a compact table. Supports --limit to cap the table length.

Co-Authored-By: Clement <noreply@users.noreply.github.com>
- Fix cost display: trim to 6 significant decimal places (was always 9)
- Shorten timestamps to "YYYY-MM-DD HH:MM" in all stat views
- Collapse Overview savings onto one line, removing fragile space alignment
- Session list: single line per entry, drop the noisy session-ID second line
- Add ASCII progress bars (█/░) for compression rate in session recap and list

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@CLEMENTINATOR CLEMENTINATOR merged commit d8e1456 into main Apr 9, 2026
4 checks passed
@CLEMENTINATOR CLEMENTINATOR deleted the edgee-gain branch April 9, 2026 08:06
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