Repository navigation
fix: disabled onboarding actions report the wrong automation error - #2050
Conversation
Return the standard UIA disabled HRESULT so native clients do not substitute stale worker-thread COM error info. Retain deterministic stale-error, mounted-lifetime, and no-activation coverage. Co-authored-by: Copilot App <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR returns the standard native disabled-action error and strengthens onboarding automation regression coverage. Example: An automation client invokes a disabled Current model card while its worker carries stale ElementNotAvailableException error information.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it fixes a concrete native accessibility error still present on main, and review found no introduced defect. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherSetupActionCard bridges native UI Automation Invoke requests to existing onboarding handlers; disabled requests are rejected before dispatch. flowchart LR
A[Assistive client] --> B[Native UI Automation]
B --> C[SetupActionCard peer]
C --> D[Disabled action error]
C --> E[UI dispatcher]
E --> F[Guarded onboarding handler]
Technical reviewBest possible solution: Retain the existing automation peer and availability guard, returning the native disabled HRESULT with focused stale-error and no-activation coverage. Do we have a high-confidence way to reproduce the issue? Source and native client error mapping establish the failure path, and the author reports a deterministic seeded pre-fix failure followed by repaired passes; this read-only review ran no target code. Is this the best way to solve the issue? This is the smallest complete repair: correct the error at its production owner while preserving availability, dispatch, mounting, and guarded action behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c714954e6677. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 6, 2026, 5:45 PM ET / 22:45 UTC. |
Related: #1980 (fix: keep cancellation diagnostics when setup closes). This is an independent fix; it does not include that PR's changes.
What Problem This Solves
Fixes: native UI Automation reports a disabled onboarding action as unavailable when its client worker carries unrelated COM error information.
User Impact
User impact: assistive tools receive a disabled-action error without activating the action or mistaking the still-mounted card for a removed control. No visual, configuration, or migration changes.
Why This Change Was Made
SetupActionCardreturned XAML'sE_ELEMENTNOTENABLED(0x802B001E), not nativeUIA_E_ELEMENTNOTENABLED(0x80040200). WPF's UIA client handles the former throughMarshal.ThrowExceptionForHR, which can substitute a stale caller-threadIErrorInfoexception. Return the standard native HRESULT at the existing guard, with no change to dispatch, mounting, or action policy.The original CI worker's stale-error producer is unknown. The failure mechanism is independently reproduced, not inferred solely from a passing rerun. No x64 runtime validation was available locally.
Evidence
35cddeea46223a26ef779905cc151c9fadaac6a7.disabled: TrueexpectedCOMException, receivedElementNotAvailableException; the non-clickable case and enabled positive control passed. This is historical CI evidence, not this PR's CI result.Marshal.GetHRForException(new System.Windows.Automation.ElementNotAvailableException())immediately before disabled native Invoke reproduced that exact exception mismatch locally: 1 failed, 2 passed. No card/window removal was needed.ElementNotEnabledExceptionand0x80040200. Both availability cases and enabled native activation passed: 3 passed, zero skipped.rubber-duckimplementation/proof review found no blocking correctness issue. Its implementation-detail and cleanup-constant clarity suggestions are nonblocking; no additional code change was made. Source comparison usedgit diff --binary --output=...and SHA256, not a shell text-pipeline hash. Simplification review retained the three-file fix with no new abstraction.Change Type
Scope
winnodeRequired proof pools
windows-winui-interactive: native onboarding accessibility behavior changes. Focused offscreen native UIA tests ran; the full interactive accessibility scan and visible/compositor proof have not run. This declaration is not a completed-pool claim.Validation
Local Debug validation on Windows ARM64, .NET SDK 10.0.403. Set
OPENCLAW_REPO_ROOTto the task worktree. All tests used dedicated temporaryOPENCLAW_TRAY_DATA_DIR,OPENCLAW_TRAY_APPDATA_DIR, andOPENCLAW_TRAY_LOCALAPPDATA_DIRroots. Managed tests clearedOPENCLAW_STATE_DIR,OPENCLAW_RUN_INTEGRATION, andOPENCLAW_RUN_GPU_PROOF..\build.ps1dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore --logger 'trx;LogFileName=shared-final.trx' --results-directory .\TestResults\SharedFinal --verbosity quietdotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore --logger 'trx;LogFileName=tray-final.trx' --results-directory .\TestResults\TrayFinal --verbosity quietdotnet test .\tests\OpenClaw.Tray.UITests\OpenClaw.Tray.UITests.csproj -c Debug -r win-arm64 --filter 'FullyQualifiedName~CurrentModel_NativeUia' --logger 'trx;LogFileName=current-model-repaired.trx' --results-directory .\TestResults\CurrentModelRepaired --verbosity quietdotnet test .\tests\OpenClaw.Tray.UITests\OpenClaw.Tray.UITests.csproj -c Debug -r win-arm64 --no-build --filter 'FullyQualifiedName~OnboardingAiPageTests&Category!=NativeOnboardingProof' --logger 'trx;LogFileName=onboarding-repaired.trx' --results-directory .\TestResults\OnboardingRepaired --verbosity quiet.\scripts\validate-docs.ps1git -c core.whitespace=cr-at-eol diff --check.\scripts\setup-dev.ps1 -CheckOnlyFresh-worktree managed
--no-restoreattempts initially failedNETSDK1004. Both projects then executed successfully without that flag to restore assets, followed by a successful rerun of the full build and both required--no-restorecommands. The initial focused-r win-x64test launch aborted before executing tests because no x64 .NET host is installed; the executed native proof is ARM64 only.Real Behavior Proof
Environment tested: Windows ARM64, Debug
win-arm64, fixture-owned offscreen HWND and isolated profiles, syntheticPageTransport; no real Gateway or OS input.PR head or commit tested:
f96fd5ce5fcea880861b621af4c02cca401a1201. Tests ran on the identical uncommitted three-file source on parent04f413d26531d3ea19cb108291334bb3cc5fd6e6before commit. Manually recorded binary-capable diff SHA256:BB338051A8EA62A440175E9759043A468BF3179ADC0E2610C0E261FC5061AAA6, rechecked unchanged before commit. This is source correspondence, not a new post-commit execution or formal binary freeze.Exact steps or command run: the
FullyQualifiedName~CurrentModel_NativeUiacommand in Validation, coveringCurrentModel_NativeUiaRespectsActionAvailabilityfordisabled: TrueandFalse, plusCurrentModel_NativeUiaInvokeStartsTheSelectedActivation.Evidence after fix:
Observed result: disabled Invoke returns typed native disabled error despite stale COM error info; the card remains mounted and no activation/completion occurs. Non-clickable cards advertise no Invoke; the enabled native action activates and verifies the selected model once.
Screenshot or artifact links verified? (
Yes/No/N/A): N/A. Copied local execution output above; no public screenshot or local-file link presented as public evidence.Not verified or blocked: no x64 runtime run, no full interactive accessibility scan or pixel/compositor proof, no formal proof-pool completion. Exact producer of stale
IErrorInfoin the historical CI worker is unknown. No real Gateway, WSL, installed Companion, or shared services were changed or driven. Hosted checks on this PR are pending, not claimed passed.Security Impact
Yes/No): NoYes/No): NoYes/No): NoYes/No): No. Existing native UIA invocation availability is preserved; only its disabled error is corrected.Yes/No): NoYes, explain the risk and mitigation: N/A.Compatibility and Migration
Yes/No): Yes. Native clients now receive the standard disabled-action HRESULT; callers depending on the prior XAML-specific code should use the UIA contract.Yes/No): NoYes/No): NoReview Conversations