Skip to content

fix(doctor): recognize models published by the selected Gateway - #179907

Merged
steipete merged 2 commits into
mainfrom
upd/upd-l1786
Oct 21, 2026
Merged

steipete merged 2 commits into
mainfrom
upd/upd-l1786

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Doctor reports active runtime-discovered models as missing from its local catalog even when the selected Gateway publishes them. Fixes #157010. Supersedes #170694, thanks @xilopaint; also preserves credit for @Olli0103's original approach.

User Impact

Published model IDs no longer receive the misleading offline-catalog advisory. Typos, unavailable-Gateway checks, legacy-reference migrations, and genuine server-catalog warnings remain. This is a read-only diagnostic change: no configuration, persisted data, provider discovery, or update admission changes.

Why This Change Was Made

Doctor already reads the selected Gateway's prepared catalog for server diagnostics. Reuse that single read for membership instead of introducing another model status or expanding the offline inspector. Remove the warning-only reader and let Doctor and models status share the prepared reader and warning projection.

Production: +22 / -22 (net 0). Tests: +38 / -0. Documentation: +6. The existing status file does not grow.

Evidence

  • Regression on base 548a331adb18: the published-model case fails; the other-provider and offline controls pass. The fixed case also keeps a typo advisory and asserts a single catalog read. Existing tests retain server-warning and exec-SecretRef coverage.
  • Real CLI proof on the committed revision used an isolated HOME, OPENCLAW_STATE_DIR, and OPENCLAW_CONFIG_PATH, a free Gateway port, and a synthetic local Ollama HTTP server. models list --all --provider ollama --json publishes ollama/runtime-only:latest as available. Before the fix, Doctor reports both that model's false info finding and the real missing-server-model warning. After the fix, only the real warning remains. A typo still produces its info finding; with the Gateway stopped, the original model still receives the offline advisory. The two task-owned servers were stopped afterward.
  • Production, flow-test, and command-test TypeScript checks; targeted oxlint and oxfmt; the pre-commit line-cap gate; git diff --check; and Madge (0 cycles) passed. Independent Codex P0–P2 review found no actionable defects.
  • Node: 543 tests across 28 direct/one-hop caller files passed in 156.36s. Bun: 47 tests across four focused files passed in 38.54s. The slowest individual test was 4.457s. The changed Doctor file used 24.43s wall time on Bun, dominated by transform (91%); tests used 3%.
  • Full check:changed SQLite inventory was omitted because of its known long-running inventory step; PR CI supplies broad proof. This does not claim authenticated Google inference or an installed-package upgrade.

Focused Bun command (the Node caller run used the same runner with all 28 files found by rg over the changed production basenames and their immediate callers):

OPENCLAW_VITEST_RUNTIME=bun node scripts/run-vitest.mjs \
  src/flows/doctor-model-reference-check.test.ts \
  src/commands/models/list.status.test.ts \
  src/commands/models/list.prepared-catalog.test.ts \
  src/commands/models/list.refresh-completion.test.ts --maxWorkers=1

Exact live commands, with the isolated environment above:

pnpm dev gateway run --allow-unconfigured
pnpm dev models list --all --provider ollama --json
pnpm dev doctor --lint --only core/doctor/model-references --severity-min info --json

The initial lint pass caught a local shadowed variable, and the initial commit hook caught one line of growth in the grandfathered status file; both were corrected. A broad run was invalidated by the final reader rename and was rerun with frozen sources. The development wrapper also correctly refused artifact publication while the isolated Gateway was running; subsequent live proof used the clean committed build.

Reuse Doctor's prepared catalog read to confirm runtime-discovered model
references while retaining offline, migration, and server diagnostics.
Remove the warning-only reader and migrate its status caller.

Fixes #157010. Supersedes #170694.

Co-authored-by: Arthur Pinheiro <[email protected]>
Co-authored-by: Olli0103 <[email protected]>
@clawsweeper

clawsweeper Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime commands Command implementations size: S labels Oct 21, 2026
@steipete
steipete marked this pull request as ready for review October 21, 2026 21:09
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T21:46:02.424157Z 7d291cc New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added the clawsweeper:intake:bug Preliminary submission classification; full source review pending. label Oct 21, 2026
@clawsweeper

clawsweeper Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Doctor uses the selected Gateway’s prepared catalog to avoid reporting published models as missing from offline metadata.

Example: An active google/gemini-flash-lite-latest reference appears in the selected Gateway’s published catalog.

  • Before: Doctor reports that the model is absent from its local catalog.
  • After: Doctor suppresses that advisory while retaining findings for typos, legacy references, and server-reported missing models.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, correct repair supported by reported shipped-CLI behavior and distinct regression controls; the CI failure is independently observed outside this patch.
Proof confidence 🐚 platinum hermit (4/6) This maintainer-authored PR is outside the ordinary contributor-proof gate; its body nevertheless records committed-revision CLI verification through an isolated Gateway and synthetic Ollama server, including published-model, typo, server-warning, and offline results.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Doctor advises users to investigate a missing model even when their selected Gateway already publishes that exact reference.
Reason: The maintainer-authored direction resolves a reported contradiction without adding settings, changing model selection, or weakening genuine diagnostics.

Merge readiness

✅ Ready for maintainer review

Keep this PR: it fixes a confirmed diagnostic mismatch still present on main, and no actionable patch defect was found; the failing CI assertion also fails independently on another PR.

Priority: P2
Reviewed head: 71f04f32ce5fd6945f513d30c22be963db9d389f

Before merge

None.

Findings

None.

Agent review details

How this fits together

Doctor combines configured model references, offline provider metadata, and the selected Gateway’s prepared inventory into diagnostic findings without discovering providers or changing configuration.

flowchart TD
  A[Configured model references] --> B[Offline reference inspector]
  C[Selected Gateway prepared catalog] --> D[Shared catalog reader]
  B --> E[Doctor model reference check]
  D --> E
  D --> F[Models status warnings]
  E --> G[Diagnostic findings]
Loading

Technical review

Best possible solution:

Use the existing prepared-catalog owner to reconcile Doctor’s offline advisory while preserving typo, migration, server-warning, and offline behavior.

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

The canonical report supplies paired release outputs, and current-main source shows why an active runtime-only model receives the advisory despite appearing in the selected Gateway’s inventory; this review executed no target code.

Is this the best way to solve the issue?

This is the smallest complete repair: expose the already-read catalog to Doctor, retain the existing warning projection for both consumers, and leave the offline inspector unchanged.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 975047836d1b.

Provenance checked

  • Prepared catalog reader and server warnings keeps the original intent (1bee6ae: Reuse successful server-catalog evidence for read-only diagnostics while keeping declarations selectable and preserving offline behavior.)
  • Doctor finding classification and migration hints changes intended behavior with a stated reason (77cecb5: Consolidate Doctor diagnostic handling while retaining unknown-provider warnings, active-model advisories, and legacy-reference migrations.)
  • Native Doctor check owner keeps the original intent (d0d1718: Remove private service plumbing and use existing native owners without changing diagnostic algorithms.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 1bee6ae adds src/commands/models/catalog-warnings.ts:12 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 1bee6aebfe9e; files: src/commands/models/catalog-warnings.ts)
  • Dallin Romney: Raw commit b898c26 adds src/commands/models/list.status-command.ts:1048 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: b898c261539d; files: src/commands/models/list.status-command.ts)

PR surface

Source 0, Tests +38, Docs +6. Total +44 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 22 22 0
Tests 1 38 0 +38
Docs 1 6 0 +6
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 66 22 +44

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #157010
Summary: The report and fixing candidates concern the same offline-versus-published catalog mismatch.

Members:

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

Labels

Label changes:

  • add P2: The demonstrated impact is misleading diagnostic advice and a false lint finding, without an inference failure or blocked setup.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: The demonstrated impact is misleading diagnostic advice and a false lint finding, without an inference failure or blocked setup.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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.

Reviewed October 21, 2026, 5:26 PM ET / 21:26 UTC.

@steipete
steipete merged commit 4a5d689 into main Oct 21, 2026
114 checks passed
@steipete
steipete deleted the upd/upd-l1786 branch October 21, 2026 21:55
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 22, 2026
…atalog (openclaw#179907)

Doctor used the prepared Gateway catalog for warnings but not for model membership, so it flagged models the running Gateway publishes. It now reuses that read; typo, offline, migration and server warnings are preserved. Supersedes openclaw#170694, thanks @xilopaint.

Co-authored-by: Arthur Pinheiro <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:intake:bug Preliminary submission classification; full source review pending. commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Doctor reports Google latest alias missing despite its presence in the published Gateway catalog

1 participant