allow any type to handle watsonx

This commit is contained in:
Prasang Prajapati 2025-08-26 15:27:41 -04:00
parent 24697d18d4
commit 196828e40e
2 changed files with 29 additions and 1 deletions

View file

@ -2267,7 +2267,12 @@ export class ClineProvider
return
}
const userInfo = CloudService.instance.getUserInfo()
await ExtensionBridgeService.handleRemoteControlState(
userInfo,
enabled,
{ ...bridgeConfig, provider: this as any, sessionId: vscode.env.sessionId },
(message: string) => this.log(message),
)
if (!userInfo) {
this.log("[ClineProvider#remoteControlEnabled] Failed to get user info, disconnecting")

View file

@ -191,6 +191,29 @@ export async function activate(context: vscode.ExtensionContext) {
)
}
const postStateListener = () => ClineProvider.getVisibleInstance()?.postStateToWebview()
cloudService.on("auth-state-changed", postStateListener)
cloudService.on("settings-updated", postStateListener)
cloudService.on("user-info", async ({ userInfo }) => {
postStateListener()
const bridgeConfig = await cloudService.cloudAPI?.bridgeConfig().catch(() => undefined)
if (!bridgeConfig) {
outputChannel.appendLine("[CloudService] Failed to get bridge config")
return
}
ExtensionBridgeService.handleRemoteControlState(
userInfo,
contextProxy.getValue("remoteControlEnabled"),
{ ...bridgeConfig, provider: provider as any, sessionId: vscode.env.sessionId },
(message: string) => outputChannel.appendLine(message),
)
})
// Add to subscriptions for proper cleanup on deactivate.
context.subscriptions.push(cloudService)