sprint1: agent queue worker, proxy support, auto-mark-on-navigate-away, test fixes

This commit is contained in:
Gan, Jimmy
2026-07-08 22:05:05 +08:00
parent a154bc7978
commit ffa47a1335
8 changed files with 429 additions and 28 deletions
+6 -1
View File
@@ -9,6 +9,11 @@ from db import DB_PATH
log = logging.getLogger(__name__)
def proxy_from_env():
"""Return proxy URL from HTTP_PROXY/HTTPS_PROXY env vars, or None."""
return os.environ.get("HTTP_PROXY") or os.environ.get("http_proxy") or \
os.environ.get("HTTPS_PROXY") or os.environ.get("https_proxy") or None
# Fallback pattern to retrieve the correct bytecatcode credentials
API_KEY = os.environ.get("DEEPSEEK_API_KEY", os.environ.get("OPENAI_API_KEY", ""))
BASE_URL = os.environ.get("DEEPSEEK_BASE_URL", "https://api.deepseek.com")
@@ -108,7 +113,7 @@ async def summarize_video(video_id: str) -> str | None:
]
}
async with httpx.AsyncClient(timeout=120) as client:
async with httpx.AsyncClient(proxy=proxy_from_env(), timeout=120) as client:
try:
resp = await client.post(
f"{BASE_URL}/v1/chat/completions",