{"record":{"id":"4d3bfaa10ee8f05c","repo":"Hmbown/CodeWhale","slug":"strategy-strategy-is-macos-only-this-backend-dispatches-4d3bfa","errorCode":null,"errorMessage":"strategy \"${strategy}\" is macOS-only; this backend dispatches coordinate clicks as raw pointer events — use an element target for a semantic action","messagePattern":"strategy \"(.+?)\" is macOS-only; this backend dispatches coordinate clicks as raw pointer events — use an element target for a semantic action","errorType":"exception","errorClass":"ExecError","httpStatus":null,"severity":"error","filePath":"crates/tui/plugins/computer-use/src/backends/win32.mjs","lineNumber":116,"sourceCode":"using System.Windows.Automation;\npublic static class CUAutomationProviders {\n  public static void Register() {\n    var assembly = typeof(AutomationElement).Assembly.GetName();\n    assembly.Name = \"UIAutomationClientsideProviders\";\n    // Legacy .NET clears its one-time default-proxy flag before walking a\n    // dynamic PowerShell stack, which can throw NullReferenceException.\n    // Retry only registration (no UI action); a second failure propagates.\n    try { ClientSettings.RegisterClientSideProviderAssembly(assembly); }\n    catch (System.NullReferenceException) { ClientSettings.RegisterClientSideProviderAssembly(assembly); }\n  }\n}\n'@;\n[CUAutomationProviders]::Register();`;\n\n/** Coordinate clicks on this backend are always raw pointer events; strategy=\"a11y\" must fail closed rather than silently degrade. */\nfunction assertEventStrategy(strategy) {\n  if (strategy != null && strategy !== \"auto\" && strategy !== \"event\") {\n    throw new ExecError(`strategy \"${strategy}\" is macOS-only; this backend dispatches coordinate clicks as raw pointer events — use an element target for a semantic action`);\n  }\n}\n\nfunction unsupportedSelector(message) {\n  return Object.assign(new ExecError(message), { code: \"unsupported_selector\" });\n}\n\n// A cached child path alone is unsafe: sibling/window order can change.\n// Runtime IDs bind both the root and leaf to the observation that supplied them.\nfunction elementScript(target) {\n  const ids = [target?.runtime_id, target?.window_runtime_id];\n  if (ids.some(id => !Array.isArray(id) || !id.length || !id.every(Number.isInteger))\n      || !Array.isArray(target?.path) || target.path[0] !== 0 || !target.path.every(i => Number.isInteger(i) && i >= 0)\n      || (target.windowIndex != null && target.windowIndex !== 0) || Object.hasOwn(target, \"window_id\")) {\n    throw unsupportedSelector(\"Windows semantic actions require a fresh observed element with window and element runtime identities\");\n  }\n  const encoded = Buffer.from(JSON.stringify(target), \"utf16le\").toString(\"base64\");\n  return `${UIA_PRELUDE}","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/plugins/computer-use/src/backends/win32.mjs#L98-L134","documentation":"assertEventStrategy enforces that this Windows backend only dispatches coordinate clicks as raw pointer events. Requesting strategy values reserved for the macOS accessibility backend (anything besides null, \"auto\", or \"event\") fails closed with this ExecError instead of silently degrading accessibility strategies into raw clicks.","triggerScenarios":"Calling click/tap with { strategy: \"a11y\" } (or any non-auto/event value) while targeting coordinate-based input on the win32 backend.","commonSituations":"Shared automation code written for macOS ported to Windows; a config file that sets a global click strategy; agents selecting \"a11y\" heuristically for all platforms.","solutions":["Remove the strategy option or set it to \"auto\"/\"event\" for coordinate clicks on Windows","Use an element target (semantic/accessibility locator) if you need accessibility-driven actions","Gate strategy selection by platform in shared code instead of passing one global value"],"exampleFix":"// before\nawait click({ x: 100, y: 200, strategy: \"a11y\" });\n// after\nawait click({ x: 100, y: 200, strategy: \"auto\" }); // or use an element target for semantic action","handlingStrategy":"validation","validationCode":"const allowed = new Set([null, 'auto', 'event']);\nif (!allowed.has(strategy)) throw new SkipError(`strategy \"${strategy}\" unsupported on win32`);","typeGuard":"const isWin32ClickStrategy = (s) => s == null || s === 'auto' || s === 'event';","tryCatchPattern":null,"preventionTips":["Select strategies per-platform, never as a global config value","Default to 'auto' and let the backend resolve strategy","Use element targets when you need semantic/accessibility actions"],"tags":["win32","click-strategy","accessibility","invalid-argument","platform"],"backgroundTag":"invalid-enum-value","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}