perf(workbench): reuse ordinary scan context results - #416
Conversation
|
@codex review |
|
@codex security review |
|
Codex Review: Didn't find any major issues. Swish! 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". |
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
ting-hong-shieh
left a comment
There was a problem hiding this comment.
Approved on exact head 429ad169fc867e707cbaada00a02825804174932 against main 216212b70a421b0bf30319d241de47a64050ec0f.
I ran the same new 21-finding regression against the base production code and the exact PR head. The structured snapshots were:
- Base:
ordinaryCalls=2,selectedCalls=2,ordinaryCount=20,selectedCount=21,workspaceCount=20,selectedIncluded=true. - Head:
ordinaryCalls=1, with every other field unchanged.
This isolates the intended performance change: the ordinary context reuses workspace.results, while an off-page selected finding still receives the separate result that includes all 21 findings.
Exact-head validation on macOS arm64 with Bun 1.3.14 and Python 3.12.13:
- 29 scan-recovery tests and 5 compact-diff tests passed.
- The full SDK suite passed with 1,080 tests, 11 platform/integration skips, and 0 failures.
- Generated-model checking, TypeScript checking, full Prettier checking, build, and
git diff --checkpassed. - The public exact-head rollup is green across the current Linux, macOS, and Windows matrices.
The local tests used synthetic temporary repositories and fixtures. No model or provider request, external API credential, or real user data was used.
zcrab-oai
left a comment
There was a problem hiding this comment.
Looks good. Ordinary scan contexts reuse their existing result while preserving workspace ownership, pagination, and selected off-page findings.
Summary
Avoid constructing the same workbench scan result twice for every ordinary scan-context request.
Changes
Testing
bun test --timeout 30000 tests-ts/scan-recovery.test.ts— 29 passed.bun test --timeout 30000 tests-ts/compact-diff-scan.test.ts— 5 passed.pnpm --pm-on-fail=ignore run types— passed.pnpm --pm-on-fail=ignore exec prettier --check tests-ts/scan-recovery.test.ts— passed.git diff --check— passed.Risk and rollout
Low risk. Ordinary JSON responses preserve the same scan and workspace results while avoiding duplicate database, artifact, and finding work. Explicit occurrence selection continues to build a separate result so off-page findings are not lost.
Public disclosure review