Skip to content

feat(routing): choose quota window for earlier reset#795

Closed
Komzpa wants to merge 14 commits into
mainfrom
repair/pr-644-replacement
Closed

feat(routing): choose quota window for earlier reset#795
Komzpa wants to merge 14 commits into
mainfrom
repair/pr-644-replacement

Conversation

@Komzpa
Copy link
Copy Markdown
Collaborator

@Komzpa Komzpa commented May 24, 2026

Summary

Rebases and repairs #644 on current main, preserving the original feature from @wuchao05 while resolving the merge conflicts and migration-head drift.

This keeps the existing weekly-quota default for prefer earlier reset routing, and adds an operator setting to choose whether that preference is driven by the primary 5h quota window or the secondary weekly window.

Supersedes and credits #644.

Changes

  • Store prefer_earlier_reset_window in dashboard settings with API/schema support.
  • Thread the selected reset window through account selection, proxy routing, Codex control, HTTP bridge, and websocket selection paths.
  • Track primary reset timestamps in balancer account state.
  • Add dashboard controls and payload/schema/test coverage for 5h quota vs Weekly quota.
  • Add a current-main Alembic merge revision so the migration graph has a single head again.
  • Preserve compatibility for internal/test helper callers that predate the new reset-window kwarg.

Validation

  • uv run pytest -q -ra -n 8 -o faulthandler_timeout=300 -o faulthandler_exit_on_timeout=true --timeout=180 --timeout-method=thread --durations=20 tests/unit/test_load_balancer.py tests/unit/test_proxy_http_bridge.py tests/unit/test_proxy_utils.py tests/integration/test_settings_api.py tests/integration/test_http_responses_bridge.py::test_v1_responses_http_bridge_creation_honors_prefer_earlier_reset — 559 passed
  • cd frontend && bun run test src/features/settings/components/routing-settings.test.tsx src/features/settings/schemas.test.ts src/features/settings/hooks/use-settings.test.ts src/features/settings/payload.test.ts — 14 passed
  • uv run codex-lb-db --db-url <tmp sqlite> upgrade head && uv run codex-lb-db --db-url <tmp sqlite> checkmigration_policy=ok, schema_drift=none
  • uvx ruff check app tests && uvx ruff format --check app tests

@github-actions github-actions Bot added the db migration PR changes Alembic database migrations; maintainer must coordinate merge order label May 24, 2026
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: e30fef5140

ℹ️ 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 app/modules/proxy/service.py Outdated
@Soju06 Soju06 added the 🤖 codex: needs work [@codex review] raised an issue label May 24, 2026
@Komzpa
Copy link
Copy Markdown
Collaborator Author

Komzpa commented May 24, 2026

@codex review

@Soju06 Soju06 removed the 🤖 codex: needs work [@codex review] raised an issue label May 24, 2026
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: abc675fe13

ℹ️ 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 app/modules/proxy/service.py Outdated
@Soju06 Soju06 added the 🤖 codex: needs work [@codex review] raised an issue label May 24, 2026
@Komzpa
Copy link
Copy Markdown
Collaborator Author

Komzpa commented May 24, 2026

@codex review

@Komzpa Komzpa removed the 🤖 codex: needs work [@codex review] raised an issue label May 24, 2026
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

ℹ️ 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".

@Soju06 Soju06 added 🤖 codex: ok [@codex review] says no issues found. and removed 🤖 codex: ok [@codex review] says no issues found. labels May 24, 2026
@Komzpa Komzpa force-pushed the repair/pr-644-replacement branch from 0c877e3 to d9d6e24 Compare May 26, 2026 15:21
@Komzpa
Copy link
Copy Markdown
Collaborator Author

Komzpa commented May 26, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

ℹ️ 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".

@Soju06 Soju06 added the 🤖 codex: ok [@codex review] says no issues found. label May 26, 2026
@Soju06
Copy link
Copy Markdown
Owner

Soju06 commented Jun 1, 2026

Hermes blocker: this PR changes behavior/API/schema/UI but has no OpenSpec change folder.

Evidence:

  • AGENTS.md:24-28 requires an openspec/changes/** change when behavior, requirements, contracts, or schema change.
  • .github/CONTRIBUTING.md:235-239 makes an OpenSpec change folder a merge gate for non-exempt behavior changes.
  • PR feat(routing): choose quota window for earlier reset #795 adds persisted/API/dashboard behavior (app/db/models.py, app/modules/settings/schemas.py, frontend/src/features/settings/components/routing-settings.tsx) and a DB migration, but git diff --name-only origin/main...HEAD -- openspec is empty.

Requested fix: add the appropriate openspec/changes/<slug>/ proposal/tasks/spec delta for the reset-window preference (and run strict OpenSpec validation), or have the maintainer explicitly waive this gate. Until then this is not merge-ready despite green CI/Codex.

@Soju06 Soju06 added hermes: needs-followup Hermes left a blocker/comment that needs follow-up observation and removed 🤖 codex: ok [@codex review] says no issues found. labels Jun 1, 2026
@Komzpa
Copy link
Copy Markdown
Collaborator Author

Komzpa commented Jun 1, 2026

Superseded by #871, which carries the reset-window routing repair on a current base with the OpenSpec change and migration-head reconciliation. Closing this older dirty repair branch to keep the queue focused on the active replacement.

@Komzpa Komzpa closed this Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

db migration PR changes Alembic database migrations; maintainer must coordinate merge order hermes: needs-followup Hermes left a blocker/comment that needs follow-up observation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants