[PR #12470] fix(github): handle step-start/step-finish parts in extractResponseText #14229

Closed
opened 2026-02-16 18:19:02 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/12470

State: closed
Merged: Yes


Extends #6173 to handle step-start and step-finish part types — and any future non-text part types — without needing code changes.

A recent GitHub Action run failed with:

Failed to parse response. Part types found: [step-start, step-finish]

The original fix in #6173 used a deny-list approach that checked for specific known non-text types (reasoning, tool). Any new part type added to the MessageV2.Part union (like step-start/step-finish) would fall through to the error path.

  • flip extractResponseText from deny-list to allow-list: check for text, return null for any other non-empty parts array, only throw on truly empty responses
  • add createStepFinishPart test helper and tests for step-start, step-finish, and the exact [step-start, step-finish] failure case
  • add a realistic multi-step response test ([step-start, tool, text, step-finish])
  • fix running-tool edge case that previously threw instead of routing to the summary fallback
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/12470 **State:** closed **Merged:** Yes --- Extends #6173 to handle `step-start` and `step-finish` part types — and any future non-text part types — without needing code changes. A recent GitHub Action run failed with: > Failed to parse response. Part types found: [step-start, step-finish] The original fix in #6173 used a deny-list approach that checked for specific known non-text types (`reasoning`, `tool`). Any new part type added to the `MessageV2.Part` union (like `step-start`/`step-finish`) would fall through to the error path. - flip `extractResponseText` from deny-list to allow-list: check for `text`, return `null` for any other non-empty parts array, only throw on truly empty responses - add `createStepFinishPart` test helper and tests for `step-start`, `step-finish`, and the exact `[step-start, step-finish]` failure case - add a realistic multi-step response test (`[step-start, tool, text, step-finish]`) - fix running-tool edge case that previously threw instead of routing to the summary fallback
yindo added the pull-request label 2026-02-16 18:19:02 -05:00
yindo closed this issue 2026-02-16 18:19:02 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14229