Skip to content

feat(chatgpt-review): upload plan-author's question file instead of pasting it - #658

Merged
BorisTyshkevich merged 1 commit into
mainfrom
feat/chatgpt-review-plan-author-upload-context
Aug 9, 2026
Merged

feat(chatgpt-review): upload plan-author's question file instead of pasting it#658
BorisTyshkevich merged 1 commit into
mainfrom
feat/chatgpt-review-plan-author-upload-context

Conversation

@BorisTyshkevich

Copy link
Copy Markdown
Collaborator

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() mechanism plan/local modes 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-author mode first (the worst offender — the only mode with an explicit "copy the full contract" instruction in chatgpt-plan-author-loop.workflow.mjs, and the fastest-growing context files). pr/issue/plan/local modes 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 new buildPrompt test)
  • doctor against the real connected Chrome — passes
  • Real, live, disposable end-to-end run: uploaded an actual context file (two acceptance-criteria IDs + a non-goal) in a fresh conversation, and ChatGPT correctly read and echoed back exactly that content from the attachment (17.6s)

🤖 Generated with Claude Code

https://claude.ai/code/session_01LwFPT465eDJqYcRa8HGNLz

…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
BorisTyshkevich merged commit 3af4984 into main Aug 9, 2026
8 checks passed
@BorisTyshkevich
BorisTyshkevich deleted the feat/chatgpt-review-plan-author-upload-context branch August 9, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant