Repository navigation
SWF(bug): keep tool calls when replaying conversation history - #59
Merged
maplepaladin73 merged 2 commits intoNov 23, 2026
Merged
Conversation
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
There was a problem hiding this comment.
Devin Review found 2 findings. Devin automatically fixed all 2 findings.
Fixed by Devin (2)
- Split assistant turns block Mistral replay — Reproduced (5 messages instead of 3); replay and request-input lowering now fold function_call items into the preceding assistant message via one shared helper.
- Expanded turns lose conversation history — Reproduced (0 of 21 items saved; also reachable on main with 20 inputs + text). Internal turn persistence uses append_turn_items without the public 20-item cap; public add_items keeps the cap.
devin-ai-integration
Bot
force-pushed
the
devin/1795378313-conversation-tool-call-replay
branch
from
November 22, 2026 20:39
33b346c to
7f90ed3
Compare
devin-ai-integration
Bot
changed the base branch from
main
to
devin/1795378327-responses-persist-large-turns
November 22, 2026 20:39
devin-ai-integration
Bot
force-pushed
the
devin/1795378313-conversation-tool-call-replay
branch
from
November 22, 2026 22:15
7f90ed3 to
5829c63
Compare
devin-ai-integration
Bot
changed the base branch from
devin/1795378327-responses-persist-large-turns
to
main
November 22, 2026 22:15
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
devin-ai-integration
Bot
force-pushed
the
devin/1795378313-conversation-tool-call-replay
branch
from
November 22, 2026 22:27
5829c63 to
9aa7082
Compare
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
Tool-call history now survives a
/v1/responsesconversation. Storedfunction_callandfunction_call_outputitems now replay as assistant tool calls and tool results instead of being dropped. Based onmain, which includes #56 (ConversationStore::append_items), #60 (conversation_prefix_len) and #63.Root cause:
IncomingMessage::from_conversation_itemrequired arole. Function-call items have no role, so it returnedNoneand they vanished on replay. Also, both persistence paths stored every incoming message as a plainmessageitem and never saved the assistant's emitted function calls. The blocking path isresponses_translate.rs; the streaming path isresponses_stream/conv_items.rsandresponses_stream_finalize.rs.Fix:
from_conversation_itempassesfunction_callandfunction_call_outputto the existingfrom_responses_input_item, so one parser handles both.IncomingMessage::to_conversation_items(inchat_message_conversation.rs) is the one conversion both persistence paths use. Tool results becomefunction_call_outputitems and assistanttool_callsbecomefunction_callitems. Both paths still skip the replayed prefix with SWF(bug): stop instructions carrying over via previous_response_id #60'sconversation_prefix_lenand write with SWF(bug): persist Responses conversation turns with more than 20 items #56'sappend_items.FunctionCalloutput items.function_callitems into the previous assistant message (push_responses_message). Text plus parallel calls is then one assistant turn; templates likemistral.jinjareject two assistant roles in a row.Test plan
These regression tests failed on
mainbefore the fix:The review-round regression failed before its fix:
All results below are from the final head, rebased on
main:Try it:
ATLAS_SKIP_BUILD=1 CUDARC_CUDA_VERSION=13000 cargo test -p spark-server --bin spark conversation_tool_call_replaycargo fmt --all -- --checkATLAS_SKIP_BUILD=1 CUDARC_CUDA_VERSION=13000 cargo clippy --workspace --tests(clean)bash scripts/check-license-headers.sh(0 invalid) andtypos(clean)Notes for reviewers
conversation_store.rs. SWF(bug): persist Responses conversation turns with more than 20 items #56'sappend_itemshandles turns over 20 items.conversation_prefix_lenskip is kept, with this PR'sto_conversation_itemsadded.responses_lowering.rs). A client that sends text and parallel calls as separate input items now gets one assistant turn too.Implemented in session Keep function-call items when replaying stored history
Review with Devin · Open in Devin Desktop