Repository navigation
fix(core): let due bench probes recover quota-exhausted pools - #1473
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aee912ad6f
ℹ️ 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".
| if (!target) continue | ||
| const credentialID = credentialOf?.(leaf) | ||
| if (!quotaOut(target, credentialID, now, location)) continue | ||
| if (probeDue(target, credentialID, now)) continue |
There was a problem hiding this comment.
Keep independently quota-gated leaves in the exhaustion count
When a benched leaf learns an early reset and subsequently receives a known-full snapshot with a later reset (or acquires a balance hold), probeDue() becomes true at the earlier reset even though its independent quota gate still blocks recovery. armBenchProbe() deliberately retains the earliest reset, so this condition is possible through the existing quota observers. Unconditionally removing that leaf from the count makes a three-leaf pool with two quota-out members appear recovered, allowing the resolver to select the untried third member rather than the outside fallback, even though neither exhausted member can actually probe. Only carve out a due probe when its independent quota gate also permits admission; otherwise the pool's hard exclusion is lifted prematurely.
Useful? React with 👍 / 👎.
|
Agent note - handed off
|
aee912a to
5553005
Compare
5553005 to
1dafe0f
Compare
|
Fixed in the rebased head (1dafe0f) — thank you, the scenario is reachable exactly as described:
Regression test added in model-route.test.ts: "a due probe behind an independent quota gate still counts toward its pool (#1390, Codex PR #1473)" — benches two leaves, arms the first leaf's probe at the early reset (pool verdict lifts), then observes a fresher known-full snapshot with a later reset and asserts the still-due probe counts again and the pool is exhausted. Targeted suites: 220 pass / 0 fail; typecheck clean. |
Closes #1390.
Pool quota exclusion counted every quota-out leaf toward POOL_QUOTA_LEAVES with no probe-due carve-out, so leaves whose bench probes were due after a trusted reset still exhausted the pool and the resolver excluded even the due probes, defeating the half-open recovery path for up to the escalated cooldown.
Verification:
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.