fix(gateway): include history_offset in error return path

The error return (no final_response) was missing history_offset,
falling back to len(history) which has the same session_meta offset
bug fixed in PR #395. Now both return paths include the correct
filtered history length.
This commit is contained in:
teknium1
2026-03-04 16:26:53 -08:00
parent bd3025d669
commit 6f4941616d

View File

@@ -2031,6 +2031,7 @@ class GatewayRunner:
"messages": result.get("messages", []),
"api_calls": result.get("api_calls", 0),
"tools": tools_holder[0] or [],
"history_offset": len(agent_history),
}
# Scan tool results for MEDIA:<path> tags that need to be delivered