Preserve provider reasoning across ReAct tool history - #120
Open
larissaschiavo wants to merge 1 commit into
Open
larissaschiavo wants to merge 1 commit into
larissaschiavo wants to merge 1 commit into
Conversation
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.
User Story
A ReActV2 program can continue a reasoning model's tool exchange and resume saved history without losing the provider's continuation data. Previously, the next request dropped OpenRouter reasoning details and sent empty DeepSeek reasoning text, even though the initial response had supplied them.
Semantic Contract
Preserve native reasoning text and structured details from prediction metadata through tool history, Chat rendering, and ReqLLM message construction. Restoring
Imp.History.dump/1through JSON retains signatures, encrypted blocks, provider extension fields, and the original tool-call IDs. Known normalized detail keys and provider names are restored without dynamically creating atoms.ReqLLM remains the provider encoder. Anthropic signed/redacted blocks are replayed once, without adding duplicate unsigned thinking text. Operational history retains the original continuation data; ordinary history inputs, run events, and explicit diagnostic copies retain credential redaction. The ReActV2 documentation explains private history storage.
Evidence
5392bc9fand pass with this change. Six added tests cover continuation, JSON reload into a new program instance, nested detail normalization, Anthropic encoding, and redaction.mix quality.checkValidation (Elixir 1.19.6 / OTP 28, Python 3.12.14,
LIVE_PROVIDER=0 EVIDENCE_INFRASTRUCTURE=0 DSPY_CAPTURE=0):mix test test/reasoning_continuity_test.exs test/req_llm_client_test.exs test/react_v2_test.exs test/history_test.exs: 95 tests, 0 failures.mix check: 54 doctests, 9 properties, 2,914 tests, 0 failures; 13 skipped and 261 excluded. This also checks formatting and compilation with warnings as errors.mix quality.check: passed, using the repository's existing dependency-advisory exclusions.git diff --check: passed.An initial default check picked up system Python 3.9 and failed the existing HoVer fixture's
zip(strict=True)call. The complete rerun with the required Python 3.12 passed.External Evidence
No paid-provider or external-model calls were made. These checks establish behavior against the pinned ReqLLM 1.17.1 codecs and local fixtures; live provider acceptance was not tested.