Skip to content

fix(combos): retry single targets only after cooldown - #586

Open
luvs01 wants to merge 3 commits into
devfrom
codex/fix-single-target-combo-retry-issue
Open

luvs01 wants to merge 3 commits into
devfrom
codex/fix-single-target-combo-retry-issue

Conversation

@luvs01

@luvs01 luvs01 commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Motivation

  • A single-target combo retry path re-enabled the attempted target without confirming it had entered cooldown, allowing immediate duplicate dispatch for request-local refusals that intentionally record no cooldown.
  • The change ensures that an exclusion-free same-target retry is attempted only when the failed target is actually cooling, preventing one-off resource amplification and preserving the intended semantics for request-local failures.

Description

  • Require the failed target to be actively in cooldown before dropping the attempted-target exclusion in the single-target retry path by checking isComboTargetInCooldown in src/server/responses/core-combo.ts.
  • Keep the existing advanceComboAfterFailure behavior for normal failover and only allow the exclusion-free pickWithWait when the target is cooled.
  • Add an end-to-end regression test tests/server/server-combo-failover-e2e.test.ts that verifies a request-local incompatibility (Unsupported parameter: user / HTTP 400) is not retried when waitForCooldownMs is set.
  • Changes touched: src/server/responses/core-combo.ts and tests/server/server-combo-failover-e2e.test.ts.

Testing

  • Ran bun run typecheck which completed successfully.
  • Ran the focused test suite with ./node_modules/.bin/bun test tests/server/server-combo-failover-e2e.test.ts and observed all relevant cases pass (focused run and the full file run both passed; the full file run reported 177 passed, 0 failed).
  • Ran bun run structure:check which passed.
  • Performed git diff --check with no issues reported; note that running bun test with an older system Bun (1.2.14) surfaced a tooling mismatch (node:zlib export) unrelated to this code change, while the repository-local Bun (v1.4.0) used for the focused test runs passed the suite.

Codex Task


Devin Review

devin-ai-integration Bot and others added 2 commits September 20, 2026 13:22
…forwarded role (lidge-jun#5334 follow-up)

lidge-jun#5334 made the developer wire role tri-state: an undeclared destination folds
it to system. Two suites asserting role:"developer" on the Chat wire were
missed because they are about tool-result repair ordering and document parts,
not role selection — declare the destination, per the convention the change
established.

Verified: both files fail on dev@600075d2 with system-for-developer wire roles
and pass with the declaration.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Sep 21, 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: Repository: luvs01/opencodex/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 9e05c532-cda8-46dd-b9ce-9a2c2c537530


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 Sep 21, 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-09-21T00:45:45.581775Z 4e22463 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

Copy link
Copy Markdown

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Sep 21, 2026
devin-ai-integration[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

A concurrent request can cool the shared target while this request's own
failure recorded no cooldown (scope "none"), so isComboTargetInCooldown
alone was enough to arm the exclusion-free retry and replay a refused
request. Require a cooldown-producing scope alongside the shared-state
check, and cover the interleaving with a synchronized two-request test.

Co-Authored-By: Epinephrine <luvs01@hanmail.net>
@devin-ai-integration

Copy link
Copy Markdown

Fixed in 5d00b3a. comboFailureCooldownScope(...) is now computed once before advanceComboAfterFailure and kept; failedTargetCooled additionally requires failureCooldownScope !== "none", so a cooldown written by a concurrent request no longer arms the exclusion-free retry for a request-local refusal. Added a synchronized two-request regression test (a concurrent cooldown does not retry a request-local refusal) covering exactly this interleaving — verified to fail on the unfixed code.

@devin-ai-integration

Copy link
Copy Markdown

Fixed in 5d00b3a. The retry gate now preserves this failure's computed cooldown scope and requires both a cooldown-producing scope (!== "none") and an active target cooldown before dropping the attempted-target exclusion — a foreign cooldown written by a concurrent request can no longer replay this request's request-local rejection. Regression test added: a concurrent cooldown does not retry a request-local refusal.

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