fix: add previous_response_id support for multi-turn tool calls (Crof fix)

Codex Desktop uses previous_response_id to chain conversation turns.
Without storing and resolving these, the proxy sent only the new
function_call_output to upstream providers, missing the original user
message and assistant tool call. This caused Crof.ai (and any provider
using tool calls) to stop after the first response.

- Add in-memory response store (50 entry LRU) keyed by response ID
- resolve_previous_response() reconstructs full input chain on multi-turn
- Fix orphan message output item when response has only tool calls
- Applies to all backends: openai-compat, anthropic, command-code
- v2.1.2
This commit is contained in:
admin
2026-05-19 20:38:39 +04:00
Unverified
parent 389866a2c6
commit cb6381afe4
6 changed files with 93 additions and 9 deletions

View File

@@ -24,6 +24,12 @@ model_catalog_json = ""
"""
CHANGELOG = [
("2.1.2", "2026-05-19", [
"Fixed Crof.ai and other providers stopping after first tool call",
"Proxy now stores and resolves previous_response_id for multi-turn conversations",
"Codex Desktop uses previous_response_id to chain turns — proxy reconstructs full context",
"Fixed orphan message output item when response is only tool calls (no text)",
]),
("2.1.1", "2026-05-19", [
"Fixed proxy: map 'developer' role to 'system' for Chat Completions providers",
"Fixed proxy: map 'developer' role to 'user' for Anthropic providers",