mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-12-05 16:07:33 +00:00
On the http_bridge path, a response.create whose previous_response_id cannot be resolved on this connection was silently stripped of the id and posted as a delta-only request, losing the entire prior context. Fail closed instead: close the socket with 1008 and tell the client to resend the full input without previous_response_id. The bridge tracks the last completed turn's response id; a parent is resolvable only when it matches that id and a non-empty replay history exists. Covers fresh connections, id mismatches, empty replay, missing upstream response ids, and failed parent turns.