Repository navigation
Conversation
|
|
@mateo-berri Could you review? One-commit follow-up to #44127: streamed reasoning done items now carry the same encrypted_content as response.completed. 100 checks green, Greptile 5/5. |
Codecov Reportβ All modified and coverable lines are covered by tests. π’ Thoughts on this report? Let us know! |
3a9f3e7 to
dc60d77
Compare
β¦events response.output_item.done for a reasoning item only carried the summary text. The signed and redacted thinking blocks were encoded into encrypted_content on response.completed alone, so a client that persists the streamed items replays the next turn without the signed thinking. Encode the accumulated thinking_blocks with the shared helper when the done event is built, so the item carries the same encrypted_content as the completed response. Nothing changes when no snapshot exists yet.
dc60d77 to
5aa4332
Compare
|
Rebased onto current main, preserving upstream tool-search changes. All 407 targeted tests pass, and live signed-thinking replay still matches |
|
@greptileai Please review the rebased commit |
Signed-off-by: jinwukong <134120444+jinwukong@users.noreply.github.com>
Signed-off-by: jinwukong <134120444+jinwukong@users.noreply.github.com>
|
Need this as well. We save the streamed reasoning done item and replay it, so the signed thinking has to be on that event. |
|
Conflicts resolved, 584 local tests pass. @mateo-berri, could you approve CI? Another user also needs signed thinking on streamed reasoning events |
Handwritten 1-3 sentence description
[insert handwritten description here]
Details
TLDR
Problem this solves:
How it solves it:
User Flow
Before, a client saving streamed items loses the signed thinking blocks
POST http://localhost:4000/v1/responseswith streaming, reasoning and a function toolresponse.output_item.doneitem for the next turnresponse.completedAfter, the saved reasoning item carries that replay payload
POST http://localhost:4000/v1/responsesresponse.output_item.doneitem, now including the reasoning item'sencrypted_contentRelevant issues
Fixes #46032
Follow-up to #43010 and #44127, which fixed duplicated thinking text. Supersedes #40673, narrowed to this one defect
Pre-Submission checklist
cc4ea66780. Removing the done-item payload makes all eight replay regression cases fail, and restoring it returns all 584 tests to greencc4ea66780. The current tip's GitHub Actions workflows areaction_required, with no jobs started, and need maintainer approvalMerged main
478d9bf5d2intocc4ea66780, preserving upstream's sequence-number and refusal tests alongside the replay regressions. The no-snapshot test now uses the helper's updated signature. The diff remains two files, +116/-1BASE_REF=origin/main make checkpasses, including source/test lint, formatting, strict-ruff, type-discipline, test-quality, OpenAPI docs, basedpyright gates and API schema sync. All added executable lines are covered by the two transformation test files, with 93% line coverage for the streaming iterator overallLocal test command, with the locked development dependencies installed, is
LITELLM_LOCAL_MODEL_COST_MAP=True uv run --no-sync python -m pytest tests/unit/responses/litellm_completion_transformation/test_streaming_iterator_transformation.py tests/unit/responses/litellm_completion_transformation/test_litellm_completion_responses.py -qScreenshots / Proof of Fix
The October 18 live proof below was tested at
5aa433250cand is retained as historical evidence, not a fresh run atcc4ea66780. The signed-thinking payload implementation is unchanged, and this merge preserves upstream behavior while updating one test for centralized sequence numbering. Current-tip verification is the 584 passing tests, covered added lines, mutation check andmake checkreported above. Hosted CI and automated reviews still need to completeLive comparison on October 18 using
anthropic/claude-opus-5-5, through the Python proxy with real provider calls. The local proxy has a generated master key.ANTHROPIC_API_KEYandLITELLM_MASTER_KEYare supplied through the environmentSave this as
request.json{ "model": "replay-check", "input": [{"role": "user", "content": "A warehouse has five boxes containing 1469 screws each and 73 spare screws. Work out the number packed in the boxes, then use the addition tool to combine it with the spare screws. After the tool returns, answer with only the total."}], "stream": true, "max_output_tokens": 2048, "reasoning": {"effort": "high"}, "tools": [{"type": "function", "name": "add", "description": "Add two integers and return their sum.", "parameters": {"type": "object", "properties": {"a": {"type": "integer"}, "b": {"type": "integer"}}, "required": ["a", "b"], "additionalProperties": false}, "strict": true}] }Run the same commands against each checkout's proxy. The second request uses only the saved done items and the tool result
Before (
7db8fc81f9)encrypted_content, so the saved items contain zero signed thinking blocks7418, but the signed thinking from the completed response was not preservedAfter (
5aa433250c)encrypted_contentidentical to the completed response, containing one signed thinking block7418, preserving that signed thinking blockThe observed change is replay-data preservation. The before case also returns the correct arithmetic answer
Type
Bug Fix