Skip to content

fix(setup): preserve sanitized Local AI verification errors - #1716

Merged
karkarl merged 1 commit into
openclaw:mainfrom
joelagnel:fix/local-ai-verification-diagnostics
Oct 15, 2026
Merged

karkarl merged 1 commit into
openclaw:mainfrom
joelagnel:fix/local-ai-verification-diagnostics

Conversation

@joelagnel

@joelagnel joelagnel commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

A user reported native Gateway Local AI verification failing despite retries. The setup page replaces the detailed cause with generic provider rejection text. Retain the returned verification error, display bounded sanitized details, clear stale details on retry, and preserve the current RPC exception when an earlier rejection settles.

Improves diagnostics for #1713. This does not claim to resolve the underlying native inference instability. Installer lifecycle changes remain separate in #1715.

The review update fixes both existing reflection calls to ShowError by supplying its optional detail argument explicitly. No new test files or test methods. One commit: 02857835f2b692ce04eddf4870a2cfaf6052f48d.

Required proof pools

  • windows-11-arm64: independent branch build and regression tests.
  • windows-winui-interactive: both affected normal UI variants pass; earlier diagnostic component captures are below. The additional foreground-dependent capture variants are blocked as described below.

Validation

All new execution/testing used the requested Windows 11 ARM64 device, in a separate checkout and isolated profile.

.\build.ps1
dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj
dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj
dotnet test .\tests\OpenClaw.SetupEngine.Tests\OpenClaw.SetupEngine.Tests.csproj
dotnet test .\tests\OpenClaw.Tray.UITests\OpenClaw.Tray.UITests.csproj -r win-arm64 -p:Platform=ARM64 --no-build --filter "FullyQualifiedName~ProviderLoading_StaysInlineAndCanCancelWithoutOpeningAPopup|FullyQualifiedName~FollowupProof_ProviderInlineLoadingCancelAndInput"
Command / selection Passed Failed Skipped
./build.ps1 Build passed 0 N/A
Shared tests 4,261 0 36
Tray tests 4,000 0 0
SetupEngine tests 2,288 0 1
ProviderLoading_StaysInlineAndCanCancelWithoutOpeningAPopup (Light/Dark) 2 0 0
FollowupProof_ProviderInlineLoadingCancelAndInput (Light/Dark) 0 2 foreground assertion failures 0

Baseline: both normal UI variants failed with System.Reflection.TargetParameterCountException: Parameter count mismatch. Both pass with the two existing call sites corrected. Tests restored/built explicitly; none of these results are empty --no-restore runs.

Independent code review and structured review found no actionable findings. Commit-coherence advisory: OK. All changed source files match the tested checkout after CRLF/LF normalization.

Proof completed

The required build/regression validation and the two affected normal UI variants are complete. The production diagnostic files are unchanged in this review revision, so the earlier controlled component captures below still show the same returned-cause, redaction, and retry behavior.

Real behavior proof

Earlier product-page component proof, using controlled Gateway replies:

Baseline generic rejection

Returned HTTP 503 cause with the simulated credential redacted

Current retry RPC error retained

The fresh run also launched the actual OpenClaw.Tray.WinUI.exe, discovered local MCP tools before invocation, connected to an authenticated controlled Gateway, and navigated through the existing-Gateway connection and PC-access pages to the actual Connect your AI page. Copied live UI diagnostics contained:

Connect your AI
Choose a model or connect an AI provider.
Detected AI access
Local AI verification proof
Controlled Gateway response
Use this model
Refresh
Step 4 of 5

Not verified / blocked

The two opt-in native capture variants failed their foreground-window assertion: Windows returned GetForegroundWindow() == 0. The live setup window could be read, but automated card activation/capture could not complete in this desktop state. Fresh shipped-app rejection/retry screenshots remain unverified; no foreground or capability bypass was substituted. Controlled component diagnostics and normal UI regression tests passed as reported above.

Native model startup/GPU inference was not exercised by these controlled diagnostics checks. The reported runtime instability stays tracked separately in #1713.

@clawsweeper

clawsweeper Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@joelagnel

joelagnel commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator Author

@clawsweeper review

Please review the current head (dabce8e). The PR body includes the Windows 11 ARM64 test machine validation, component receipts/screenshots, and the remaining proof limits.

@clawsweeper

clawsweeper Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 13, 2026
@clawsweeper

clawsweeper Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex review: needs maintainer review before merge.

What this changes

This PR displays sanitized verification failures and preserves the current error when a retry fails.

Example: Model verification returns HTTP 503 with apiKey=demo-secret, then Check again encounters a distinct RPC failure.

  • Before: Generic rejection hides the verification cause and can replace the retry error.
  • After: The HTTP 503 cause appears with apiKey=[REDACTED], then the current sanitized RPC error replaces it.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused patch is correct and now has shipped-entry-point proof; overall scope remains a partial repair of the linked issue because inference failure is unresolved.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): karkarl's exact-head Windows ARM64 report exercises GatewayAiSetupClient and AiSetupPage through the unmodified Companion and controlled loopback Gateway: published live UI output shows the rejected verification cause redacted, then the distinct retry RPC error retained without stale detail. This satisfies the prior rank-up request; native GPU inference and unpublished screenshots are not claimed as reviewed proof.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Partial
User problem: Failed model verification shows generic rejection instead of its returned cause, and retry settlement can hide the current error.
Reason: The diagnostic repair is useful and narrowly scoped, with feature-owner feedback supporting its direction; it correctly avoids claiming to resolve the broader linked inference issue.

Merge readiness

✅ Ready for maintainer review

Keep open for landing: current main still loses verification details, both reflection callers are corrected, and no actionable defect remains.

Priority: P2
Reviewed head: 02857835f2b692ce04eddf4870a2cfaf6052f48d

Before merge

None.

Findings

None.

Agent review details

How this fits together

GatewayAiSetupClient receives verification replies from the connected Gateway; AiSetupPage presents their sanitized details alongside localized recovery guidance.

flowchart LR
  A[Setup action] --> B[GatewayAiSetupClient]
  B --> C[Gateway verification RPC]
  C --> D[Verification result or exception]
  D --> E[AiSetupPage]
  E --> F[Existing sanitizer]
  F --> G[Bounded error display]
Loading

Technical review

Best possible solution:

Land the focused diagnostic repair while retaining the underlying inference investigation in #1713.

Do we have a high-confidence way to reproduce the issue?

Current-main source deterministically discards returned verification details and overwrites rejected-state errors; inspected baseline captures support that path, without reproducing native inference instability.

Is this the best way to solve the issue?

Retaining the validated failure in the existing client and sanitizing it in the existing page fixes lost diagnostics without changing verification or recovery ownership.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 9e4999c6d43f.

Provenance checked

  • Verification error presentation and request settlement changes intended behavior with a stated reason (3eed1f1: Focused onboarding established localized verification and recovery states; no inspected rationale requires suppressing sanitized verification details.)
  • Selection-rejection exception details keeps the original intent (76ab839: Native Local AI recovery added concrete selection-rejection feedback; this patch preserves the detail through the shared sanitized display path.)
  • Existing inline-provider UI tests keeps the original intent (c3d622f: The tests protect inline provider loading and error presentation; supplying the optional reflection argument preserves those assertions.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Verified introduced change: The pinned introduction changes only error retention, sanitized presentation, settlement handling, and the two existing reflection callers; the verified test merge preserves that scope. (src/OpenClaw.SetupEngine.UI/Pages/AiSetupPage.xaml.cs:1218, 02857835f2b6)
  • Current main still needs this diagnostic repair: Current main validates the returned failure but does not retain its Error field; ShowError displays localized text alone and settlement unconditionally replaces rejected-state errors. (src/OpenClaw.SetupEngine/GatewayAiSetupClient.cs:344, 9e4999c6d43f)
  • Fresh shipped-application proof clears the previous blocker: karkarl's fix(setup): preserve sanitized Local AI verification errors #1716 (comment) publishes exact-head Windows ARM64 live UI output from the actual Companion, showing HTTP 503 retention, credential redaction, and a distinct retry RPC error remaining visible after settlement; the controlled server recorded both verification calls. (02857835f2b6)
  • Validation and corrected reflection regression: The author reports both normal Light/Dark UI variants passing after reproducing the reflection failure; karkarl independently reports the full build and 10,550 Shared, Tray, and SetupEngine tests passing, with 36 skips. Foreground-dependent capture variants remain explicitly excluded from passing claims. (tests/OpenClaw.Tray.UITests/OnboardingAiPageTests.cs:394, 02857835f2b6)
  • Inspected supporting screenshots: Prepared local images show the earlier component-host baseline, returned HTTP 503 with redacted credential, and retained retry error; the reporter image shows the separate native verification failure. These support the fresh published live output without treating component captures as shipped-app proof.
  • Existing sanitization boundary: ShowError sanitizes details before limiting them to 2,048 characters; SetupLogger delegates to the shared secret and identity sanitizer. No new transport, authority, or persistence behavior is introduced. (src/OpenClaw.SetupEngine/SetupLogger.cs:128, 02857835f2b6)

Likely related people:

  • Karen: Raw commit 7dcbc2f adds src/OpenClaw.SetupEngine.UI/Pages/AiSetupPage.xaml.cs:1223 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 7dcbc2f798a8; files: src/OpenClaw.SetupEngine.UI/Pages/AiSetupPage.xaml.cs)

Review metrics

Metric Value Why it matters
Change size Production +21/-7 lines; tests +2/-2 lines Small growth directly supports diagnostic retention and sanitization; test changes repair existing reflection callers without adding test machinery.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.
  • remove proof: 📸 screenshot: Current real behavior proof evidence kind is live_output.

Label justifications:

  • P2: This is a focused diagnostic improvement for failed verification; it does not itself repair the separately reported blocked inference workflow.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (6 earlier review cycles)
  • reviewed 2026-10-13T17:39:29.147Z sha dabce8e :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-13T17:44:24.269Z sha dabce8e :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-13T17:56:31.220Z sha dabce8e :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-13T18:11:37.394Z sha dabce8e :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-13T18:31:18.396Z sha dabce8e :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-14T23:43:34.570Z sha 0285783 :: needs real behavior proof before merge. :: none

Reviewed October 15, 2026, 12:35 AM ET / 04:35 UTC (Revision 7).

@joelagnel
joelagnel marked this pull request as ready for review October 13, 2026 17:52
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Oct 13, 2026
@joelagnel

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

Proof capture is completed for the documented diagnostic scope at dabce8e. The PR description now records that scope explicitly, with current-head before/after screenshots and controlled verification/retry receipts demonstrating HTTP 503 error retention, redaction, and current retry-error retention. The product AI setup page was exercised in a temporary WinUI host.

Please reassess the proof labels against this scope: proof: sufficient and removal of status: 📣 needs proof. The separately reported native inference instability remains tracked in #1713.

@clawsweeper

clawsweeper Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@bkudiess

Copy link
Copy Markdown
Collaborator

The diagnostics change looks reasonable, but I found one introduced UI-test regression that needs fixing before merge. Reviewed head: dabce8e93e1824a10291c152b33a0c4a7956cdd2.

Update the UI tests for the new ShowError parameter

ShowError now accepts an optional detail parameter. Normal C# calls can leave that out, but these tests invoke the method through reflection, which still needs an argument for each parameter. The two calls in OnboardingAiPageTests.cs:393–394 and 428–429 pass only "Failed", so they throw before reaching the assertions that check the inline error display.

The UI CI run confirms this failure in both Light and Dark. The native-proof test has the same call, though that category was excluded from the run.

Could you update both calls to .Invoke(page, ["Failed", null]) and rerun the affected UI tests, including the native-proof case when its prerequisites are available?

Keep the Gateway verification failure available to the AI setup page and display bounded, sanitized details. Clear stale details on retry and preserve the current RPC exception when a prior rejection settles.
@joelagnel
joelagnel force-pushed the fix/local-ai-verification-diagnostics branch from dabce8e to 0285783 Compare October 14, 2026 23:34
@joelagnel

Copy link
Copy Markdown
Collaborator Author

Both existing reflection call sites now pass the optional ShowError detail argument explicitly in commit 02857835f2b692ce04eddf4870a2cfaf6052f48d.

On the requested Windows ARM64 device, the normal Light/Dark variants reproduced TargetParameterCountException before the change and both pass afterward. Full build plus Shared (4,261), Tray (4,000), and Setup (2,288) tests passed. No new test files or methods were added.

The two additional native capture variants were attempted and failed their foreground-window assertion (GetForegroundWindow() == 0), before reaching the reflection call. The actual Companion executable also connected to the controlled Gateway and reached its AI selection page. The PR body distinguishes these live checks from the earlier diagnostic component screenshots and records the remaining capture blocker.

Independent code review, structured review, and final commit-coherence checks passed.

@clawsweeper review

Please re-review head 02857835f2b692ce04eddf4870a2cfaf6052f48d, including the corrected test callers and updated validation/proof scope.

@clawsweeper

clawsweeper Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@karkarl

karkarl commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

Independent local validation completed on a native Windows ARM64 device at exact head 02857835f2b692ce04eddf4870a2cfaf6052f48d on October 15 UTC. These are fresh executions in an isolated worktree/profile, not a restatement of hosted CI or the author's earlier results. The live PR head was checked again before posting and is unchanged.

Local build and tests

Command Result
.\build.ps1 Passed. Shared, CLI, WinNode CLI, SetupEngine, and WinUI built successfully; product runtime win-arm64, Debug configuration.
dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --logger 'trx;LogFileName=pr1716-shared.trx' --results-directory $d 4,262 passed, 35 skipped, 0 failed
dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --logger 'trx;LogFileName=pr1716-tray.trx' --results-directory $d 4,000 passed, 0 skipped, 0 failed
dotnet test .\tests\OpenClaw.SetupEngine.Tests\OpenClaw.SetupEngine.Tests.csproj --logger 'trx;LogFileName=pr1716-setup.trx' --results-directory $d 2,288 passed, 1 skipped, 0 failed

$d was this validation session's artifact directory. OPENCLAW_REPO_ROOT pointed at the exact-head worktree, and OPENCLAW_TRAY_DATA_DIR pointed at an isolated test profile. Restore was intentionally enabled for these first runs; the TRX receipts confirm actual test execution, not an empty --no-restore success. Total: 10,550 passed, 36 skipped, 0 failed. Skipped cases are not claimed as executed proof.

Fresh actual-Companion behavior proof

The additional interactive run used the unmodified built OpenClaw.Tray.WinUI.exe, isolated fixture-owned data roots, and a controlled loopback Gateway. Local MCP discovery and app.status succeeded. The actual application followed Welcome -> existing-Gateway connection -> PC capabilities -> Connect your AI -> detected model card -> verification failure -> Check again. This was not a temporary page/component host.

Copied live UI output from the visible verification error:

The selected model did not pass verification. Setup is not complete.
HTTP 503: controlled Local AI verification rejection. apiKey=[REDACTED]

Copied live UI output after clicking Check again and receiving a distinct RPC failure:

The setup outcome is not confirmed. Refresh after the gateway reconnects,
or cancel the current session. Another activation will not be started.
Current retry RPC error: controlled service unavailable. token=[REDACTED]

A later UI Automation read confirmed that the current retry error remained displayed, with neither the old HTTP 503 detail nor the synthetic credential present. The server recorded exactly two verification RPCs: a negative verification result in a successful RPC envelope, followed by the controlled retry RPC error.

Focused screenshots of both actual-application states were captured with owned-window PrintWindow(PW_RENDERFULLCONTENT), inspected, and checked against their SHA-256 receipts. Those images remain local and are not attached to this comment; the redacted live UI output above is the published behavior evidence. This successful run supersedes the earlier foreground-blocked attempt for this diagnostic scenario. The PR body has not been edited.

Scope: this covers the diagnostic behavior on windows-11-arm64 and windows-winui-interactive, using controlled replies. It does not prove native GPU/model inference, real Gateway pairing, or resolve the underlying failure in #1713. The product source was unchanged, and the owned app, fixture listeners, and temporary profiles were cleaned up.

@clawsweeper re-review

Please re-review head 02857835f2b692ce04eddf4870a2cfaf6052f48d with these independent local ARM64 results and the fresh actual-Companion rejection/redaction/retry evidence.

@clawsweeper

clawsweeper Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. labels Oct 15, 2026
@karkarl

karkarl commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

Repeat Hanselman review: no actionable findings

Verdict: no blocking or actionable introduced defects found. Both independent reviewers support landing this narrowly scoped diagnostic fix, subject to the normal final head/base readiness check.

Reviewed head: 02857835f2b692ce04eddf4870a2cfaf6052f48d.
Introduced-change baseline: 16299381a4df3a5bc025d092d830fe68cb3c6314.
The previously reviewed head is identical. There is no source delta; this requested rerun focused on high-risk decisions and earlier theoretical concerns, rather than claiming new changes.

Independent reviewers ran in parallel:

  • Claude Opus 5.5 (claude-opus-5.5, high reasoning).
  • GPT-6 Astra (gpt-6-astra, high reasoning, long_context).

Both inspected pinned Git blobs, not the newer code in the working checkout. Their conclusions were reconciled against the exact-head source.

Both models agree: HIGH consensus

Issue Opus 5.5 GPT-6 Astra Fix Confidence
Actionable introduced defects None None N/A: no fix required

Both checked that verification detail is cleared before a retry and retained only after cancellation, authority, connection-generation, and response checks. Both confirmed that current exception detail takes precedence, sanitization occurs before the 2,048-character limit, request settlement preserves the current error, and both reflection callers match the new method signature. Existing client/page ownership and inline-error routing remain intact.

Key source: verification lifecycle, request settlement, and sanitized presentation.

Only one model noted concerns: LOW consensus

Issue Opus 5.5 GPT-6 Astra Fix Confidence
Previous rejected-state detail during cancellation LOW/theoretical; no concrete introduced impact not flagged N/A: not retained as a defect
Truncation at a UTF-16 surrogate boundary Non-blocking display-robustness observation not flagged N/A: no required fix established

Neither concern established an actionable regression after reconciliation. No fix is proposed. Fix confidence is a coordinator assessment, not a vote; no numeric fix rating is assigned where no verified repair is needed.

Evidence reused and limits

The published exact-head ARM64 validation records a passing full build, 10,550 tests passed, 36 skipped, 0 failed, and actual-Companion verification-error/redaction/retry output. These executions were reused, not rerun for this source review. The refreshed PR check rollup has 11 successes and 17 skips, with no failed or pending checks.

The HTTP 503 was an intentional negative-test response. Passing proof means the cause was visible, credentials were redacted, and the current retry error replaced stale detail. It does not mean model inference worked. The visible run covered the detected-provider route, not every Rejected/VerifyConfiguredAsync branch. It does not establish native managed-model/GPU behavior, resolve #1713, or validate a merge with newer main.

ClawSweeper's completed re-review also reports no findings, no before-merge work, and sufficient live-output proof. Its broader-issue scope caveat is separate from this diagnostic patch's correctness.

No product files were changed, no workflows rerun, and no merge was performed as part of this review.

@karkarl
karkarl merged commit 7357834 into openclaw:main Oct 15, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants