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: 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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 673d542aed
ℹ️ 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".
| export interface NormalizeTargetsOptions extends NormalizeOptions { | ||
| /** Cancels queued native decode work and stops pulling more images. */ | ||
| abortSignal?: AbortSignal; |
There was a problem hiding this comment.
Pass abort signals through every normalizer wrapper
The new process-wide queue is cancellable only when abortSignal reaches this option, but the Anthropic production paths do not expose or pass it: normalizeAnthropicImages still accepts only NormalizeOptions, createAnthropicAdapter().buildRequest omits incoming.abortSignal, and native Claude normalization omits req.signal. When all four slots are occupied, disconnected Anthropic requests therefore remain in imageDecodeWaiters, retain their image payloads, and later consume decode capacity, allowing cancelled traffic to build a CPU/memory backlog that delays live requests. Extend the wrapper options and thread the request signal through these callers.
AGENTS.md reference: src/AGENTS.md:L19-L19
Useful? React with 👍 / 👎.
| initialRequest = await activeAdapter.buildRequest(parsed, { | ||
| headers: selectedForwardHeaders, | ||
| translatorBudget, | ||
| abortSignal: upstream.signal, | ||
| }); |
There was a problem hiding this comment.
Include the abort signal in continuation rebuilds
This propagates cancellation for the initial build and the recovery rebuild, but fetchContinuation later calls activeAdapter.buildRequest without abortSignal around core.ts:8206. For an oversized OpenAI-chat image request that reaches terminal-guard continuation, disconnecting while normalization is queued will not remove that work from the new process-wide gate, so the request continues retaining and decoding images after cancellation. Pass upstream.signal to that continuation build as well.
AGENTS.md reference: src/AGENTS.md:L19-L19
Useful? React with 👍 / 👎.
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Its title has been prefixed with |
Motivation
Description
bunImageEncodeandbunImageValidate(src/adapters/anthropic-image-codec.ts).IMAGE_NORMALIZE_CONCURRENCYso decoded-image work is limited across requests and not per-request (src/adapters/anthropic-image-normalize.ts).abortSignaltobuildRequestandnormalizeOpenAIChatImages, and make the normalizer respect cancellation so queued decode work stops when the client disconnects (src/server/responses/core.ts,src/adapters/openai-chat.ts,src/adapters/openai-chat-images.ts,src/adapters/anthropic-image-normalize.ts).tests/adapters/anthropic/anthropic-image-normalize.test.ts,tests/adapters/openai/openai-chat-image-normalization.test.ts).structure/*updates).Testing
./node_modules/bun/bin/bun.exe test tests/adapters/openai/openai-chat-image-normalization.test.ts tests/adapters/anthropic/anthropic-image-normalize.test.ts, which completed with42 passed, 0 failed.bun run typecheck,bun run privacy:scan, andbun run structure:check, all of which passed in this environment.bun run test) in this container; the image-normalization changes passed locally but the full parallel suite reported unrelated failures intests/server/api-key-attribution.test.tsthat are not caused by the image-normalization changes (environmental/cross-test server interactions observed in this CI container).Codex Task