Repository navigation
fix(responses)!: reject unavailable continuation history - #48397
DevChiniwala wants to merge 9 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Merging this PR will not alter performance1 warning
Comparing Footnotes |
|
Updated in fe5be2a: upstream conflict resolved, 894 tests and all delta gates pass; CI pending, draft retained for live-provider evidence |
|
Fork Rust CI reproduces the unchanged Anthropic/Databricks beta-matrix mismatch; its source and fixture match d884167. Upstream validation still requires maintainer approval |
|
Pushed 3de002e. All 6,470 Rust tests and 894 Responses tests pass locally. The PR still needs synchronization and live-provider evidence |
|
Streaming metadata types fixed in 4dafb0e. 799 related tests and delta gates pass. Live provider proof and upstream CI remain pending |
Both our `run_async_function` and upstream's `unenforced_allowed_tools_tool_choice` imports are kept — each is used in the file. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PR overviewNo security issues were found in this pull request. Reviews
|
Handwritten 1-3 sentence description
<make-me-human-readable>Continuing a bridged Responses conversation with unavailable history returns HTTP 400 instead of answering with only the new turn. Synchronous callers also reconstruct stored history before sending a continuation
</make-me-human-readable>Details
TLDR
Problem this solves
How it solves it
Intentional product change, a continuation whose history cannot be reconstructed returns HTTP 400. Clients can send the complete conversation without
previous_response_idUser Flow
Before, a continuation can appear successful after losing earlier turns
After, the same continuation reports unavailable history
previous_response_id, with no provider requestRelevant issues
Fixes #48366
Local verification
Tested tip
4dafb0e93c1a84a2de245c8cd0113ff61f1dcbbaincludes mainff3983c1f627ad09a5e36e45cc92a0cec91afb72. The net change is limited to the four Responses files. The native extension was rebuilt from that main revisionAll 799 tests in the Responses transformation directory and CI-coverage check pass. Four missing-history regressions fail on unchanged current main and pass after the fix, covering synchronous and asynchronous calls with streaming enabled and disabled
Ruff formatting and lint pass. The strict-rule, type-discipline, test-quality and basedpyright comparisons pass against that main revision. The type result compares rule counts with existing repository diagnostics and does not claim a codebase without type errors
The follow-up keeps request maps typed and validates optional streaming metadata while retaining support for existing dictionary keys and
NoneThe fork Rust, Rust DB, Terraform and cost-map workflows do not trigger for this Python-only follow-up because their push path filters do not match it
Required upstream workflows still need maintainer approval and successful execution on the current head
Screenshots / Proof of Fix
The local regression uses a simulated provider. Before the fix, a missing-history request completes without raising the expected error. After the fix, it raises
BadRequestErrorwith status 400 and sends no provider requestLive-provider before/after proof has not been performed. This changes continuation behavior and does not qualify for the mechanical-change E2E exception. The PR remains a draft
Related work
#48408 rejects synchronous continuations. This draft reconstructs their stored history. #48421 also checks per-turn history completeness in the session layer. This draft guards empty reconstructed history, while per-turn completeness is a broader scope decision. Maintainer guidance is needed to consolidate these approaches
Pre-Submission checklist
Type
Bug Fix
Caveats
Severe
Medium
Low
Final Attestation