From 318c94286005bd821ace957a789d5675a7f95ff7 Mon Sep 17 00:00:00 2001 From: "lilong.129" Date: Mon, 21 Jul 2025 14:52:53 +0800 Subject: [PATCH] change: addDeviceContextForWings --- internal/version/VERSION | 2 +- uixt/driver_ext_ai.go | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/internal/version/VERSION b/internal/version/VERSION index 2472fe80..d486bb38 100644 --- a/internal/version/VERSION +++ b/internal/version/VERSION @@ -1 +1 @@ -v5.0.0-250720 +v5.0.0-250721 diff --git a/uixt/driver_ext_ai.go b/uixt/driver_ext_ai.go index 9fa43ffb..1b384f6f 100644 --- a/uixt/driver_ext_ai.go +++ b/uixt/driver_ext_ai.go @@ -288,14 +288,6 @@ func (dExt *XTDriver) AIAssert(assertion string, opts ...option.ActionOption) (* return assertResult, nil } -// Context key types to avoid collisions -type contextKey string - -const ( - deviceIDKey contextKey = "device_id" - platformTypeKey contextKey = "platform_type" -) - // PlanNextAction performs planning and returns unified planning information func (dExt *XTDriver) PlanNextAction(ctx context.Context, prompt string, opts ...option.ActionOption) (*PlanningExecutionResult, error) { if dExt.LLMService == nil { @@ -514,6 +506,14 @@ func (dExt *XTDriver) AIQuery(text string, opts ...option.ActionOption) (*AIExec return aiResult, nil } +// Context key types to avoid collisions +type contextKey string + +const ( + deviceIDKey contextKey = "device_id" + platformTypeKey contextKey = "platform_type" +) + // addDeviceContextForWings adds device information to context for Wings service func (dExt *XTDriver) addDeviceContextForWings(ctx context.Context) context.Context { device := dExt.GetDevice() @@ -533,6 +533,10 @@ func (dExt *XTDriver) addDeviceContextForWings(ctx context.Context) context.Cont platformType = "ios" case *HarmonyDevice: platformType = "harmony" + case *BrowserDevice: + platformType = "browser" + default: + platformType = "unknown" } ctx = context.WithValue(ctx, platformTypeKey, platformType)