Skip to content

Add force think tag stripping to fix blank code boxes appearing while subagents are running - #164

Merged
ltmoerdani merged 2 commits into
ltmoerdani:mainfrom
Barragek0:patch-2
Aug 18, 2026
Merged

Add force think tag stripping to fix blank code boxes appearing while subagents are running#164
ltmoerdani merged 2 commits into
ltmoerdani:mainfrom
Barragek0:patch-2

Conversation

@Barragek0

@Barragek0 Barragek0 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

📝 What does this change?

Force think-tag stripping when tools are present in the request (subagent/tool-call invocations). This prevents tags in content from rendering as blank code blocks in the chat UI when using a subagent, flooding the chat with blank code boxes.

The trigger is tool-call detection (options.tools.length > 0), not model-specific. The ThinkTagFilter is a no-op for models that don't emit think tags, so this is safe for all models.

🧪 How did you test it?

Tested with MiMo v2.5

✅ Checklist

  • npm run compile passes
  • npm run lint passes
  • npm test passes
  • npm run package produces a VSIX
  • I tested it works
  • I updated docs/CHANGELOG if needed

@Barragek0
Barragek0 marked this pull request as ready for review August 18, 2026 14:14
@ltmoerdani

Copy link
Copy Markdown
Owner

Thanks for this one @Barragek0, clean approach. Reusing the existing stripThinkTags plumbing and forcing the mode when tools are present beats a model-specific hack, and the no-op passthrough for models that don't emit think tags makes it safe across the board.

I pulled the branch and verified beyond lint: the full npm run lint gate passes (all 7 checks), and I ran a direct logic check on createThinkTagFilter. forceOverride activates the filter even on never, non-forced requests keep their old behavior, and the visible/thinking split comes through intact. Also like that the stripped thinking still surfaces via LanguageModelThinkingPart, so nothing gets dropped.

One small follow-up I'll handle myself after merging: a tiny unit test for the force path, since thinkTags.ts has no coverage yet. Not a blocker.

Merging now. Thanks again!

@ltmoerdani
ltmoerdani merged commit 7bf4223 into ltmoerdani:main Aug 18, 2026
2 checks passed
@Barragek0
Barragek0 deleted the patch-2 branch August 18, 2026 23:03
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