fix(chat): sync live-stream fence strip regex with backend TOOL_TAGS#3994
Closed
michaelxer wants to merge 1 commit into
Closed
fix(chat): sync live-stream fence strip regex with backend TOOL_TAGS#3994michaelxer wants to merge 1 commit into
michaelxer wants to merge 1 commit into
Conversation
michaelxer
marked this pull request as ready for review
June 11, 2026 22:25
The browser-side EXEC_FENCE_RE only covered 6 tool names (web_search, read_file, write_file, create_document, edit_document, update_document) while the backend strips all TOOL_TAGS from persisted round_texts. This caused executed fenced tool calls (e.g. list_emails, send_email) to remain visible in the live streaming view until session reload. Replace the hardcoded regex with an EXEC_TOOL_TAGS array sourced from the same set as src/agent_tools/__init__.py (minus bash/python/ls which are valid code-block identifiers), and build EXEC_FENCE_RE from it. Fixes odysseus-dev#3993
michaelxer
force-pushed
the
fix-exec-fence-sync-3993
branch
from
June 12, 2026 00:30
4ad9dec to
c7339cf
Compare
6 tasks
Contributor
Author
|
CI is all green, ready for review when you have a moment. |
Contributor
Author
|
Closing to keep the PR queue tidy. The fix is still valid if anyone wants to pick it up -- the frontend EXEC_FENCE_RE regex only covers 6 tool names while the backend strips all TOOL_TAGS, leaving email/cookcook/MCP tool calls visible during live streaming. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The browser-side
EXEC_FENCE_REregex inchatRenderer.jsonly covered 6 tool names (web_search,read_file,write_file,create_document,edit_document,update_document). The backend strips allTOOL_TAGSfrom persistedround_textsviatool_parsing.py, but the live streaming path uses the narrower frontend regex. This mismatch causes executed fenced tool calls for email, cookbook, MCP, and other tools to remain visible in the live chat view until the session is reloaded.This PR replaces the hardcoded
EXEC_FENCE_REwith anEXEC_TOOL_TAGSarray that mirrorssrc/agent_tools/__init__.py TOOL_TAGS(excludingbash,python,lswhich are valid fenced-code language identifiers), and builds the regex from it.Target branch
dev, notmain.Linked Issue
Fixes #3993
Type of Change
Checklist
devHow to Test
list_emailscall.Regex verification:
EXEC_FENCE_RE.test("```list_emails\n{\"max_results\":10}\n```")-> trueEXEC_FENCE_RE.test("```python\nprint(\"hello\")\n```")-> falseVisual / UI changes
stripToolBlocks(). No new CSS, colors, fonts, or component patterns.