feat(chatgpt-review): upload plan-author's question file instead of pasting it - #658
Merged
BorisTyshkevich merged 1 commit intoAug 9, 2026
Merged
Conversation
…asting it Discussed with the user: the coordinator's delivery-contract/context files were being pasted into the composer as raw chat text via buildPrompt's contextBlock, duplicating content already in the GitHub issue (which the prompt separately tells ChatGPT to browse) and, on every revision pass, duplicating the SAME text again even though the conversation already had it from pass 1 -- chatgpt-plan-author-loop.workflow.mjs's revision step literally instructs "Copy the full original delivery contract" into each new context file. Confirmed live in this run's own real context files: a 231- line base context became a 297-line revision file with all 231 original lines carried forward verbatim plus 66 new lines of findings. Removing the duplication outright was considered and rejected: this exact project has repeatedly hit ChatGPT's own live tool calls (GitHub/repo browsing) stalling mid-turn, so having the delivery contract already available without depending on a live browse is real, working insurance. This is the middle path: upload the question file as an attachment (the SAME generic upload() mechanism plan/local modes already use for their own plan/diff files) instead of pasting its text. Since it's a cheap file transfer rather than retyped text, it can be re-attached fresh on every revision pass at negligible cost -- preserving the insurance against a failed browse (or, for a long conversation, lost early context) without ever re-pasting the same text as chat content again. Scoped to plan-author mode first (the worst offender -- the only mode with an explicit "copy the full contract" instruction and the fastest-growing context files); pr/issue/plan/local modes are unchanged for now. prepare() sets uploadPath from --question-file for plan-author specifically; the existing generic per-pass upload-renaming logic (shared with plan/local) handles it unchanged. buildPrompt references the upload by name instead of pasting context for this mode. Verified: 59/59 unit tests (4 existing plan-author tests updated to their new, correct expectations; 1 new buildPrompt test proving the reference appears and no context text is ever pasted for this mode), plus a real, live, disposable end-to-end run: uploaded an actual context file with two acceptance-criteria IDs and a non-goal, and ChatGPT correctly read and echoed back exactly that content from the attachment (17.6s, fresh conversation). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LwFPT465eDJqYcRa8HGNLz
BorisTyshkevich
deleted the
feat/chatgpt-review-plan-author-upload-context
branch
August 9, 2026 15:37
3 tasks
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
Discussed with the user: the coordinator's delivery-contract/context files were being pasted into the composer as raw chat text, duplicating (a) content already in the GitHub issue ChatGPT is separately told to browse, and (b) across every revision pass, the SAME text the conversation already had from pass 1 — confirmed live: a 231-line base context became a 297-line revision file with all 231 lines carried forward verbatim.
Removing this duplication outright was considered and rejected: this project has repeatedly hit ChatGPT's own live tool calls stalling mid-turn, so having the contract already available without depending on a live browse is real, working insurance.
The fix: upload the question file as an attachment instead of pasting it — the same generic
upload()mechanismplan/localmodes already use for their own plan/diff files. Being a cheap file transfer rather than retyped text, it can be re-attached fresh on every revision pass at negligible cost, preserving the insurance without ever re-pasting the same text as chat content again.Scoped to
plan-authormode first (the worst offender — the only mode with an explicit "copy the full contract" instruction inchatgpt-plan-author-loop.workflow.mjs, and the fastest-growing context files).pr/issue/plan/localmodes unchanged for now, to be revisited separately.Test plan
node --test tests/*.test.mjs— 59/59 pass (4 existing plan-author tests updated to their new, correct expectations; 1 newbuildPrompttest)doctoragainst the real connected Chrome — passes🤖 Generated with Claude Code
https://claude.ai/code/session_01LwFPT465eDJqYcRa8HGNLz