mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-17 13:13:35 +08:00
fix(desktop): align conversationService log format + document deferred import
Code review follow-up on 94b445c: - console.error 改用 err instanceof Error ? err.message : err (跟 hahaOAuthService 一致) - dynamic import hahaOAuthService 加注释说明 defer 目的 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
94b445cd06
commit
669be1fbc6
@ -528,13 +528,18 @@ export class ConversationService {
|
||||
CLAUDE_CODE_ENTRYPOINT: 'claude-desktop',
|
||||
}
|
||||
try {
|
||||
// deferred import: avoids instantiating the OAuth singleton on every
|
||||
// ConversationService construction — only loaded when official mode hits.
|
||||
const { hahaOAuthService } = await import('./hahaOAuthService.js')
|
||||
const token = await hahaOAuthService.ensureFreshAccessToken()
|
||||
if (token) {
|
||||
env.CLAUDE_CODE_OAUTH_TOKEN = token
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('[conversationService] ensureFreshAccessToken failed:', err)
|
||||
console.error(
|
||||
'[conversationService] ensureFreshAccessToken failed:',
|
||||
err instanceof Error ? err.message : err,
|
||||
)
|
||||
}
|
||||
return env
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user