fix(compression): add string fallback for is_copilot_model matching in Outlet

This commit is contained in:
fujie
2026-03-21 15:20:05 +08:00
parent 318e3951ff
commit c520a6fd45

View File

@@ -2716,6 +2716,13 @@ class Filter:
is_copilot = body.get("is_copilot_model", False) or body.get("metadata", {}).get("is_copilot_model", False)
if is_copilot:
return True
# Fallback for filters or responses (e.g., Outlet) which may clear the metadata payload
model_id = body.get("model", "")
if isinstance(model_id, str):
c = model_id.lower()
if "github_copilot_sdk_pipe" in c or "github_copilot_official_sdk_pipe" in c:
return True
return False
async def inlet(