Skip to content

fix(setup): Local AI load failures show no llama-server cause during onboarding - #1759

Merged
shanselman merged 2 commits into
openclaw:mainfrom
larroy:am/bolt-followup
Oct 23, 2026
Merged

shanselman merged 2 commits into
openclaw:mainfrom
larroy:am/bolt-followup

Conversation

@larroy

@larroy larroy commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes: when a Local AI model fails to load in llama.cpp during "Connect your AI" onboarding, the page only says "The provider could not activate this model. Refresh to choose again." and gives no cause or way to find the llama-server logs.

User Impact

User impact: a failed Local AI verification or start now shows the relevant llama-server error lines under the error bar, plus an "Open Local AI logs" link that opens %LOCALAPPDATA%\OpenClawTray\LocalAI\logs in Explorer.

Why This Change Was Made

llama-server writes the load-failure cause only to its own stdout/stderr logs; the Gateway's verification error doesn't carry it. AiSetupPage now reuses the existing setup-engine path (LocalAiLogTail.ReadDiagnosticLinesAsync + LogFileLauncher, as CompletePage.ShowServerDiagnostics does):

  • Shown only for managed Local AI: verification failure / rejection after an explicit Local AI Use or InstallAndUse on this page, and LocalAiStartFailedException. Cloud and configured-model failures are unchanged.
  • Up to 4 sanitized lines matching the existing diagnostic filter (CUDA errors, "failed to load", "out of memory", "error loading model", ...), prefixed llama-server:.
  • LocalAiLogTail.ExtractDiagnosticLines now puts cause lines first (CUDA error, allocation failure, model-load error). Consequence lines ("failed to load" echoes, instance exit status) fill the remaining slots, newest first. Lines that differ only by the router's [pid] instance prefix collapse to their newest occurrence. Before this, with the real Bolt logs, the last-4 window showed only draft-load and router lines: stdout is read before stderr, so the router's stderr lines always sort last, and every retry looked distinct. The cause (tensor 'lilicorr.feature_mlp.0.weight' not found) never appeared. The same helper feeds VerifyLocalAiInferenceStep's failure detail and its setup-log echo, so those now lead with the cause too.
  • The panel clears when a new request starts or another error replaces it, so stale diagnostics don't linger.
  • The two duplicated "Local AI could not start" blocks now go through one helper, ShowLocalAiStartFailure.
  • New string Onboarding_AiSetup_OpenLocalAiLogs in all six locales.

Known limits: if the real failure line doesn't match the existing filter, only the link is shown. Like CompletePage, the log tail can include lines from an earlier failed load in the same rotating log. Lines are still capped at 200 characters, so long model paths are cut before the file name.

Evidence

New regression tests:

  • OnboardingAiPageTests (synthetic llama-server.stderr.log): LocalAi_VerificationFailureShowsLlamaServerDiagnosticsAndLogsLink, LocalAi_StartFailureShowsLlamaServerDiagnosticsAndLogsLink, ConfiguredModelVerificationFailure_DoesNotShowLocalAiDiagnostics.
  • LocalAiLogTailTests.ExtractDiagnosticLines_KeepsCauseAheadOfLaterConsequencesAndCollapsesRetries, using a fixture abridged from the real Bolt logs.

Change Type

  • Bug fix
  • Feature
  • Refactor
  • Docs or instructions
  • Tests or validation
  • Security hardening
  • Chore or infrastructure

Scope

  • Tray or WinUI UX
  • Windows node capability
  • Local MCP or winnode
  • Gateway, connection, or pairing
  • Setup or onboarding
  • Permissions, privacy, or security
  • Tests, CI, or docs

Required proof pools

  • windows-winui-interactive: new onboarding error panel and Explorer link need current-head visual proof.
  • windows-11-arm64: the motivating failure is Nemotron Bolt, which runs only on the ARM64 runtime.

Validation

Head 96d89c56 (rebased onto main 18f33cee), Windows 11 ARM64:

  • ./build.ps1: all builds succeeded.
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj: Passed 4431, Failed 0, Skipped 34.
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj: Passed 4239, Failed 0.
  • dotnet test ./tests/OpenClaw.SetupEngine.Tests/OpenClaw.SetupEngine.Tests.csproj: Passed 2381, Failed 0, Skipped 1.
  • dotnet test .\tests\OpenClaw.Tray.UITests\OpenClaw.Tray.UITests.csproj -r win-arm64 --filter "FullyQualifiedName~OnboardingAiPageTests&Category!=NativeOnboardingProof": Passed 80, Failed 0. NativeOnboardingProof was excluded because this host has no reviewed source/build freeze.

Base-fail / head-pass for the new tests:

Test Base Head
3 new OnboardingAiPageTests (head test file against d73bde25 src/) 3 failed: LocalAiFailurePanel not found (structural for the negative test) 3 passed at 99ae0cc3, b26f4f38, and 96d89c56
ExtractDiagnosticLines_KeepsCauseAheadOfLaterConsequencesAndCollapsesRetries (against 99ae0cc3 LocalAiLogTail.cs) Failed: first line was common_speculative_init_result: failed to load draft model, cause missing Passed

One existing source-text assertion in LocalAiOnboardingOwnershipTests now checks for the ShowLocalAiStartFailure helper instead of the old inline ErrorBar literal.

Real Behavior Proof

  • Environment tested: Windows 11 ARM64 (10.0.28000). Shipped dev app (run-app-local.ps1 -DataDir <temp> -UseStoreGateway) with fresh OPENCLAW_TRAY_DATA_DIR, OPENCLAW_TRAY_APPDATA_DIR, and OPENCLAW_TRAY_LOCALAPPDATA_DIR roots, and OPENCLAW_FORCE_ONBOARDING=1. Real installed Store Gateway OpenClawFoundation.OpenClawGateway 2026.10.400.0 (ARM64). The real profile and real Local AI state were not used.
  • PR head or commit tested: 99ae0cc3 (before the cause fix) and 99ae0cc3 + b26f4f38 (after). b26f4f38 is the same patch as head commit 96d89c56, before the rebase onto 18f33cee. Both runs had one local, uncommitted proof-only change: LlamaRuntimeCatalog.NemotronBolt.cs restored from c2ce4f5~1, i.e. the pre-fix(inference): Nemotron Bolt downloads fail with 401 from prerelease repos #1751 b3e4f6c Bolt runtime with today's public model pins. That is the combination behind the original Nemotron Bolt failure. A full revert of c2ce4f5 stops earlier, with an HF 401 at model acquisition.
  • Exact steps: Welcome, then Continue. Native Gateway, Next, Set up gateway. Connect your AI, Local AI on this PC, Nemotron 3.5 Bolt 74B-A9B, Install and use Local AI. Target and draft weights were verified from the shared HF cache, not downloaded. Only the b3e4f6c runtime was downloaded. The app was driven through UI Automation and the app window captured with PrintWindow.
  • Observed result: llama-server failed to load the LiLiCorr draft model. The panel appeared under the error bar with the "Open Local AI logs" link. Invoking the link opened Explorer at <isolated LOCALAPPDATA>\OpenClawTray\LocalAI\logs, checked through Shell window enumeration.

Before the cause fix (99ae0cc3): the cause line is missing.

Before cause fix

After the cause fix (b26f4f38): the first line is llama_model_load: error loading model: check_tensor_dims: tensor 'lilicorr.feature_mlp.0.weight' not found. This run re-entered through Recover and Refresh, so the error bar shows the Gateway's follow-up error ("Nothing is listening at ..."). The panel reads the same instance [64191] failure from the log.

After cause fix

  • Screenshot or artifact links verified? Yes. Both URLs return HTTP 200.
  • Not verified or blocked: NativeOnboardingProof compositor captures (no reviewed source/build freeze on this host). The rebased head 96d89c56 was not re-run in the app; it was covered by the build and test suites above. No head was run without the proof-only runtime revert, because with the b11700 runtime this failure does not occur.

Security Impact

  • New permissions or capabilities? No
  • Secrets or tokens handling changed? No
  • New or changed network calls? No
  • Command or tool execution surface changed? No
  • Data access scope changed? Yes
  • If any answer is Yes, explain the risk and mitigation: the page now reads the app's own llama-server logs. Reads are bounded to the last 256 KB per log, at most 4 lines of 200 chars, and lines go through the existing token sanitizer. Request/response log lines are excluded, so no prompts are shown.

Compatibility and Migration

  • Backward compatible? Yes
  • Config or environment changes? No
  • Migration needed? No
  • If yes, list the exact upgrade steps:

Review Conversations

  • I replied to or resolved every bot review conversation addressed by this PR.
  • I left unresolved only conversations that still need maintainer judgment.

@clawsweeper

clawsweeper Bot commented Oct 17, 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.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 17, 2026
@clawsweeper

clawsweeper Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codex review: needs maintainer review before merge.

What this changes

Show bounded llama-server failure diagnostics and a logs-folder link when managed Local AI fails during onboarding.

Example: Nemotron Bolt fails because tensor 'lilicorr.feature_mlp.0.weight' is missing.

  • Before: Onboarding reports provider rejection, while repeated router messages crowd the cause out of the diagnostic tail.
  • After: The failure panel includes the missing-tensor error and an Open Local AI logs link.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, focused and supported by visible production-path evidence plus reported baseline-failing regressions; no blocking findings remain.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): Inspected Windows 11 ARM64 shipped-app screenshots show the managed Bolt failure panel and retained tensor cause; the contributor reports Explorer opening the isolated logs directory. Photographed page and extractor blobs match this head, satisfying the prior evidence request. The run used an older runtime to trigger failure and predates the rebase; native compositor-freeze proof was not claimed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Managed Local AI can fail during onboarding without showing the llama-server load cause or a way to open its logs.
Reason: This maintainer-authored change extends an established diagnostic contract without changing model selection, runtime recipes, permissions or persisted settings.

Merge readiness

✅ Ready for maintainer review

Keep open for landing: this maintainer-authored PR addresses a diagnostic gap still present on main, with no actionable correctness or security findings.

Priority: P2
Reviewed head: 96d89c56d3ff2653c1ef04e6fc7a3942099de351

Before merge

None.

Findings

None.

Agent review details

How this fits together

AiSetupPage handles provider selection and verification; managed Local AI failures now read the existing sanitized log-tail owner and render diagnostic text plus an app-controlled Explorer link.

flowchart TD
  A[Managed Local AI selection] --> B[AiSetupPage verification]
  B --> C[Startup or verification failure]
  C --> D[LocalAiLogTail]
  E[Managed llama-server logs] --> D
  D --> F[Bounded diagnostic panel]
  F --> G[Open logs in Explorer]
Loading

Technical review

Best possible solution:

Land the focused diagnostic change while preserving existing runtime, verification, privacy and recovery owners.

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

Pinned main lacks the onboarding log panel, and its last-four extraction can discard the supplied repeated-load fixture's tensor cause; contributor screenshots demonstrate that failure using a deliberately restored older runtime.

Is this the best way to solve the issue?

The change reuses the established log reader and Explorer launcher, fixes prioritization in the shared extractor, and limits display to explicitly managed Local AI failures.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 18f33cee71aa.

Provenance checked

  • Shared Local AI diagnostic selection changes intended behavior with a stated reason (91837de: Bounded sanitized failure markers expose runtime causes while excluding request and response payloads.)
  • Focused onboarding error presentation keeps the original intent (feat: guide Windows onboarding from setup to native AI tasks #1531: The focused page owns provider verification and visible recovery; later native Local AI continuation retained startup errors and repair choices.)
  • Gateway-returned verification details keeps the original intent (7357834: Keep bounded sanitized verification causes visible when rejection settles instead of replacing them with generic text.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Pedro Larroy: Raw commit 91837de adds src/OpenClaw.SetupEngine/LocalAiLogTail.cs:58 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 91837de0cc18; files: src/OpenClaw.SetupEngine/LocalAiLogTail.cs)
  • Karen: Raw commit 7dcbc2f adds src/OpenClaw.SetupEngine.UI/Pages/AiSetupPage.xaml.cs:339 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)
  • Joel: Raw commit 7357834 adds src/OpenClaw.SetupEngine.UI/Pages/AiSetupPage.xaml.cs:1221 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 735783459efa; files: src/OpenClaw.SetupEngine.UI/Pages/AiSetupPage.xaml.cs)

Review metrics

Metric Value Why it matters
Production and test delta Production +103/-20; tests +112/-2 The growth supplies one failure panel, shared diagnostic prioritization, six localized labels and distinct extraction, rendering and managed-selection coverage.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: A limited Local AI failure path loses useful diagnostic context; existing repair and alternative-provider choices remain available.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

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 (2 earlier review cycles)
  • reviewed 2026-10-17T00:14:07.284Z sha e1d7961 :: blocked before merge. :: [P1] [P1] Preserve installed Bolt receipts before replacing their artifact pins
  • reviewed 2026-10-19T20:57:41.623Z sha 99ae0cc :: needs maintainer review before merge. :: none

Reviewed October 20, 2026, 12:34 AM ET / 04:34 UTC (Revision 3).

@joelagnel

Copy link
Copy Markdown
Collaborator

@clawsweeper rereview

@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 19, 2026
…onboarding

Show the salient llama-server log lines and an Open Local AI logs link under the AI setup error bar when a managed Local AI model fails verification or start.
With real Nemotron Bolt logs the 4-line panel showed only draft-load and router exit lines: stdout is read before stderr, so the router's stderr consequences always sort last, and each retry's [pid] prefix made the same failure distinct. Cause lines (CUDA error, allocation, model-load errors) now take precedence, consequences fill the remaining slots newest first, and lines differing only by the [pid] prefix collapse to their newest occurrence.
@larroy

larroy commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the clawsweeper:intake:bug Preliminary submission classification; full source review pending. label Oct 20, 2026
@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Oct 20, 2026
@shanselman shanselman added the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Oct 23, 2026
@shanselman
shanselman merged commit f640624 into openclaw:main Oct 23, 2026
30 checks passed
@shanselman shanselman removed the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Oct 23, 2026
shanselman pushed a commit that referenced this pull request Oct 23, 2026
…y actions (#1787)

When the native Gateway fails to start during onboarding, including a start timeout, the setup page now shows the failure details and recovery actions: view the setup log or collect diagnostics, with clear guidance text. The setup logger keeps sanitized entries if its file sink fails, a retry keeps the original expiry, and the nine new strings are translated in every locale.

Maintainer validation: an integrated candidate of main ae56aa5 plus this head built cleanly and passed the Tray, Connection and SetupEngine suites. Shared passed except one GPU hardware probe test, which also fails on exact main on this host. One shared autoreview pass was scoped-clean, and the merge onto main after #1759 was conflict-free with resw key parity checked. ARM64 and visible proof remain the author's screenshots.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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