Repository navigation
fix(deep-scan): page reducer inputs by serialized size - #1025
Conversation
|
@codex review |
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. |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Summary
Deep Scan reducers can exceed the code-mode IPC frame limit when reading all worker findings and the previous aggregate in one duplicated tool response. Page these inputs by serialized response bytes and keep retained provenance on the host so reducers can read large inputs without repeating the same oversized request.
Changes
Testing
Local reducer eval results
Run locally on 2026-09-24 with Node 24.19.0 and Codex CLI/SDK 0.156.1. Scanbench was not run. These are one deterministic run and one live-model run of a single synthetic reducer assignment, not a repository-wide scan or a repeated statistical eval.
Path exercised: synthetic persisted worker findings and a previous aggregate → real Codex external code-mode IPC host (in-process fallback disabled) → production reducer input/recording handlers → persisted reduction. The fixture contains two new independent findings and one prior finding with retained original data and synthesized history, including one 33,554,432-byte (32 MiB) semantic field with JSON escaping and Unicode. The first input call deliberately returns the legacy duplicated full response; subsequent calls use production pagination. This reproduces a real transport rejection rather than mocking the error string.
The trace grader requires retrying with a smaller byte budget at the same cursor/reference, every successful response within its requested byte budget, complete assigned-input pagination before recording, and exactly one successful result submission. Negative tests reject missing pages and collapsing unrelated findings into one. The deterministic run additionally asserts the exact numeric IPC error in actual tool output. The model run receives the shipped reducer prompt without scripted recovery code; because SDK events do not expose every code-mode error, its grade uses the oversized response, changed request, and saved artifacts.
The live model selected an 8,000-byte recovery budget, resulting in 15,139 successful page reads for this deliberately large fixture. This validates recovery and retention; it is not a throughput benchmark. That run used the locally configured model without an explicit override; the report did not capture its resolved model ID.
Reproduce from the repository root after the normal locked dependency setup:
The deterministic eval runs in the normal MCP test suite; the live model mode is opt-in. Each command prints its local report directory containing
report.json, a compact tool trace, and generated artifacts. The table above transcribes the saved local reports; there is no hosted run page. See the eval README, runner and trace grader, and regression/negative tests.Risk and rollout
The worker-local input tool now requires
maxBytesand returns JSON fragments; its prompt and recovery instructions ship together with the implementation. The budget measures the encoded MCP response, so callers leave room for transport framing and lower the budget after a transport-size failure. Size diagnostics can only be retained when the SDK exposes them. Aggregate submission keeps its existing contract; this change addresses input retrieval and retained provenance growth.Public disclosure review