Skip to content

fix: avoid false sign-in prompts during native model discovery - #153796

Merged
obviyus merged 12 commits into
mainfrom
fix/native-catalog-auth-readiness
Sep 20, 2026
Merged

obviyus merged 12 commits into
mainfrom
fix/native-catalog-auth-readiness

Conversation

@obviyus

@obviyus obviyus commented Sep 20, 2026 •

Copy link
Copy Markdown
Collaborator

Builds on #153707.

What Problem This Solves

Fixes incorrect sign-in and custom-provider setup hints while an installed agent's native catalog is still loading.

User Impact

Native models show checking or unconfirmed availability until their own runtime reports usable models. Unknown choices stay disabled in setup; explicitly selected accounts and API routes keep their existing authentication behavior.

Why This Change Was Made

Native-owned readiness stays authoritative even when availability is unknown. Observations must match both model and runtime, and existing readiness hooks still decide readiness when provided. Channel notices and the setup page consume those facts rather than inventing a host API sign-in requirement.

Catalog acquisition/projection is separated from command parsing, preserving the published SDK entry points. There are no schema, model-ID, credential-migration, or dependency changes.

Evidence

  • Real Telegram Test Server with installed OpenCode 1.18.31, an isolated credential-free home and controlled 12-second startup latency: the same native model moved from 0 of 1 available / Checking native agent to 1 available after discovery. No model prompts or provider inference requests; lease, Gateway and native processes cleaned up.

  • Full Control UI browser flow with deterministic Gateway replay: pending and unconfirmed rows remain disabled; a confirmed native model sends the exact agents.update selection without a setup/inference request.

  • 60 command/catalog cases and 25 native catalog-view cases passed. Core/UI type checks, targeted lint, localization verification and runtime build passed.

  • Catalog extraction preserves function/type contracts and all existing SDK export names. The inherited route-helper relocation is byte-identical.

  • The registered Gateway/Codex account-catalog test passes across account readiness transitions, explicit host overrides, disconnection, and registry replacement. Removed an obsolete helper-only assertion that treated a missing primary-row metadata tag as host ownership even when a matching native route variant and configured native runtime remained. No production behavior changed in that correction.

Before: discovery was mistaken for missing sign-in

Native setup incorrectly asks for sign-in while discovery is pending

After: pending discovery stays explicit

Native setup shows checking rather than an invented sign-in requirement

Unconfirmed availability remains unselectable

Native setup keeps an unconfirmed model disabled

@clawsweeper

clawsweeper Bot commented Sep 20, 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 app: web-ui App: web-ui agents Agent runtime and tooling extensions: anthropic size: XL maintainer Maintainer-authored PR labels Sep 20, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 20, 2026
@clawsweeper

clawsweeper Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 20, 2026, 12:47 PM ET / 16:47 UTC (Revision 4).

ClawSweeper review

What this changes

The PR distinguishes pending native model discovery from missing sign-in in model menus and setup, and extracts catalog preparation while preserving public SDK exports.

Merge readiness

✅ Ready for maintainer review

Still useful: current main retains the false-auth fallback, and the merged prerequisite does not resolve it. No blocking defects found; the latest test cleanup preserves meaningful Gateway coverage and the supplied proof supports the fix.

Priority: P2
Reviewed head: 66787c269956e3b641948d4e79314333808ec151

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with useful visual and live-flow evidence, preserved SDK contracts, and no blocking findings.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): The reported real Telegram/OpenCode discovery transition exercises the changed catalog-to-menu path; inspected Control UI screenshots show checking and unconfirmed rows replacing false sign-in guidance. Browser replay covers confirmed selection, while the Codex Gateway test remains supplemental boundary coverage.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): The reported real Telegram/OpenCode discovery transition exercises the changed catalog-to-menu path; inspected Control UI screenshots show checking and unconfirmed rows replacing false sign-in guidance. Browser replay covers confirmed selection, while the Codex Gateway test remains supplemental boundary coverage.
Evidence reviewed 10 items Current main still needs the correction: Pinned main checks only the primary row’s native-runtime tag and otherwise returns host authentication results; it lacks the matching-variant and unknown-readiness handling introduced here.
Latest release retains the previous behavior: GitHub contents for v2026.9.5 show the primary-row-only guard at line 304 and boolean readiness publication at line 339. The local release-blob read failed, so the release source was checked through GitHub instead.
Native readiness and explicit overrides: The complete owner module preserves explicit profiles, authored endpoints, credentials, request overrides, readiness hooks, and owner-current checks. Native observations are matched by logical model identity and runtime; an unobserved harness-owned catalog yields unknown availability.
Findings None None.
Security None None.

How this fits together

Native model discovery feeds the Gateway’s shared model catalog. Readiness decisions from that catalog determine availability messages in channel menus and selectable choices in Control UI setup.

flowchart TD
  A[Installed native agents] --> B[Prepared model catalog]
  C[Explicit account and API settings] --> D[Readiness decision]
  B --> D
  D --> E[Channel model menus]
  D --> F[Control UI setup]
  F --> G[Confirmed model selection]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +37, Tests +16, Docs +5, Other -1. Total +57 across 15 files.

View PR surface stats
Area Files Added Removed Net
Source 9 583 546 +37
Tests 4 46 30 +16
Docs 1 5 0 +5
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 1 -1
Total 15 634 577 +57

Review metrics

Metric Value Why it matters
Net growth after extraction Production +37 lines; tests +16 lines Most apparent churn relocates catalog preparation; remaining growth supports readiness handling and focused regression coverage.

Technical review

Best possible solution:

Keep native readiness with the existing catalog owner and let setup and channel menus faithfully display unknown, unavailable, and confirmed states.

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

Yes, from source: a configured native model without a primary-row observation falls back to host-auth guidance while discovery is pending. Supplied before/after evidence corroborates this; the reviewer did not execute a reproduction.

Is this the best way to solve the issue?

Yes. The patch repairs the shared readiness decision and reuses it in presentation while preserving explicit host authentication and disabled unknown choices.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 0b6152183e49.

Labels

Label justifications:

  • P2: Corrects misleading authentication guidance during bounded native-model discovery without changing credential or configuration contracts.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The reported real Telegram/OpenCode discovery transition exercises the changed catalog-to-menu path; inspected Control UI screenshots show checking and unconfirmed rows replacing false sign-in guidance. Browser replay covers confirmed selection, while the Codex Gateway test remains supplemental boundary coverage.
  • proof: sufficient: Contributor real behavior proof is sufficient. The reported real Telegram/OpenCode discovery transition exercises the changed catalog-to-menu path; inspected Control UI screenshots show checking and unconfirmed rows replacing false sign-in guidance. Browser replay covers confirmed selection, while the Codex Gateway test remains supplemental boundary coverage.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The reported real Telegram/OpenCode discovery transition exercises the changed catalog-to-menu path; inspected Control UI screenshots show checking and unconfirmed rows replacing false sign-in guidance. Browser replay covers confirmed selection, while the Codex Gateway test remains supplemental boundary coverage.
  • proof: telegram-e2e: This PR needs Telegram Test Server proof with the repository E2E skill. The PR changes visible Telegram model-menu labels and availability notices; the body supplies a relevant Test Server run.

Evidence

What I checked:

  • Current main still needs the correction: Pinned main checks only the primary row’s native-runtime tag and otherwise returns host authentication results; it lacks the matching-variant and unknown-readiness handling introduced here. (src/agents/model-catalog-view.ts:319, 0b6152183e49)
  • Latest release retains the previous behavior: GitHub contents for v2026.9.5 show the primary-row-only guard at line 304 and boolean readiness publication at line 339. The local release-blob read failed, so the release source was checked through GitHub instead. (src/agents/model-catalog-view.ts:304, ec9c1a13db89)
  • Native readiness and explicit overrides: The complete owner module preserves explicit profiles, authored endpoints, credentials, request overrides, readiness hooks, and owner-current checks. Native observations are matched by logical model identity and runtime; an unobserved harness-owned catalog yields unknown availability. (src/agents/model-catalog-view.ts:272, 66787c269956)
  • Latest revision and retained boundary coverage: The delta from the previous reviewed head removes only 26 lines from the Codex catalog test. The retained registered Gateway scenario covers account transitions, explicit host overrides, disconnect, and registry replacement. The removed host-row assertion ignored a matching native route variant. (test/plugins/codex-model-catalog.gateway.test.ts:365, 66787c269956)
  • SDK compatibility and extraction: The public builder, runtime-choice helper, reply helpers, and exported types retain their names and signatures. Inspection of the moved functions found readiness metadata propagation and pending-provider presentation alongside the extraction, without a parallel catalog owner. (src/plugin-sdk/models-provider-runtime.ts:4, 66787c269956)
  • Inspected visual proof and reported live behavior: Inspected prepared images 1–3: before shows an invented sign-in instruction, after shows checking, and the unconfirmed row stays disabled. The captured body reports a real Telegram Test Server run with OpenCode 1.18.31 and controlled discovery latency, progressing from zero-of-one available to available without inference. Browser replay separately reports the exact agents.update selection. These observations were supplied evidence, not executions performed by this reviewer.

Likely related people:

  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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.

History

Review history (3 earlier review cycles)
  • reviewed 2026-09-20T15:51:33.332Z sha f9a4e91 :: needs changes before merge. :: [P2] Restore the chat-only warning in model option accessible names
  • reviewed 2026-09-20T16:00:48.867Z sha ca39de6 :: blocked before merge. :: none
  • reviewed 2026-09-20T16:21:28.449Z sha 099b55f :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 20, 2026
@obviyus
obviyus marked this pull request as ready for review September 20, 2026 16:13
@obviyus
obviyus merged commit cf625a1 into main Sep 20, 2026
234 checks passed
@obviyus
obviyus deleted the fix/native-catalog-auth-readiness branch September 20, 2026 17:04
@obviyus

obviyus commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator Author

Landed in cf625a1.

Cold native discovery now stays checking/unconfirmed instead of inventing an API sign-in requirement. Explicit account/transport choices and native readiness hooks remain authoritative; setup does not enable an unconfirmed model.

Verified real Telegram/OpenCode cold-to-ready behavior, inspected before/after Control UI proof, public SDK/source-equivalence checks, the registered Gateway/Codex account lifecycle test, a clean final review, and all required hosted checks. Removed the obsolete helper-only metadata assumption rather than changing the runtime to satisfy it.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 21, 2026
…law#153796)

Keep native catalog readiness authoritative while discovery is pending or availability is unconfirmed. Preserve explicit host-account/transport choices and native readiness hooks instead of inventing an API sign-in requirement.

Share catalog acquisition/projection through one owner, migrate command and SDK callers without changing public exports, and show checking/unconfirmed states in channel menus and model setup.

Verified real Telegram Test Server and OpenCode cold-to-ready discovery without inference, full Control UI before/after and selection proof, focused owner tests, SDK smoke, source-equivalent integration, and exact-head review/CI.

Co-authored-by: Ayaan Zaidi <[email protected]>
obviyus added a commit that referenced this pull request Sep 25, 2026
## What Problem This Solves

Fixes: opening `/models` or a channel model picker can wait up to five seconds for inventory discovery even when usable models are already known.

Related: #153796.

## User Impact

Chat model menus return the current known choices while discovery continues in the background. Pending providers retain the existing `checking models…` text, and the next open includes newly discovered models. Discovery does not edit an already-sent reply.

## Why This Change Was Made

The shared menu loader requested a writable catalog read, which waits for full inventory acquisition. It now reads the published catalog and lets the existing owner acquire the full inventory in the background. Native readiness and authentication facts still come from the same owner. Typed model selection and explicit refresh retain their existing paths; no configuration, startup, persistence, or protocol changes are required.

Owner approval:

> “chat pickers answer immediately from known rows, fetch in background”
>
> — Ayaan, 2026-09-25, model-picker invariants program

This decision includes the existing SDK menu builders. The previous implementation
already permitted partial results after its five-second acquisition race; awaiting
a builder was not a complete-inventory guarantee. The SDK compatibility guide now
states the published-row and `pendingProviders` contract explicitly.

## Evidence

Built baseline and candidate Gateways used isolated state and a local vLLM endpoint that delayed its model listing by four seconds. Real `chat.send` commands exercised `/models`; `models.list` was sampled alongside them.

| Observation | Baseline | Candidate |
| --- | --- | --- |
| First cold `/models` reply after acceptance | 7.493 s | 1.942 s |
| Replies while provider discovery was pending | 5.2–7.5 s | 185–625 ms after the initial replies |
| Later reply lists the newly discovered model | Yes | Yes |
| Catalog-not-ready errors in 80 `models.list` samples | 0 | 0 |

The first end-to-end candidate reply still includes cold session/admission work; this change removes the catalog acquisition wait, not every source of first-reply latency.

Before, this reply excerpt arrived after the acquisition wait; after, it arrived while the HTTP listing was still pending:

```text
- vllm/known-fixture

vllm: checking models…
```

A later candidate reply contained:

```text
- vllm/discovered-fixture
- vllm/known-fixture
```

Typed selection also completed through the Gateway:

```text
Model set to vllm/discovered-fixture for this session only; configured default unchanged.
```

- The held-acquisition regression fails on the original loader because no reply is produced; it passes with the fix and verifies that the next reply includes newly published rows.
- Focused command and recovery suites: 61 tests passed across the scoped runs. After constructing the immutable snapshot fixture correctly, the messaging typecheck and held-acquisition regression passed; the regression took 1.054 s. The full recovery-file single-worker run took 35.11 s including worker-artifact preparation.
- Clean-clone build, targeted formatting, and `git diff --check` passed. No model inference or paid provider calls were used.

### Telegram Test Server

The checkout's Telegram userbot runner exercised the built candidate with a
Convex-leased Test Server bot and user authorization. The first recorded menu was:

```text
Select a provider:

vllm: checking models…
```

Its button showed `vllm (1)`. The next provider menu offered the known model while
the HTTP listing was still pending. Reopening after discovery showed two model
buttons, including `discovered-fixture`.

The first menu arrived 3.951 s after the send receipt, including Telegram ingress
and cold-admission work; it was observed 17 ms after the four-second HTTP listing
started, well before that listing could complete. The later two-model menu
arrived 1.256 s after its send receipt. This proves nonblocking catalog
acquisition, not sub-second end-to-end Telegram startup.

TDLib recorded three new bot messages and zero edits or deletions: discovery did
not modify a previously sent list. Recording completed, the runner released its
credential state, and neither task port remained listening.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 26, 2026
…7899)

## What Problem This Solves

Fixes: opening `/models` or a channel model picker can wait up to five seconds for inventory discovery even when usable models are already known.

Related: openclaw#153796.

## User Impact

Chat model menus return the current known choices while discovery continues in the background. Pending providers retain the existing `checking models…` text, and the next open includes newly discovered models. Discovery does not edit an already-sent reply.

## Why This Change Was Made

The shared menu loader requested a writable catalog read, which waits for full inventory acquisition. It now reads the published catalog and lets the existing owner acquire the full inventory in the background. Native readiness and authentication facts still come from the same owner. Typed model selection and explicit refresh retain their existing paths; no configuration, startup, persistence, or protocol changes are required.

Owner approval:

> “chat pickers answer immediately from known rows, fetch in background”
>
> — Ayaan, 2026-09-25, model-picker invariants program

This decision includes the existing SDK menu builders. The previous implementation
already permitted partial results after its five-second acquisition race; awaiting
a builder was not a complete-inventory guarantee. The SDK compatibility guide now
states the published-row and `pendingProviders` contract explicitly.

## Evidence

Built baseline and candidate Gateways used isolated state and a local vLLM endpoint that delayed its model listing by four seconds. Real `chat.send` commands exercised `/models`; `models.list` was sampled alongside them.

| Observation | Baseline | Candidate |
| --- | --- | --- |
| First cold `/models` reply after acceptance | 7.493 s | 1.942 s |
| Replies while provider discovery was pending | 5.2–7.5 s | 185–625 ms after the initial replies |
| Later reply lists the newly discovered model | Yes | Yes |
| Catalog-not-ready errors in 80 `models.list` samples | 0 | 0 |

The first end-to-end candidate reply still includes cold session/admission work; this change removes the catalog acquisition wait, not every source of first-reply latency.

Before, this reply excerpt arrived after the acquisition wait; after, it arrived while the HTTP listing was still pending:

```text
- vllm/known-fixture

vllm: checking models…
```

A later candidate reply contained:

```text
- vllm/discovered-fixture
- vllm/known-fixture
```

Typed selection also completed through the Gateway:

```text
Model set to vllm/discovered-fixture for this session only; configured default unchanged.
```

- The held-acquisition regression fails on the original loader because no reply is produced; it passes with the fix and verifies that the next reply includes newly published rows.
- Focused command and recovery suites: 61 tests passed across the scoped runs. After constructing the immutable snapshot fixture correctly, the messaging typecheck and held-acquisition regression passed; the regression took 1.054 s. The full recovery-file single-worker run took 35.11 s including worker-artifact preparation.
- Clean-clone build, targeted formatting, and `git diff --check` passed. No model inference or paid provider calls were used.

### Telegram Test Server

The checkout's Telegram userbot runner exercised the built candidate with a
Convex-leased Test Server bot and user authorization. The first recorded menu was:

```text
Select a provider:

vllm: checking models…
```

Its button showed `vllm (1)`. The next provider menu offered the known model while
the HTTP listing was still pending. Reopening after discovery showed two model
buttons, including `discovered-fixture`.

The first menu arrived 3.951 s after the send receipt, including Telegram ingress
and cold-admission work; it was observed 17 ms after the four-second HTTP listing
started, well before that listing could complete. The later two-model menu
arrived 1.256 s after its send receipt. This proves nonblocking catalog
acquisition, not sub-second end-to-end Telegram startup.

TDLib recorded three new bot messages and zero edits or deletions: discovery did
not modify a previously sent list. Recording completed, the runner released its
credential state, and neither task port remained listening.

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

Labels

agents Agent runtime and tooling app: web-ui App: web-ui docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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.

1 participant