Skip to content

Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.

fix: satisfy cross-platform mypy for copilot auth

JerrettDavise5cad5ed920b
diff --git a/headroom/copilot_auth.py b/headroom/copilot_auth.py
index a4540bd00..4f8c8a577 100644
--- a/headroom/copilot_auth.py
+++ b/headroom/copilot_auth.py
@@ -148,7 +148,11 @@ def _read_windows_copilot_cli_oauth_token() -> str | None:
cred_ptr = ctypes.POINTER(CREDENTIAL)
credentials = ctypes.POINTER(cred_ptr)()
count = wintypes.DWORD()
- advapi32 = ctypes.WinDLL("Advapi32.dll")
+ win_dll = getattr(ctypes, "WinDLL", None)
+ if win_dll is None:
+ return None
+
+ advapi32 = win_dll("Advapi32.dll")
advapi32.CredEnumerateW.argtypes = [
wintypes.LPCWSTR,
wintypes.DWORD,