You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e196f88
Browse filesBrowse the repository at this point in the historyBrowse files
fix: avoid embedding large diffs in review prompts
Classify review scope before building the prompt. When the diff exceeds
~5 files or ~256 KB, fall back to a lightweight context (status,
changed-files, diff_stat) and tell OpenCode to inspect the diff itself
via read-only git commands. Prevents HTTP 400 / shallow findings on
moderate-to-large changesets.
Adversarial template grows a {{REVIEW_COLLECTION_GUIDANCE}} slot.
Thresholds overridable via opts.maxInlineDiffFiles/Bytes.
Closes#40. Port of openai/codex-plugin-cc#179.
// Inline-diff thresholds. When a review exceeds either, we fall back to a
20
+
// "self-collect" context that omits the full diff and asks OpenCode to
21
+
// inspect the change itself via read-only git commands. See issue #40 and
22
+
// openai/codex-plugin-cc#179.
23
+
constDEFAULT_INLINE_DIFF_MAX_FILES=5;
24
+
constDEFAULT_INLINE_DIFF_MAX_BYTES=256*1024;
25
+
26
+
functionbuildCollectionGuidance(includeDiff){
27
+
returnincludeDiff
28
+
? "Use the repository context below as primary evidence."
29
+
: "The repository context below is a lightweight summary. The full diff is intentionally omitted — inspect the target yourself with read-only git commands (git diff, git log, git show) before finalizing findings.";
0 commit comments