Skip to content

fix(agents): strip <thought> and <antthinking> tags from output#688

Merged
steipete merged 2 commits into
openclaw:mainfrom
theglove44:fix/thinking-blocks-leak
Jan 10, 2026
Merged

fix(agents): strip <thought> and <antthinking> tags from output#688
steipete merged 2 commits into
openclaw:mainfrom
theglove44:fix/thinking-blocks-leak

Conversation

@theglove44

Copy link
Copy Markdown

Description

This PR updates the regexes used for stripping thinking blocks to include support for <thought> and <antthinking> tags. This ensures that reasoning traces from models using these tags (like Claude 3.7 / Google internal models) are properly hidden when thinking mode is disabled.

Changes

  • Updated THINKING_TAG_RE and related regexes in src/agents/pi-embedded-subscribe.ts
  • Updated regexes in src/agents/pi-embedded-utils.ts

Motivation

Users reported that thinking blocks were leaking into the output despite being disabled. This was likely due to the model using alternative tags not covered by the previous regex.

@steipete steipete force-pushed the fix/thinking-blocks-leak branch from 3ce1f7b to 4d0e74a Compare January 10, 2026 22:25
@steipete steipete merged commit 5adbeb1 into openclaw:main Jan 10, 2026
7 of 20 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Landed via temp rebase onto main.

  • Gate: pnpm lint && pnpm build && pnpm test
  • Land commit: 4d0e74a
  • Merge commit: 5adbeb1

Thanks @theglove44!

lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
fix(agents): strip <thought> and <antthinking> tags from output
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
fix(agents): strip <thought> and <antthinking> tags from output
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