Skip to content

[WRONG BRANCH] fix(kiro): honor exhausted account cooldown on rotation - #400

Draft
luvs01 wants to merge 1 commit into
mainfrom
codex/propose-fix-for-kiro-cooldown-issue
Draft

[WRONG BRANCH] fix(kiro): honor exhausted account cooldown on rotation#400
luvs01 wants to merge 1 commit into
mainfrom
codex/propose-fix-for-kiro-cooldown-issue

Conversation

@luvs01

@luvs01 luvs01 commented Aug 31, 2026

Copy link
Copy Markdown
Owner

Motivation

  • A logic bug made the rotation path treat a missing or malformed Retry-After as if no exhausted-cooldown applied because the parser returns undefined (not null), so Kiro accounts known to be exhausted received only the one-minute fallback and could re-enter rotation prematurely.

Description

  • Change the sentinel check in rotateGenericOAuthAccountOn429 to use parsed === undefined so exhaustedCooldownMs is consulted when Retry-After is absent or invalid, restoring the reset-aligned cooldown for Kiro accounts.
  • Add an integration regression test in tests/kiro-pool-rank.test.ts (rotation uses the reset-aligned cooldown when Retry-After is absent) that seeds a two-account Kiro OAuth pool, marks one account exhausted with a future reset, triggers rotation with no Retry-After, and verifies the exhausted account remains ineligible past the one-minute fallback.
  • Adjust test imports to expose eligibleFailoverAccounts for the new assertion; no behavioral changes outside the rotation cooldown selection were made.

Testing

  • Ran the focused tests with the repository Bun: node_modules/.bin/bun test tests/kiro-pool-rank.test.ts, which passed (23 tests passed).
  • Ran type checking with bun run typecheck, which succeeded.
  • Ran the privacy scan with bun run privacy:scan, which passed.
  • Noted that the system Bun (v1.2.14) lacks node:zlib exports required by this checkout and failed the focused test run there, but the repository-local Bun v1.4.0 successfully executed the tests; bun run test:changed was not run due to no resolvable upstream dev comparison ref in this environment.

Codex Task

@github-actions

Copy link
Copy Markdown

Deterministic PR hygiene checks passed.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 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 Completed 2026-08-31T01:47:20.559414Z f5b4020 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.

@github-actions github-actions Bot added the bug Something isn't working label Aug 31, 2026
@github-actions github-actions Bot changed the title fix(kiro): honor exhausted account cooldown on rotation [WRONG BRANCH] fix(kiro): honor exhausted account cooldown on rotation Aug 31, 2026
@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown

⏳ DRAFT

  • wrong target branch (main); retarget to dev.

What to do

  • Retarget this PR to dev — all contributions go to dev.

Its title has been prefixed with [WRONG BRANCH].
This pull request was already a draft. Its draft status will be preserved after every issue above is resolved.

@github-actions
github-actions Bot marked this pull request as draft August 31, 2026 01:46
@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 0aea3860-7c67-4b7d-bea7-546f910b23ec


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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aardvark bug Something isn't working codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant