Repository navigation
MAIT-296: Fix missing tool call result when two tools called simultaneously - #12
Merged
Merged
Conversation
…eously done=false blocks were serialized without a trailing newline, while done=true blocks ended with \n. With two concurrent tool calls this caused consecutive in-progress blocks to have no separator between them, while done blocks got \n\n (a marked space token). The token array structure shifted on transition, causing Svelte's index-keyed #each to destroy and recreate the second Collapsible while updating the first in place — leaving the first tool call result invisible. Fix: add trailing \n to done=false blocks in both serialization paths so both states produce identical token structure with stable indices.
…etion The backend sends tool_calls data only in content_blocks, not in the content string of the final chat:completion event. Without this fix, tool call result blocks never appear in the rendered message. Serialize content_blocks (reasoning, tool_calls, text) back into message.content HTML when done=true so the markdown renderer can display the <details type="tool_calls"> collapsibles.
acikabubo
force-pushed
the
MAIT-296-fix-missing-tool-call-result
branch
from
June 28, 2026 16:15
6b52950 to
050b96c
Compare
replaceTokens() replaces [N] citation markers with <source_id> tags across the whole message, including inside <details type="tool_calls"> blocks. When a tool's result text contains a [N] that collides with an active citation index, this corrupts the details tag's attributes and the frontend stops recognizing it, silently dropping that tool's result. Confirmed against the chat originally linked in this ticket. Scope the substitution to skip <details>...</details> regions, same as the existing code-fence exclusion. Also fixes Chat.svelte's content_blocks rebuild only escaping quotes (not <, >, &) in tool output, which corrupts the same tag structure via raw markup like MediaWiki <ref> tags — a related bug, not confirmed as this ticket's specific symptom.
vedmaka
requested changes
Aug 4, 2026
…e blocks Reverts the trailing \n added in 0148d54. That change targeted a token-alignment theory that isn't the actual cause of the reported bug — the confirmed root cause (citation-marker substitution corrupting the tool_calls details tag) is unrelated to newline placement and is fixed separately. Per review feedback.
vedmaka
requested changes
Aug 28, 2026
pastakhov
requested changes
Oct 26, 2026
Replace citations in the body of a details block. Keep the opening tag and summary unchanged. An unclosed backtick can no longer change the tag.
|
🐳 The image has been built and pushed with the following tags: |
pastakhov
approved these changes
Oct 29, 2026
vedmaka
approved these changes
Nov 19, 2026
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