From 5ec8b199e0a12fb51606dd01d1c304769ac21bed Mon Sep 17 00:00:00 2001 From: Marcel Roozekrans Date: Sun, 22 Mar 2026 19:55:50 +0100 Subject: [PATCH 1/2] fix(auth): use correct publisher.extensionId in OAuth callback URI The callback URI was vscode://lucent-code/oauth-callback but VS Code URI handlers require the publisher.extensionId format: vscode://lucentcode.lucent-code/oauth-callback Co-Authored-By: Claude Sonnet 4.6 --- src/core/auth.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/auth.ts b/src/core/auth.ts index 888716f..7d34efd 100644 --- a/src/core/auth.ts +++ b/src/core/auth.ts @@ -96,7 +96,7 @@ export class AuthManager { this.pendingOAuth = { state, codeVerifier }; const callbackUri = await vscode.env.asExternalUri( - vscode.Uri.parse('vscode://lucent-code/oauth-callback') + vscode.Uri.parse('vscode://lucentcode.lucent-code/oauth-callback') ); const params = new URLSearchParams({ From 875aa71fe3a5483593ed49357e14877b0268cd74 Mon Sep 17 00:00:00 2001 From: Marcel Roozekrans Date: Sun, 22 Mar 2026 20:04:50 +0100 Subject: [PATCH 2/2] fix: address code review findings - Fix stale comment referencing old OAuth callback URI - Add .catch() on handleOAuthCallback to prevent unhandled rejection - Use 'unknown' type in .catch() handlers (not 'Error') for correctness Co-Authored-By: Claude Sonnet 4.6 --- src/extension.ts | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index 655cf49..c8b36fb 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -82,8 +82,8 @@ export async function activate(context: vscode.ExtensionContext) { } // Non-critical: don't let skill loading crash activation - await loadSkills().catch((e: Error) => - console.warn('[Lucent Code] Failed to load skills:', e.message) + await loadSkills().catch((e: unknown) => + console.warn('[Lucent Code] Failed to load skills:', e instanceof Error ? e.message : String(e)) ); // Register chat webview @@ -108,15 +108,15 @@ export async function activate(context: vscode.ExtensionContext) { } // Non-critical: don't let MCP connection crash activation - await connectMcpServers().catch((e: Error) => - console.warn('[Lucent Code] Failed to connect MCP servers:', e.message) + await connectMcpServers().catch((e: unknown) => + console.warn('[Lucent Code] Failed to connect MCP servers:', e instanceof Error ? e.message : String(e)) ); if (workspaceRoot) { indexer.start(workspaceRoot) .then(() => { indexerStatusBar.text = '$(database) Indexed'; }) .catch((e: Error) => { - console.error('[Indexer] Failed to start:', e.message); + console.error('[Indexer] Failed to start:', e instanceof Error ? e.message : String(e)); indexerStatusBar.text = '$(warning) Index failed'; }); } @@ -149,8 +149,8 @@ export async function activate(context: vscode.ExtensionContext) { // Set up instructions loader const instructionsLoader = new InstructionsLoader(); - await instructionsLoader.load().catch((e: Error) => - console.warn('[Lucent Code] Failed to load instructions:', e.message) + await instructionsLoader.load().catch((e: unknown) => + console.warn('[Lucent Code] Failed to load instructions:', e instanceof Error ? e.message : String(e)) ); instructionsLoader.watch(); contextBuilder.setInstructionsLoader(instructionsLoader); @@ -331,12 +331,14 @@ export async function activate(context: vscode.ExtensionContext) { }) ); - // Register URI handler for OAuth callback (vscode://lucent-code/oauth-callback) + // Register URI handler for OAuth callback (vscode://lucentcode.lucent-code/oauth-callback) context.subscriptions.push( vscode.window.registerUriHandler({ handleUri(uri: vscode.Uri) { if (uri.path === '/oauth-callback') { - auth.handleOAuthCallback(uri); + auth.handleOAuthCallback(uri).catch((e: unknown) => + console.error('[Lucent Code] OAuth callback failed:', e instanceof Error ? e.message : String(e)) + ); } }, })