Repository navigation
Show history turns as recorded; leave history out of the system message - #288
Merged
Merged
Conversation
…essage A stored turn's missing outputs read "Not supplied for this conversation history message.", words the model never wrote. DSPy 3.2.1 writes None there instead, which is no truer. A turn now shows the outputs it recorded and nothing for the rest, and a turn with none is its user message alone. On native replay, a predictor that names a tool-calls output but is not a tool loop showed only next_thought, which it does not record, so its answer was lost. Its recorded outputs are now the assistant text. A loop step still shows next_thought. The system message of every format listed a history input and showed a [[ ## history ## ]] section that no message contains, since history arrives as turns. It now leaves out a field typed history, and any input the call supplies as an Imp.History. #284 did this only for the template of a plain-text ReActV2 step; that step's field list still named history. Fixes #261. Fixes #258.
This was referenced Oct 8, 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.
Fixes #261. Fixes #258.
Problem
Historyentry with a missing output rendered it as "Not supplied for this conversation history message.", in the model's own turn. DSPy 3.2.1 writesNonethere, which the model didn't write either.next_thoughtas the assistant text. A plainImp.Predictthat names atool_calls_fielddoesn't recordnext_thought, so its answer came back as"".[[ ## history ## ]]section, but history is sent as earlier turns, so that section never appears. Ask a plain-text ReActV2 step for no output markers #284 removed the placeholder only from the plain-text ReActV2 template, and that step's field list still showed2. `history` (history):(see the expectation updated inreact_v2_plain_text_answer_test.exs). So Don't advertise a History input as a message section it never appears in #258 was still open.Change
next_thought) uses its recorded outputs as the assistant text. Loop steps don't change.history, and any input the call supplies as anImp.History. A field that is only namedhistoryand is given a plain value is still listed, and still shows as a section (existing test). The change is inChat.assemble, so Chat, JSON and XML all get it.Both are deliberate differences from DSPy 3.2.1. They are recorded in
decisions.md(a new row, plus an amendment to the #259 row that kept the filler) and inresearch/differentials/ADAPTER_FIDELITY.md. Demo rendering doesn't change.Tests
The three new tests in
test/history_test.exsfail onmainand pass here:Two existing expectations change on purpose: the plain-text ReActV2 system message, and the host input-only entry test, which asserted the filler.
mix check's test command: 3609 tests, 0 failures.mix dialyzer.checkpasses after moving the pinnedchat.exskip to its new line (894 to 898).