Skip to content

feat(codex): honor auto strategy and per-window thresholds - #20

Merged
errhythm merged 3 commits into
errhythm:mainfrom
GiorgoLazaridis:feat/codex-auto-strategy
Oct 26, 2026
Merged

errhythm merged 3 commits into
errhythm:mainfrom
GiorgoLazaridis:feat/codex-auto-strategy

Conversation

@GiorgoLazaridis

@GiorgoLazaridis GiorgoLazaridis commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Closes #15.

ccswap codex auto now honors the shared autoswitch.strategy, autoswitch.threshold5h and autoswitch.threshold7d settings, as discussed in #15. The 7d gate maps to Codex Weekly; model gates do not apply.

  • consume-first prefers the soonest future Weekly reset. Below the threshold it moves only to an eligible account resetting strictly sooner, respecting cooldown.
  • Candidates are ranked by their distance to the configured gates; poll events still report actual quota headroom.
  • The threshold7d help text and docs now describe Codex support.

Default settings retain existing behavior.

Validation: full pytest suite on Linux with Python 3.12 and 3.13: 2762 passed, 3 skipped each. Includes regressions for window gates, candidate ranking, cooldown, unknown/past resets and dry-run. git diff --check and gitleaks passed. GitHub CI passes on Linux, Windows and macOS (test, test-windows, macos-keychain).

Giorgo Lazaridis added 3 commits October 25, 2026 19:41
…holds

`ccswap codex auto` used one threshold and always picked the most
headroom; `autoswitch.strategy`, `threshold5h` and `threshold7d` only
affected Claude.

Now the 5h gate applies to Codex's 5-hour window and the 7d gate to its
Weekly window, through the same binding_pct gate math the Claude engine
uses, so a candidate must also clear every gate. With `consume-first`
the engine moves, even below the threshold, to an account whose Weekly
window resets strictly sooner and still has room, and at the limit it
ranks candidates by soonest Weekly reset. Cooldown applies to those
moves like to proactive ones.

With default settings the decisions, events and messages are unchanged.
@coderabbitai

coderabbitai Bot commented Oct 26, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cb6bc7c0-57bc-4944-a79e-d4b1194e8320
Commits

Reviewing files that changed from the base of the PR and between 48ecf54 and 260712b.

Files selected for processing: 6
  • CHANGELOG.md
  • docs/auto-switching.md
  • docs/codex.md
  • src/claude_swap/codex_autoswitch.py
  • src/claude_swap/settings.py
  • tests/test_codex_autoswitch.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-26T15:58:06.716751Z
We couldn’t complete this review. Comment @codex review to try again.
260712b PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@errhythm
errhythm merged commit 39f6724 into errhythm:main Oct 26, 2026
4 checks passed
errhythm added a commit that referenced this pull request Oct 27, 2026
#20 brought it back. Release notes live on the GitHub release.
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 auto: honor autoswitch.strategy and the per-window thresholds?

2 participants