Skip to content

fix(chatgpt-review): surface real response text on plan-author parse failure; stop hand-transcribing previews - #664

Merged
BorisTyshkevich merged 1 commit into
mainfrom
fix/chatgpt-review-plan-author-diagnostics
Aug 10, 2026
Merged

fix(chatgpt-review): surface real response text on plan-author parse failure; stop hand-transcribing previews#664
BorisTyshkevich merged 1 commit into
mainfrom
fix/chatgpt-review-plan-author-diagnostics

Conversation

@BorisTyshkevich

Copy link
Copy Markdown
Collaborator

Summary

Found live during a /ship 639 dry-run smoke test of PR #659's upload-context
workflow — deliberately plan-author-only, no implementation attempted, since
#639 itself forbids /ship from creating the second repository it needs.

  • chatgpt-review.mjs diagnostic blindness: the plan-author branch let
    InvalidPlanResponseError propagate without attaching the real captured
    review.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 just been captured. 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.
  • chatgpt-plan-author-loop.workflow.mjs StructuredOutput crash: the
    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 whenever 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
    (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_text itself, matching the file-over-paste
    principle from fix(chatgpt-review): upload context instead of pasting, in every mode #659.

Test plan

🤖 Generated with Claude Code

https://claude.ai/code/session_01LwFPT465eDJqYcRa8HGNLz

…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.
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