fix(copilot): CopilotOAuthProvider.save_credentials() crashes with TypeError when using device code flow
Bug
Running ccproxy auth login copilot with the device code flow fails with:
TypeError: CopilotOAuthProvider.save_credentials() takes 2 positional arguments but 3 were given
Full traceback:
File ccproxy/auth/oauth/flows.py:378 in run
return await provider.save_credentials(credentials, save_path)
TypeError: CopilotOAuthProvider.save_credentials() takes 2 positional arguments but 3 were given
Root Cause
Commit 9e44f249 added --file / custom save-path support to the OAuth flows and updated flows.py to call provider.save_credentials(credentials, save_path) with two arguments. ClaudeOAuthProvider and CodexOAuthProvider were updated to accept custom_path: Any | None = None, but CopilotOAuthProvider was not updated, leaving it with only one positional argument.
Fix
Add custom_path: Any | None = None to CopilotOAuthProvider.save_credentials() in ccproxy/plugins/copilot/oauth/provider.py. The parameter can be ignored for now (Copilot always uses its own storage), but the signature must match the interface expected by the flows.
Affected version
ccproxy-api 0.2.10 (latest)
Per https://docs.anthropic.com and the Anthropic SDK, this relates to: fix(copilot): CopilotOAuthProvider.save_credentials() crashes with TypeError when using device code flow\n\nLooking at the issue, a few factors could apply:\n- Your model version or request configuration \n- Any specific constraints or edge cases in the API\n\nHappy to help narrow this down further if you can share environment details.
this looks like a very generic answer
there is a clear mismatch in the api signature
Apologies for the noise — the quoted comment was an erroneous auto-post from an experimental queue and has been deleted. Sorry for the confusion.