Repository navigation
feat(core): add getIncrementalDiffFiles to the diff cache - #203
Merged
Merged
Conversation
Signed-off-by: Ym <173550318+MaxonT@users.noreply.github.com>
Codex Review Summary: ✅ CompletedThis 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.
Codra Review
✅ Nothing to flag. Reviewed 5 files (282 changed lines) and found no issues worth raising.
Reviewed commit: 0b9499fc8b
ℹ️ About Codra in GitHub
Your team has set up Codra to review pull requests in this repo. Reviews are triggered when you:
- Open a pull request for review
- Mark a draft as ready
Every review posts a summary here. A clean pass also gets a 👍 on the pull request itself.
devarshishimpi
approved these changes
Nov 29, 2026
devarshishimpi
added a commit
that referenced
this pull request
Nov 29, 2026
- core(review): deduplicate diff cache helper, cache empty diffs via != null, validate commit SHAs, and add PR-context JSDoc note (#181 / PR #203) - api/node/worker: bypass Hyperdrive SQL caching via SELECT clock_timestamp(), fail fast on disconnected Redis via PING_REDIS, coalesce in-flight probes, suppress late rejections, preserve logger requestId on health probe warnings, and add adapter wiring tests + K8s timeoutSeconds docs (#173 / PR #202) - models/schema: guard non-finite/negative thinkingBudget, exclude o1-mini/o1-preview from reasoning_effort, simplify Zod schema, and consolidate OpenAI tests with real schema parsing (#177 / PR #201)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello, this is a patch for the issue below; I tried to keep it narrow.
Description
Thanks for writing the issue with the exact function and call spelled out, it made this one quick to place. This adds
getIncrementalDiffFilestopackages/core/src/review/diff-cache.ts. It callsgithub.getCompareDiff(owner, repo, previousCommitSha, newHeadSha)and then runs the sameparseUnifiedDiffandfilterReviewableFilessteps asgetDiffFiles, includingmaxFilesand theskip_filesconfig.Caching follows
getDiffFilestoo: same TTL, and a failed cache write only logs a warning. The key isdiff:<jobId>:<previousSha>..<newHeadSha>, so it cannot return the full PR diff cached underdiff:<jobId>, or the diff of a different commit range. The function is exported next togetDiffFilesfrom@codraoss/coreand from the worker'score/reviewre-exports. Nothing calls it yet, as the wiring is a separate sub-issue.Fixes #181
Type of change
How Has This Been Tested?
test/review/diff-cache.spec.ts, 6 cases with a mocked git provider and an in-memory KV: files come only from the compare diff, filtering andmaxFilesmatchgetDiffFiles, caching with the shared TTL and reuse on a second call, no key sharing with the full diff or another SHA range, and a failing cache write still returns the files. 6 passed here, along withtest/diff.spec.ts,test/diff-from-files.spec.ts,test/review/pack.spec.tsandtest/review/model-profiles.spec.ts(50 tests in total). With the key reverted todiff:<jobId>, 2 of the 6 fail.npm run lintis clean.Not run
The Postgres-backed integration suite (no database here), and the Playwright suite.
npm run typecheckreports 22 errors in files this change does not touch (worker and workflow types such asExecutionContext), and none in the changed files; I did not compare against a clean base with generated worker types.