fix(dspy): preserve ReAct tool history when output names collide #10922
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.35) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.35 · 173 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.309
Real PR Conversation Timeline
1 comments
"Review active on #10922"
general
weight: 0.35
chrikrah
📝 Changes Description
A ReAct planner can declare
question -> tool_calls: list[str]. On7fbc8ff, returning["lookup"]fromsubmitalso replaces the history event’s structured tool calls with that list. Passing the history into a second call drops the previous nativesubmitcall and its result from the model request.ReAct now copies final outputs into the history event only when their names are outside the inner predictor’s signature. The application still reads
prediction.tool_calls == ["lookup"], and the follow-up request replays the original call and result with their matching ID.The offline regression inspects the second request for both parts. All four sync/async and normal/forced-submit cases failed on the baseline and pass with the fix.
✅ Contributor Checklist
ty check.fix(dspy)format.Validation
pytest tests/predict/test_react.py tests/predict/test_react_v2.py tests/streaming/test_react_native_tool_stream.py --extra -q— 118 passed.pytest tests/adapters/test_chat_adapter.py tests/adapters/test_json_adapter.py tests/adapters/test_xml_adapter.py -k history -q— 32 passed.⚠️ Warnings
Codex wrote the implementation, documentation and regression test, and ran the local checks. The model responses in the regression are scripted.