Skip to content

Add codexbar guard CLI subcommand#218

Closed
Finesssee wants to merge 1 commit into
mainfrom
port/045-cli-guard
Closed

Add codexbar guard CLI subcommand#218
Finesssee wants to merge 1 commit into
mainfrom
port/045-cli-guard

Conversation

@Finesssee

@Finesssee Finesssee commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

Ports upstream codexbar guard for Windows automation quota gates.

  • codexbar guard --provider <id> checks remaining quota on session (primary) or weekly (secondary) windows
  • Stable exit codes: 0 ok, 1 blocked (below threshold), 64 invalid args, 69 unavailable
  • --min-remaining (default 10), --window session|weekly, --timeout, --json/--pretty, --fail-open
  • Bounded fetch through existing instantiate_provider + fetch_usage paths
  • Unit tests for pure exit-code mapping, headroom, arg validation, and timeout

Invoke

cargo run -p codexbar -- guard --provider claude
cargo run -p codexbar -- guard --provider claude --min-remaining 20 --window weekly
cargo run -p codexbar -- guard --provider codex --json --pretty
cargo run -p codexbar -- guard --provider claude --fail-open

Test plan

  • cargo test --manifest-path rust/Cargo.toml --lib guard (18 passed)
  • Manual: codexbar guard --provider <configured> with live credentials

No version bump.


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

Port upstream CodexBar guard: check one provider window against a
minimum remaining threshold with stable exit codes (0/1/64/69),
JSON output, --fail-open, and bounded fetch via existing providers.
@github-actions

Copy link
Copy Markdown

This repository allows each user to open at most 4 pull requests per 7 days.

Closing this automatically.

@github-actions github-actions Bot closed this Jul 21, 2026
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