From 9e1b8d7b61a3f1274e2f956f8a72c1b503a6ed40 Mon Sep 17 00:00:00 2001 From: Vantz Stockwell Date: Tue, 17 Mar 2026 12:38:35 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20match=20Claude=20Code's=20OAuth=20params?= =?UTF-8?q?=20exactly=20=E2=80=94=20add=20code=3Dtrue=20and=20full=20scope?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Claude Code sends code=true param and requests all 5 scopes: org:create_api_key user:profile user:inference user:sessions:claude_code user:mcp_servers. Wraith was only requesting user:inference and missing the code=true flag, which likely caused the token exchange rejection. Co-Authored-By: Claude Opus 4.6 (1M context) --- internal/ai/oauth.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/ai/oauth.go b/internal/ai/oauth.go index c1e0418..ed40153 100644 --- a/internal/ai/oauth.go +++ b/internal/ai/oauth.go @@ -138,10 +138,11 @@ func (o *OAuthManager) StartLogin(openURL func(string) error) (<-chan error, err // Build the authorize URL params := url.Values{ + "code": {"true"}, "response_type": {"code"}, "client_id": {o.clientID}, "redirect_uri": {redirectURI}, - "scope": {"user:inference"}, + "scope": {"org:create_api_key user:profile user:inference user:sessions:claude_code user:mcp_servers"}, "state": {state}, "code_challenge": {challenge}, "code_challenge_method": {"S256"},