Repository navigation
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueWalkthrough
Merge Risk:
|
|
✅ Deterministic PR hygiene checks passed. |
|
No description provided. |
Complete the fork fix on current dev with atomic physical admission, owned retry reporting, credential recovery, and native-wire regressions.
| if (!options?.deferDispatch && !options?.workflowAlreadyCounted) { | ||
| if (alreadySent) chargeWorkflowSends(rootId, 1); | ||
| else if (!claimWorkflowSend()) return false; | ||
| } |
There was a problem hiding this comment.
🟡 Failed token admission consumes a workflow send slot
A direct charge with an exhausted token budget claims a workflow slot before the token reservation fails. No send occurs, but later turns can reach the workflow ceiling early.
Learn more
The spend tracker books a root workflow send before it tries to reserve tokens for a direct, undispatched charge. The token reservation can refuse in ensureSeed or reserve, but neither refusal undoes the earlier workflow claim. This affects direct tracker charges without deferDispatch; the execution-budget reservation path uses deferDispatch and does not take this branch. The claimed slot persists in the window despite no physical send.
Example: A tracked root has one remaining send slot, while its provider pool has no token allowance. Calling tracker.charge() returns false for the pool limit, but the root's send count rises by one; a later request to another provider is refused for reaching the send ceiling.
Recommended fix: Reserve the workflow slot only after durable admission succeeds, or add a precise refund to every failed direct-charge exit. Keep the root check and claim in one synchronous admission sequence, and test that a refused token reservation leaves the workflow count unchanged.
Was this helpful? React with 👍 or 👎 to provide feedback.
| claimPhysicalSend(): number | undefined { | ||
| budget.startRequest?.(); | ||
| if (observer?.enforced !== true || counter.physicalLimit === undefined) return undefined; | ||
| if (counter.physicalStarted >= counter.physicalLimit) return undefined; | ||
| if (counter.physicalStarted >= counter.physicalLimit || !budget.claimWorkflowSend!()) return undefined; | ||
| return ++counter.physicalStarted; |
There was a problem hiding this comment.
🔍 Verification record does not match the reviewed commit
The description names an older commit and says enforced reporters bypass workflow admission. This head adds that admission path, but its description supplies no matching test results. Update the verification record for this commit.
Was this helpful? React with 👍 or 👎 to provide feedback.
Keep the workflow registration away from the direct-tool-choice registration so both focused fixes merge without a layout conflict.
Transferred upstream
The completed fix and regression coverage continue in lidge-jun/opencodex#8149, targeting
dev. This fork-local PR is closed as transferred; its branch remains the source of the open upstream PR.The source branch now points to
0b3dc28265d74205b39aa8c6c54dcd9fb6886a23, whose tree2a0ee9945f81eb9c9e6751ca3d1046cf184706c4matches the locally validated tree. The upstream PR is ready for review and contains the original commitcf80887e939d031154d2a672690cad2f958830d4.Completed work
Verification
0b3dc28265d74205b39aa8c6c54dcd9fb6886a23passed upstream Cross-platform CI 41764102474, Catalog 41764102515 and CodeRabbit. All six upstream inline findings are resolved. The upstream PR records the exact local environment limitations and non-blocking follow-up suggestions.The original draft's failed checks and incomplete reporter path describe historical state; they are superseded by the completed implementation and verification recorded in the upstream PR. The security finding remains open until the fix is accepted and applied upstream.
Original Codex task