Skip to content

Fix system tool parser dropping text and blocking follow-up tool calls#11091

Open
siewcapital wants to merge 1 commit intocontinuedev:mainfrom
Siew-s-Capital:fix/system-tools-multi-call-11074
Open

Fix system tool parser dropping text and blocking follow-up tool calls#11091
siewcapital wants to merge 1 commit intocontinuedev:mainfrom
Siew-s-Capital:fix/system-tools-multi-call-11074

Conversation

@siewcapital
Copy link

@siewcapital siewcapital commented Mar 5, 2026

Summary

  • keep parsing after a completed system tool call instead of halting the stream
  • preserve assistant text emitted after a tool codeblock
  • allow a second (or later) tool codeblock in the same assistant response stream
  • update tool-instruction suffix to remove the single-tool/terminal-only restriction
  • extend parser tests to cover post-tool text preservation and multi-tool streaming

Why

Issue #11074 highlights that the current interceptor enforces a positional assumption (single terminal tool call). That causes a capability gap for system-message tool parsing compared with native tool calling behavior.

Testing

  • Added/updated vitest cases in:
    • core/tools/systemMessageTools/toolCodeblocks/interceptSystemToolCalls.vitest.ts
  • Could not execute vitest in this environment because project dev dependencies are not installed (vitest: command not found).

Closes #11074


Summary by cubic

Fixes the system tool parser so it preserves assistant text and supports multiple tool codeblocks in a single response instead of stopping after the first call. Closes #11074 and aligns system-message tool parsing with native tool calling.

  • Bug Fixes
    • Keep parsing after a completed tool call; no premature halt.
    • Preserve assistant text after tool codeblocks (including newline).
    • Support multiple tool codeblocks in one assistant message.
    • Update system message suffix to allow multi-tool calls; add tests for post-tool text and multi-tool streams.

Written for commit 653adb1. Summary will update on new commits.

@siewcapital siewcapital requested a review from a team as a code owner March 5, 2026 19:04
@siewcapital siewcapital requested review from Patrick-Erichsen and removed request for a team March 5, 2026 19:04
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Mar 5, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2026


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

@Co-Messi
Copy link

Co-Messi commented Mar 6, 2026

I have read the CLA Document and I hereby sign the CLA

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

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

System message tools parser assumes tool calls are positionally terminal

2 participants