Repository navigation
Show tool calls in the chat history after a reload - #117
Merged
Merged
Conversation
The history now groups a conversation by turn: the user message, then one agent message with one tool group holding every tool call of the turn, in order, and all of the turn's text. Each call's result is matched by tool call id; a call without a stored result shows "no result", as a live call that never finished. The server sends the tool calls as JSON in the agent message's data-tools attribute, and chat.js builds the cards from it with the same functions it uses for live tool calls, so a card looks the same live and after a reload.
In the history's data-tools, an output longer than 20,000 characters is cut to that length and marked "truncated": true; chat.js shows "(output truncated)" under it. Live tool results are unchanged. A tool call with a blank or repeated id no longer replaces another call: it is kept under its position in the turn, so every call is shown. Results still match by id when the id is set.
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.
The history now groups a conversation by turn: the user message, then one agent message with one tool group holding every tool call of the turn, in order, and all of the turn's text. Each call's result is matched by tool call id; a call without a stored result shows "no result", as a live call that never finished.
The server sends the tool calls as JSON in the agent message's data-tools attribute, and chat.js builds the cards from it with the same functions it uses for live tool calls, so a card looks the same live and after a reload.