Skip to content

Harden reasoning-model output cleanup - #815

Open
xdCloudy wants to merge 1 commit into
mindcraft-bots:developfrom
xdCloudy:fix/reasoning-output-cleanup
Open

xdCloudy wants to merge 1 commit into
mindcraft-bots:developfrom
xdCloudy:fix/reasoning-output-cleanup

Conversation

@xdCloudy

Copy link
Copy Markdown

Summary

Improve cleanup of reasoning-model output before Mindcraft uses it as a conversation response or memory summary.

Some reasoning-capable models can expose internal reasoning delimiters such as </think> or emit the configured *** stop sequence literally. Mindcraft already strips </think>, but the current implementation only takes the first segment after the marker.

Changes

  • Add a shared _cleanReasoningOutput() helper
  • Keep the content after the final </think> marker
  • Strip trailing literal *** stop-sequence leakage
  • Reuse the same cleanup for conversation responses and memory summaries

Why

During testing with an OpenAI-compatible local reasoning model, responses occasionally contained:

<thinking output>
</think>

!command(...)

@Sweaterdog

Copy link
Copy Markdown
Contributor

quit spamming our repo with slop

@Sweaterdog Sweaterdog closed this Aug 18, 2026
@Sweaterdog Sweaterdog reopened this Aug 31, 2026
@Sweaterdog

Copy link
Copy Markdown
Contributor

whoopsies

@Sweaterdog Sweaterdog left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Succinctly does what is required to fix it for all model endpoints.

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.

2 participants