Skip to content

Require verified Local AI model evidence - #1222

Closed
karkarl wants to merge 1 commit into
mainfrom
fix/local-ai-verified-model-evidence
Closed

karkarl wants to merge 1 commit into
mainfrom
fix/local-ai-verified-model-evidence

Conversation

@karkarl

@karkarl karkarl commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Fixes #1192

Summary

  • Require the managed llama-server probe to report healthy only when /health succeeds and /models verifies the configured managed model.
  • Treat /models timeout, invalid data, missing alias, unknown state, and wrong path as not ready.
  • Use the same readiness predicate before startup publication and during refresh.

Validation

  • PASS: dotnet test .\tests\OpenClaw.Connection.Tests\OpenClaw.Connection.Tests.csproj --no-restore --filter "FullyQualifiedName~LlamaServerClientTests|FullyQualifiedName~Startup_DoesNotPublishWhenModelEvidenceIsNotVerified" (8 passed)
  • PASS: dotnet test .\tests\OpenClaw.Connection.Tests\OpenClaw.Connection.Tests.csproj --no-restore --filter "FullyQualifiedName!~ManagedLocalGatewayPortProvenanceServiceTests.VerifyMicrosoftSignedFile_AcceptsWindowsWslBinary" (687 passed)
  • PASS: dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore (3812 passed, 32 skipped)
  • PASS: git diff --check
  • BLOCKED: .\build.ps1 builds Shared, Cli, WinNodeCli, and SetupEngine, then fails WinUI restore because Microsoft.WindowsAppSDK and WinUIEx cannot be resolved locally while nuget.org is disabled.
  • BLOCKED: dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore cannot run because restore assets for the Tray test project are missing and local package restore cannot load nuget.org.
  • BLOCKED: full dotnet test .\tests\OpenClaw.Connection.Tests\OpenClaw.Connection.Tests.csproj --no-restore has one environment failure: VerifyMicrosoftSignedFile_AcceptsWindowsWslBinary reports local wsl.exe as unsigned. The full suite otherwise passes when that environment-specific test is excluded.
  • PASS: .\scripts\setup-dev.ps1 -CheckOnly

Real behavior proof

  • Focused client tests prove /models timeout, invalid response, missing alias, unknown model state, and wrong model path all return not healthy.
  • Focused client tests prove verified and loaded managed-model evidence returns healthy.
  • Runtime test proves a probe with process health but unverified model evidence does not save the endpoint or publish the provider.

@clawsweeper

clawsweeper Bot commented Aug 25, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

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

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. 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. labels Aug 25, 2026
@clawsweeper

clawsweeper Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 11:24 AM ET / 15:24 UTC.

ClawSweeper review

What this changes

The PR requires a managed llama-server to pass both health and configured-model verification before Local AI saves and publishes its provider endpoint.

Regression provenance

Possible regression — probable (reviewed change; known regression link). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep this collaborator-authored draft open. The patch appears to correctly fix the reported Local AI publication flaw, but required CI is still running and the PR is not ready for closure or merge.

Priority: P2
Reviewed head: fff65f09ec61aacdc097256c6feac1455972cfd9

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is narrow, source-backed, and covered by focused client and runtime tests; required CI is still running.
Proof confidence 🌊 off-meta tidepool Not applicable: The collaborator-authored PR documents focused validation; the external-contributor real-behavior-proof gate does not apply.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The collaborator-authored PR documents focused validation; the external-contributor real-behavior-proof gate does not apply.
Evidence reviewed 5 items Prior publication flaw: Current main used successful process health alone to save and publish the Local AI endpoint during startup and refresh.
Unified readiness predicate: The PR makes timeout, invalid model data, missing aliases, and unknown states unhealthy, and startup plus refresh now require IsReady before publishing Healthy.
Focused regression coverage: Added client cases cover invalid and absent evidence plus verified and loaded success; the runtime test confirms unverified evidence does not persist or publish an endpoint.
Findings None None.
Security None None.

Live Verification

Command: dotnet test ./tests/OpenClaw.Connection.Tests/OpenClaw.Connection.Tests.csproj --no-restore --filter "FullyQualifiedName~LlamaServerClientTests|FullyQualifiedName~Startup_DoesNotPublishWhenModelEvidenceIsNotVerified"

Result: FAIL (failed) — execution before step 1 run: sh -lc pnpm install --ignore-scripts --frozen-lockfile failed: ! Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-11.24.0.tgz

sh -lc pnpm install --ignore-scripts --frozen-lockfile failed: ! Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-11.24.0.tgz

Assertions:

  • FAIL expect_output: Passed

How this fits together

Local AI starts a managed llama-server, probes its loopback health and model metadata, then persists and publishes the endpoint for gateway provider routing. Startup and refresh both consume the same probe result.

flowchart LR
A[Managed llama-server] --> B[Health endpoint]
A --> C[Model listing endpoint]
B --> D[Readiness decision]
C --> D
D --> E[Startup and refresh]
E --> F[Published Local AI provider]
Loading

Before merge

  • Resolve merge risk (P1) - Required CI remains in progress, and the PR body records that the repository-required build and tray-test closeout could not run locally because Windows dependencies were unavailable.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production and test delta production +15/-7, tests +184/-1 across 4 files The modest production predicate change is accompanied by focused coverage for client evidence and startup publication.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #1192
Summary: This PR is the explicit candidate fix for the reported Local AI publication flaw.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the shared readiness predicate after the running checks confirm the focused Local AI tests and repository closeout remain green.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land the shared readiness predicate after the running checks confirm the focused Local AI tests and repository closeout remain green.

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

Yes. Current main's health-only probe result can be traced directly through startup and refresh to endpoint publication even when model evidence is unknown or absent.

Is this the best way to solve the issue?

Yes. A single readiness predicate, consumed by both startup and refresh, is the narrowest maintainable repair and preserves the existing parser's expected-path validation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against ccd64bbb7d68.

Labels

Label changes:

  • add P2: This is a bounded provider-readiness repair that prevents Local AI from being advertised when its configured model is not verified.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The collaborator-authored PR documents focused validation; the external-contributor real-behavior-proof gate does not apply.

Label justifications:

  • P2: This is a bounded provider-readiness repair that prevents Local AI from being advertised when its configured model is not verified.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The collaborator-authored PR documents focused validation; the external-contributor real-behavior-proof gate does not apply.

Evidence

What I checked:

Likely related people:

  • joelagnel: The current-main feature commit introducing the probe and runtime publication path is authored by Joel, and the linked report is also authored by joelagnel. (role: introduced managed Local AI runtime; confidence: high; commits: ccd64bbb7d68; files: src/OpenClaw.Connection/LocalAi/LlamaServerClient.cs, src/OpenClaw.Connection/LocalAi/LlamaServerRuntimeService.cs)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Wait for the running required checks to complete before merge.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@shanselman

Copy link
Copy Markdown
Collaborator

Closing as superseded by #1212, which covers verified-model publication and also handles unsafe route withdrawal and endpoint rebinding.

@shanselman shanselman closed this Aug 28, 2026
@shanselman
shanselman deleted the fix/local-ai-verified-model-evidence branch September 7, 2026 06:30
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. 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.

Require verified managed-model evidence before publishing Local AI

2 participants