Skip to content

fix(copilot): CopilotOAuthProvider.save_credentials() crashes with TypeError when using device code flow #67

Description

@marcobazzani

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions