Skip to content

fix(codex): Label usage windows by duration - #27

Merged
euxaristia merged 1 commit into
mainfrom
fix/codex-window-labels
Aug 13, 2026
Merged

fix(codex): Label usage windows by duration#27
euxaristia merged 1 commit into
mainfrom
fix/codex-window-labels

Conversation

@euxaristia

Copy link
Copy Markdown
Owner

Summary

Codex can return a seven-day allowance as primary_window. The CLI currently exposes that API position as "Primary," which hides the actual quota period. This change labels known windows by duration and retains the API position for unknown durations.

Fixes #26

Changes

pkg/parsers/codex.go

  • Label five-hour windows as "Session."
  • Label seven-day windows as "Weekly."
  • Preserve "Primary" or "Secondary" for unknown durations.

pkg/parsers/codex_test.go

  • Update the two-window fixture to assert duration-based labels.
  • Cover a seven-day primary window matching the live response shape.
  • Cover the fallback for unknown durations.

Test plan

  • gofmt -w pkg/parsers/codex.go pkg/parsers/codex_test.go
  • git diff --check
  • go test ./...
  • go vet ./...
  • go build ./...
  • go run . status -p codex displays "Weekly."

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fccbe1e4-9ea4-4443-a4cc-8e755131e84a

📥 Commits

Reviewing files that changed from the base of the PR and between e049ef3 and 8568ea7.

📒 Files selected for processing (2)
  • pkg/parsers/codex.go
  • pkg/parsers/codex_test.go

📝 Walkthrough

Walkthrough

Codex usage windows now use duration-based labels. Tests cover Session, Weekly, and fallback labels for unknown durations.

Changes

Codex window labelling

Layer / File(s) Summary
Duration-based window labels
pkg/parsers/codex.go, pkg/parsers/codex_test.go
The parser labels five-hour windows as Session and seven-day windows as Weekly. Unknown durations retain Primary or Secondary labels. Tests cover these cases.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

A rabbit checks the windows bright,
Five hours glow as Session light.
Seven days wear Weekly cheer,
Unknown paths keep labels clear.
Hop, hop—the quotas now appear!

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@euxaristia
euxaristia marked this pull request as ready for review August 13, 2026 07:48
@euxaristia
euxaristia merged commit 66b7122 into main Aug 13, 2026
1 of 4 checks passed
@euxaristia
euxaristia deleted the fix/codex-window-labels branch August 22, 2026 06:30
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.

Codex usage windows should show their time period

1 participant