fix(chatgpt-review): surface real response text on plan-author parse failure; stop hand-transcribing previews - #664
Merged
Conversation
…failure; stop hand-transcribing previews Found live during a /ship dry-run smoke test of the new upload-context workflow (issue #639, plan-author-only, no implementation attempted per its own cross-repo restriction): 1. chatgpt-review.mjs's plan-author branch let InvalidPlanResponseError propagate without attaching the review's actual captured responseText as .partial, so the CLI's own JSON reported response_text: "" on every invalid_response outcome even when ChatGPT's real (if malformed) text had been captured moments earlier. Reproduced twice in one dry run: a malformed-BLOCKED response and a missing-heading response both surfaced as an empty response_text with only the parse-error message to go on. Fixed at the one call site that has both the error and review.responseText in scope; added a regression test covering both symptoms. 2. chatgpt-plan-author-loop.workflow.mjs's Author-phase runner agent was asked to hand-transcribe the last ~500 characters of ChatGPT's raw response text directly into a StructuredOutput tool-call argument when authoring stayed incomplete. This broke identically on all 5 retries in the same dry run (a JSON syntax error, `"lastResponsePreview": }` with no value, repeated byte-for-byte) and killed the whole workflow. Replaced with a deterministic, workflow-computed file path (lastResponsePreviewFile) and a literal, mechanical Bash command the runner must run verbatim -- the model never reads or transcribes response_text itself, matching the file-over-paste principle from #659. 62/62 chatgpt-review unit tests (61 + 1 new) and 8/8 ship workflow-contract tests pass.
This was referenced Aug 10, 2026
Merged
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
Found live during a
/ship 639dry-run smoke test of PR #659's upload-contextworkflow — deliberately plan-author-only, no implementation attempted, since
#639 itself forbids
/shipfrom creating the second repository it needs.chatgpt-review.mjsdiagnostic blindness: theplan-authorbranch letInvalidPlanResponseErrorpropagate without attaching the real capturedreview.responseTextas.partial, so the CLI's own JSON reportedresponse_text: ""on everyinvalid_responseoutcome — even whenChatGPT's real (if malformed) text had just been captured. Reproduced
twice in one dry run: a malformed-BLOCKED response and a missing-heading
response both surfaced as an empty
response_textwith only theparse-error message to go on. Fixed at the one call site that has both the
error and
review.responseTextin scope; added a regression test coveringboth symptoms.
chatgpt-plan-author-loop.workflow.mjsStructuredOutput crash: theAuthor-phase runner agent was asked to hand-transcribe the last ~500
characters of ChatGPT's raw response text directly into a
StructuredOutputtool-call argument whenever authoring stayedincomplete. This broke identically on all 5 retries in the same dry run (a
JSON syntax error —
"lastResponsePreview": }with no value, repeatedbyte-for-byte) and killed the whole workflow
(
StructuredOutput retry cap (5) exceeded). Replaced with a deterministic,workflow-computed file path (
lastResponsePreviewFile) and a literal,mechanical Bash command the runner must run verbatim — the model never
reads or transcribes
response_textitself, matching the file-over-pasteprinciple from fix(chatgpt-review): upload context instead of pasting, in every mode #659.
Test plan
node --test skills/chatgpt-review/tests/*.test.mjs— 62/62 pass (61 + 1 new)node --test skills/ship/tests/*.test.mjs— 8/8 passthe real transcript of the failing follow-up: move @altinity/clickhouse-http into a dedicated Altinity repository #639 dry run; diffs reviewed by the
coordinator before commit
live confirmation the workflow now completes past this failure point
🤖 Generated with Claude Code
https://claude.ai/code/session_01LwFPT465eDJqYcRa8HGNLz