Skip to content

fix(conversations): normalize lastOutput array format to prevent .replace TypeError#113410

Merged
obostjancic merged 2 commits into
masterfrom
claude/fix-replace-error-conversations-f0CHT
Apr 20, 2026
Merged

fix(conversations): normalize lastOutput array format to prevent .replace TypeError#113410
obostjancic merged 2 commits into
masterfrom
claude/fix-replace-error-conversations-f0CHT

Conversation

@obostjancic

@obostjancic obostjancic commented Apr 20, 2026

Copy link
Copy Markdown
Member

…vent .replace TypeError

The API can return `lastOutput` as an array of content objects
(`Array<{text: string; type: string}>`), the same way `firstInput` can,
but only `firstInput` was being normalized. When `lastOutput` was an
array it passed the truthiness check and reached `cleanMarkdownForCell`
where `.replace()` was called on a non-string value, throwing
`TypeError: t.replace is not a function`.

Fix by updating `ConversationApiResponse` to type `lastOutput` as the
union type and applying the same extraction logic used for `firstInput`.

https://claude.ai/code/session_01Lj4dQcsMDrKWdUEFiTizEc
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 20, 2026
Run formatter to fix line-length violations in the interface extends
clause and destructuring callback parameter.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@obostjancic
obostjancic marked this pull request as ready for review April 20, 2026 12:37
@obostjancic
obostjancic requested a review from a team as a code owner April 20, 2026 12:37
@obostjancic
obostjancic merged commit a320376 into master Apr 20, 2026
66 checks passed
@obostjancic
obostjancic deleted the claude/fix-replace-error-conversations-f0CHT branch April 20, 2026 12:45
@github-actions github-actions Bot locked and limited conversation to collaborators May 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants