Skip to content

Persist Codex usage stats#34

Merged
corylanou merged 2 commits into
mainfrom
symphony/digitaldrywood_symphony_22
May 21, 2026
Merged

Persist Codex usage stats#34
corylanou merged 2 commits into
mainfrom
symphony/digitaldrywood_symphony_22

Conversation

@corylanou
Copy link
Copy Markdown

Context

Fixes #22. Symphony token and runtime stats reset on restart, which hides cumulative usage and completed-session history.

TL;DR

Persist run and Codex session stats in SQLite and show lifetime totals.

Summary

  • Add a SQLite-backed stats facade for Symphony runs and Codex sessions.
  • Persist run aggregates, completed sessions, shutdown snapshots, and model names.
  • Add lifetime totals and recent sessions to /api/v1/state and the dashboard.
  • Document the durable stats database and API fields.

Alternatives

Test Plan

  • make -C elixir all
  • mix test test/symphony_elixir/stats_test.exs test/symphony_elixir/orchestrator_status_test.exs test/symphony_elixir/extensions_test.exs

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 95aeac3d91

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread elixir/lib/symphony_elixir/stats/sqlite.ex Outdated
@corylanou
Copy link
Copy Markdown
Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7b00a1d2e0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread elixir/lib/symphony_elixir/stats.ex Outdated
corylanou and others added 2 commits May 21, 2026 10:33
Summary:
- Add a SQLite-backed stats facade for Symphony runs and Codex sessions.
- Persist run aggregates, completed session rows, and shutdown snapshots.
- Surface lifetime totals and recent sessions in the dashboard/API.

Rationale:
- Token and runtime history should survive orchestrator restarts.
- The raw SQLite shell stays isolated behind a testable Stats module.

Tests:
- make all

Co-authored-by: Codex <codex@openai.com>
@corylanou corylanou force-pushed the symphony/digitaldrywood_symphony_22 branch from 7b00a1d to e9c8092 Compare May 21, 2026 15:35
@corylanou
Copy link
Copy Markdown
Author

[codex] Changes since last review:

  • Rebased PR Persist Codex usage stats #34 onto current origin/main (3be08c1).
  • Resolved merge conflicts by preserving GitHub startup validation, blocked-agent handling, and stats run persistence.
  • Fixed quoted --model extraction and added focused stats coverage.

Commits: a4b5e99, e9c8092
Tests: mix test test/symphony_elixir/stats_test.exs test/symphony_elixir/stats/sqlite_test.exs test/symphony_elixir/orchestrator_status_test.exs test/symphony_elixir/core_test.exs; make all.

@corylanou corylanou merged commit b61b4d5 into main May 21, 2026
3 checks passed
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.

Persist token stats and runtime across Symphony restarts

1 participant