Skip to content

fix(opencode): strip MiniMax trailing tool_call leak suffix from assistant text - #36860

Closed
ulises-jeremias wants to merge 1 commit into
anomalyco:devfrom
ulises-jeremias:fix/opencode-minimax-trailing-tool-call-leak-v2
Closed

ulises-jeremias wants to merge 1 commit into
anomalyco:devfrom
ulises-jeremias:fix/opencode-minimax-trailing-tool-call-leak-v2

Conversation

@ulises-jeremias

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #30684

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

MiniMax models can append a trailing serialized tool-call marker artifact
(e.g. ]<\]minimax[>[/<`/tool_call>`) to plain assistant text. This text leak
surfaces in the UI and can confuse downstream parsing.

The fix adds a regex-based sanitizer that removes the trailing artifact
from assistant text-end events, gated to MiniMax model ids only.

How did you verify your code works?

  • bun test test/session/processor-effect.test.ts — 17 tests pass including 2 new tests for the MiniMax leak path and non-MiniMax regression
  • bun typecheck — clean

Screenshots / recordings

N/A (no UI changes)

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

…stant text

MiniMax models can append a trailing serialized tool-call marker artifact
(e.g. ]<]minimax[>[</tool_call>) to plain assistant text. This text leak
surfaces in the UI and can confuse downstream parsing.

The fix adds a regex-based sanitizer that removes the trailing artifact
from assistant text-end events, gated to MiniMax model ids only.
Non-MiniMax models are unaffected.

Closes anomalyco#30684
@sistemasnegros

Copy link
Copy Markdown

+1

@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MiniMax M3 Free leaking "]<]minimax[>[</tool_call>"

2 participants