From 2aa5932d448f0b850c3399bffd2dad017952be33 Mon Sep 17 00:00:00 2001 From: marcobazzani Date: Mon, 11 May 2026 11:36:21 +0200 Subject: [PATCH] fix(copilot): add missing custom_path param to save_credentials MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DeviceCodeFlow (and other OAuth flows) call provider.save_credentials with two positional arguments — credentials and save_path — matching the signature of ClaudeOAuthProvider and CodexOAuthProvider. CopilotOAuthProvider only accepted one positional argument, causing: TypeError: CopilotOAuthProvider.save_credentials() takes 2 positional arguments but 3 were given This was introduced in commit 9e44f249 which added --file / custom save-path support to the OAuth flows but forgot to update the Copilot provider to match the new interface. Fix: add custom_path: Any | None = None to the signature for interface compatibility. The Copilot provider ignores the value (it always writes to its own storage) — the parameter is purely a protocol alignment fix. --- ccproxy/plugins/copilot/oauth/provider.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ccproxy/plugins/copilot/oauth/provider.py b/ccproxy/plugins/copilot/oauth/provider.py index 0ea92668..4234695f 100644 --- a/ccproxy/plugins/copilot/oauth/provider.py +++ b/ccproxy/plugins/copilot/oauth/provider.py @@ -473,11 +473,18 @@ async def load_credentials(self, custom_path: Any | None = None) -> Any | None: ) return None - async def save_credentials(self, credentials: CopilotCredentials | None) -> bool: + async def save_credentials( + self, + credentials: CopilotCredentials | None, + custom_path: Any | None = None, + ) -> bool: """Save credentials to storage. Args: credentials: Copilot credentials to save (None to clear) + custom_path: Optional custom storage path (accepted for interface + compatibility with other providers but unused — Copilot + credentials are always written to the provider's own storage). Returns: True if save was successful