fix(chatgpt-review): upload context instead of pasting, in every mode - #659
Merged
Merged
Conversation
Every chatgpt-review mode (pr/issue/plan/plan-author/local) now uploads its --question-file as an attachment instead of pasting its full text into the composer. This removes two real, quantified duplication problems observed on #585/#630: (1) every mode's prompt already told ChatGPT to browse the live GitHub issue/PR, while separately pasting much of the same content again; (2) chatgpt-plan-author-loop.workflow.mjs regenerated a revision context file each pass by copying the ENTIRE prior contract and appending to it (confirmed 231 lines -> 297 lines after one pass, all 231 original lines carried forward verbatim), so conversation content grew unboundedly across passes. ChatGPT's file input accepts multiple files in one message (confirmed live via setInputFiles([...]) attaching two separately-confirmable chips), so browser.mjs's upload() now normalizes to an array and loop-confirms each file; chatgpt-review.mjs uploads the mode's own primary artifact (plan file / local diff, when one exists) together with the --question-file context in one message, each renamed per-pass to avoid ChatGPT's own upload-UI collision-renaming. plan-author's revision passes keep a small, genuinely-new --revision-note-file pasted alongside the always-uploaded, never-regenerated contract, since a revision's findings are small and not duplicative the way the contract was. chatgpt-plan-author-loop.workflow.mjs's "Prepare" step no longer copies the full delivery contract into a growing file each pass; it now writes only a small findings-only note and the loop always re-uploads the same, unchanged original contextFile via --question-file. 61/61 chatgpt-review unit tests and 8/8 ship workflow-contract tests pass.
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.
Summary
Follow-up to PR #656/#657/#658. Generalizes #658's plan-author-only fix to
every
chatgpt-reviewmode.pr/issue/plan/plan-author/local) now uploads its--question-file(the coordinator's delivery contract/context) as anattachment instead of pasting it into the composer.
ChatGPT to browse the live GitHub issue/PR, while separately pasting much
of the same content again; and
chatgpt-plan-author-loop.workflow.mjsregenerated a revision context file each pass by copying the ENTIRE prior
contract and appending to it (confirmed 231 → 297 lines after one pass,
all 231 original lines carried forward verbatim), growing conversation
content unboundedly across passes.
browser.mjs'supload()now accepts one or more paths — ChatGPT's fileinput supports multiple attachments in one message (confirmed live via
setInputFiles([...]), both files individually confirmed as chips).chatgpt-review.mjsuploads a mode's own primary artifact (plan file /local diff, when one exists) together with
--question-filein onemessage, each renamed per-pass to avoid ChatGPT's own upload-UI
collision-renaming.
plan-authorrevisions keep a small, genuinely-new--revision-note-filepasted alongside the always-uploaded, never-regenerated contract — a
revision's findings are small and not duplicative, unlike the contract.
chatgpt-plan-author-loop.workflow.mjs's "Prepare" step no longer copiesthe full delivery contract into a growing file each pass; it writes only a
small findings-only note, and every pass re-uploads the same unchanged
original
contextFile.plan-review-loop.workflow.mjsandcode-review-pass.workflow.mjsneededno changes — they already pass one stable
--question-fileper pass withno growing/copying logic, so they transparently benefit from the new
upload-not-paste behavior.
Test plan
node --test skills/chatgpt-review/tests/*.test.mjs— 61/61 passnode --test skills/ship/tests/*.test.mjs— 8/8 passsetInputFilesattach behavior confirmed live against thereal ChatGPT UI in the prior investigation round (this PR's remaining
changes are deterministic plumbing already covered by the unit suite)
🤖 Generated with Claude Code
https://claude.ai/code/session_01LwFPT465eDJqYcRa8HGNLz