Conversation
|
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: Advanced 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 |
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: de7b4a171c
ℹ️ 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".
| cancel(reason) { | ||
| cancelled = true; | ||
| void iterator.return?.(reason); | ||
| void iterator.return?.(reason).finally(finalize); |
There was a problem hiding this comment.
Finalize before waiting for iterator shutdown
When the client cancels while pull() is awaiting an upstream SSE chunk, an async generator's return() waits for the pending reader.read() before entering its finally; chaining finalize to that promise therefore leaves the sole recovery-probe lease held until the upstream produces data or is separately aborted. This is especially visible on the tee relay path, whose inspection branch may continue draining after client disconnection, so subsequent recovery probes remain blocked despite this cancellation fix. Invoke finalize() synchronously in cancel() and then request iterator/reader shutdown independently.
AGENTS.md reference: src/AGENTS.md:L17-L17
Useful? React with 👍 / 👎.
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Its title has been prefixed with |
Motivation
Description
onFinalize?: () => voidhook toPassthroughWebSearchBridgeStreamOptionsand wire an exactly-oncefinalize()increatePassthroughWebSearchBridgeStreamthat runs on normal completion, error, or client cancellation. (src/web-search/passthrough-bridge.ts)releaseCodexAuthContextProbeLease(openAiSidecar?.authContext)so any probe lease acquired during early OpenAI-sidecar resolution is returned when no upstream sidecar request occurs. (src/server/responses/core.ts)tests/web-search/web-search-passthrough-bridge.test.ts)structure/runtime.md)Testing
node_modules/.bin/bun test tests/web-search/web-search-passthrough-bridge.test.tsand the file's suite passed (41 tests, 0 failures).node_modules/.bin/bun run typecheck,node_modules/.bin/bun run structure:check, andnode_modules/.bin/bun run privacy:scan, all of which succeeded for the change set.bun testin this environment; the full suite exercise succeeded for the modified bridge tests but the run exposed unrelated environment-sensitive failures in the Codex shim process-group cleanup tests (external to this change); these are not regressions introduced by this PR.git diff --checkshowed no whitespace or diff issues.Codex Task