Skip to content

Add configurable Codex Metrics Bar value#60

Open
petanerd wants to merge 2 commits into
runcat-dev:mainfrom
petanerd:feat/configurable-codex-metrics-bar
Open

Add configurable Codex Metrics Bar value#60
petanerd wants to merge 2 commits into
runcat-dev:mainfrom
petanerd:feat/configurable-codex-metrics-bar

Conversation

@petanerd

Copy link
Copy Markdown

Context of Contribution

  • Bug Fix
  • Refactoring
  • New Feature
  • Others

Summary of the Proposal

The Codex integration sample currently always uses context-window usage for metricsBarValue, even though the same snapshot also includes account rate-limit data.

This change makes the Metrics Bar value configurable while preserving the existing context-based default and a single Custom Metrics source.

  • Keeps context-window usage as the default for compatibility
  • Supports the remaining 7-day allowance through an optional ~/.codex/runcat-bar-mode file
  • Does not create the mode file automatically
  • Uses context when the mode file is missing or invalid
  • Supports RUNCAT_BAR_MODE and RUNCAT_BAR_MODE_FILE overrides
  • Falls back to the available metric when the selected value is unavailable
  • Documents the difference between card rows and the Metrics Bar value

Validation:

Python syntax compilation — passed
Missing mode file produced the context value with Model, Context, and 7d rows — passed
Weekly mode produced "7d 76%" with the same rows — passed
Git diff whitespace validation — passed

Reason for the new feature

Some Codex users want to monitor their remaining weekly account allowance rather than the context usage of the current conversation.

RunCat Neo's Custom Metrics toggle controls whether a source is visible in the Metrics Bar, while each source exposes a single metricsBarValue. An optional producer-side setting provides both choices without changing the existing default, creating duplicate cards, or modifying the JSON schema.

Checklist

  • I have read the CONTRIBUTING.md and agree to follow it.
  • This PR does not contain commits of multiple contexts.
  • Code follows proper indentation and naming conventions.
  • Implemented using only APIs that can be submitted to the App Store.

petanerd added 2 commits July 20, 2026 13:26
Signed-off-by: mindongjun <petanerd@gmail.com>
Signed-off-by: mindongjun <petanerd@gmail.com>
@petanerd
petanerd marked this pull request as ready for review July 20, 2026 04:47
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.

1 participant