mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-28 19:52:02 +00:00
move move notification auth_success from useAuth to config to support both interactive and non-interactive
This commit is contained in:
parent
4b80e4a3b7
commit
d5d7187479
4 changed files with 97 additions and 28 deletions
|
|
@ -94,9 +94,10 @@ import {
|
|||
} from '../confirmation-bus/types.js';
|
||||
import {
|
||||
PermissionMode,
|
||||
type NotificationType,
|
||||
NotificationType,
|
||||
type PermissionSuggestion,
|
||||
} from '../hooks/types.js';
|
||||
import { fireNotificationHook } from '../core/toolHookTriggers.js';
|
||||
|
||||
// Utils
|
||||
import { shouldAttemptBrowserLaunch } from '../utils/browser.js';
|
||||
|
|
@ -982,6 +983,21 @@ export class Config {
|
|||
|
||||
// Initialize BaseLlmClient now that the ContentGenerator is available
|
||||
this.baseLlmClient = new BaseLlmClient(this.contentGenerator, this);
|
||||
|
||||
// Fire auth_success notification hook (supports both interactive & non-interactive)
|
||||
const messageBus = this.getMessageBus();
|
||||
const hooksEnabled = this.getEnableHooks();
|
||||
if (hooksEnabled && messageBus) {
|
||||
fireNotificationHook(
|
||||
messageBus,
|
||||
`Successfully authenticated with ${authMethod}`,
|
||||
NotificationType.AuthSuccess,
|
||||
'Authentication successful',
|
||||
).catch(() => {
|
||||
// Silently ignore errors - fireNotificationHook has internal error handling
|
||||
// and notification hooks should not block the auth flow
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue