[WRONG BRANCH] fix(chat-native): share transient send budget across recovery - #387
[WRONG BRANCH] fix(chat-native): share transient send budget across recovery#387luvs01 wants to merge 1 commit into
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. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 535789d404
ℹ️ 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".
| */ | ||
| describe("transient send budget stays request-scoped", () => { | ||
| test("native chat recovery legs cannot re-arm the transient budget", () => { | ||
| const chat = source("server/chat-native.ts"); |
There was a problem hiding this comment.
Exercise the recovery budget through native chat
This test only searches the implementation text, so it can remain green even if the counter is wired at the wrong point or the recovery path exceeds the configured budget at runtime. Add a focused native-chat endpoint regression where the initial send returns 429 and the recovery leg returns persistent 503s, then assert that transientRetryOn5xx.attempts: 3 produces exactly three total upstream requests; behavior changes under src/ require focused regression coverage near the existing subsystem tests.
AGENTS.md reference: AGENTS.md:L336-L339
Useful? React with 👍 / 👎.
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Its title has been prefixed with |
Motivation
transientRetryOn5xx.attemptstotal-send budget so a single inbound request cannot amplify upstream sends beyond the configured per-request ceiling.Description
transientSendsUsed) insrc/server/chat-native.tsand compute the remaining allowance before each fetch call so every recovery leg draws from the same budget.fetchWithTransientRetryand wireonSendsConsumedso the helper reports actual sends back into the shared counter.transientSendAvailable()check.tests/transient-budget-scope-source.test.tsthat asserts the native-chat wiring draws from the shared counter and that both recovery loops observe the budget, alongside existingtests/upstream-transient-retry.test.tscoverage.Testing
bun test tests/transient-budget-scope-source.test.ts tests/upstream-transient-retry.test.tsand both focused test files passed.bun run typecheckandbun run privacy:scan, both succeeded.bun run test; focused regressions are green but the full PR-ready suite run was aborted after unrelated, pre-existing failures in other tests, so only the focused tests and typecheck/privacy checks were relied on for verification.Codex Task