fix(agent): preserve copilot routed headers

This commit is contained in:
konsisumer 2026-06-04 17:20:58 +02:00 committed by Teknium
parent b6a4638b6d
commit 3e354b61db
4 changed files with 53 additions and 0 deletions

View file

@ -3557,6 +3557,9 @@ class AIAgent:
import httpx as _httpx
import socket as _socket
if "api.githubcopilot.com" in str(base_url or "").lower():
return _httpx.Client()
_sock_opts = [(_socket.SOL_SOCKET, _socket.SO_KEEPALIVE, 1)]
if hasattr(_socket, "TCP_KEEPIDLE"):
_sock_opts.append((_socket.IPPROTO_TCP, _socket.TCP_KEEPIDLE, 30))