Skip to content

fix(models): discover account models after sign-in - #145190

Merged
obviyus merged 5 commits into
mainfrom
fix/ux-login-discovery
Sep 12, 2026
Merged

obviyus merged 5 commits into
mainfrom
fix/ux-login-discovery

Conversation

@obviyus

@obviyus obviyus commented Sep 11, 2026 •

Copy link
Copy Markdown
Collaborator

Repairs #144329 by @obviyus. Related: #144768, #145051, #145430, #145391, #145428, #145478, #145384, #145525.

What Problem This Solves

Successful sign-in could leave account models absent until manual refresh. Slow discovery could also delay credential publication or lose results after the caller stopped waiting.

Why This Change Was Made

The prepared catalog owner publishes static choices, then account rows for the changed provider. Discovery releases the build queue and continues after the caller's wait ends. Renewal retains compatible rows; logout rejects late results. Browser publication preserves newer Retry results.

User Impact

Pickers open without discovery requests and update while open. Ordinary /models reads stay passive. Explicit Refresh or Retry discovers later releases. Plugins using the optional provider selector need a supporting host release.

Consumers: login and credential renewal publish account models; chat menus and web pickers show pending and completed catalog state; plugin catalog augmentation can select provider hooks.

Evidence

Browser login → picker and Telegram login → /models passed with a seven-second recording endpoint: static choices remained available and late account rows appeared. Explicit refresh discovered an added row. Registered login, renewal, logout, catalog, and browser tests cover failure, empty results, and stale publication. Continuous integration passed. Physical native clients and live provider entitlement were not tested.

@obviyus
obviyus requested a review from a team as a code owner September 11, 2026 19:11
@clawsweeper

clawsweeper Bot commented Sep 11, 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 app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling extensions: xai size: XL maintainer Maintainer-authored PR labels Sep 11, 2026
@clawsweeper

clawsweeper Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 12, 2026, 2:28 AM ET / 06:28 UTC (Revision 23).

ClawSweeper review

What this changes

Refresh account model choices after sign-in and credential changes, keep existing choices usable during discovery, and publish progress and completed results to model menus and web pickers.

Merge readiness

⛔ Blocked before merge - 6 items remain

This remains useful, distinct work beyond the merged picker fixes. The documented SDK compatibility contract addresses the prior warning, and no blocking correctness finding was identified.

Priority: P2
Reviewed head: ad7ecff5cf4d014f6b412245bf758d9e1af1e236
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful implementation with strong source-attributed runtime evidence and no blocking code finding; restricted-owner approval remains separate.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The hash-matched body records the changed catalog owner exercised through pinned-head browser login and Telegram Test Server flows, with responsive starter choices and observed late account publication after seven-second synthetic provider responses. Historical upgrade and native-boundary evidence retain their original revisions. Prepared screenshots concern related login recovery and were not counted as current discovery proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The hash-matched body records the changed catalog owner exercised through pinned-head browser login and Telegram Test Server flows, with responsive starter choices and observed late account publication after seven-second synthetic provider responses. Historical upgrade and native-boundary evidence retain their original revisions. Prepared screenshots concern related login recovery and were not counted as current discovery proof.
Evidence reviewed 11 items Verified contribution boundary: The local merge-base-to-head comparison supplies all 84 introduced paths, completing the truncated prompt inventory. The reviewed checkout is the pinned original head; the supplied test merge is stale and was not used to claim removal of current-main behavior.
Central behavior remains absent on fetched main: Fetched main still documents manual discovery or first-open discovery in Models. Its runtime publication path announces the prepared generation without this branch's automatic catalog refresh.
Discovery and publication owner: The catalog owner separates acquisition from static publication, retains compatible inventory, checks current generation around worker results, and allows acquisition to finish after the five-second foreground wait.
Findings None None.
Security None None.

How this fits together

The Gateway prepares model choices from provider plugins, native runtimes, configuration, and account credentials. Its published catalog feeds chat commands, web pickers, and native clients.

flowchart TD
  A[Sign-in or credential change] --> B[Publish starter choices]
  B --> C[Provider-scoped discovery]
  D[Provider and native catalogs] --> C
  C --> E{Generation still current?}
  E -->|Yes| F[Publish account choices and status]
  E -->|No| G[Discard retired results]
  F --> H[Chat menus and client pickers]
Loading

Decision needed

Question Recommendation
Does the listed auth/security owner clear provider-scoped discovery through the private Gateway catalog-auth loader at the reviewed head? Clear the reviewed auth boundary: Record listed-owner acceptance of the scoped loader and catalog lifecycle after reviewing the existing fencing evidence.

Why: Repository policy requires listed-owner involvement on this restricted path; functional proof and a clean code review cannot supply that approval.

Before merge

  • Resolve merge risk (P1) - Plugins relying on providerIds can silently invoke unscoped hooks on v2026.9.4 unless they enforce the documented supporting-host requirement.
  • Resolve merge risk (P1) - Listed auth-owner clearance for the reviewed change is not established by the available discussion or GitHub reviews.
  • Complete next step (P2) - Obtain listed auth/security owner clearance for the provider-scoped catalog-auth changes at ad7ecff.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

Metric Value Why it matters
Public contract additions 1 optional SDK selector; 1 optional catalog status field Plugin consumers need the documented host requirement, while existing callers retain omission behavior.
Production versus test growth Production net +705; tests/support net +1,222; tooling net +21 Production growth is explained by scoped acquisition, retention, and publication ownership; documentation and generated Swift bindings are excluded.

Stored data model

Persistent data-model change detected: unknown-truncated-pull-files. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Retain the documented host requirement (recommended)
    Accept the additive SDK selector with unchanged omission behavior and require selector-dependent plugins to declare a supporting host release.

Technical review

Best possible solution:

Keep discovery with the prepared catalog owner, preserve passive browsing and account-generation fencing, and retain the documented SDK host requirement through owner-approved landing.

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

Yes: registered sign-in followed by passive model-list reads is a concrete reproduction path supported by current-main publication code and historical failing traces; current main was not executed during this review.

Is this the best way to solve the issue?

Yes: extending the existing catalog lifecycle avoids picker-triggered discovery and preserves one publication owner; the SDK compatibility warning now has an explicit contract and focused coverage.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 27e810cf2625.

Labels

Label justifications:

  • P2: This improves account-model availability after sign-in while existing starter choices and explicit refresh provide recovery.
  • merge-risk: 🚨 compatibility: The public SDK gains selection semantics that older hosts ignore, requiring the documented host-version contract.
  • 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 (live_output): The hash-matched body records the changed catalog owner exercised through pinned-head browser login and Telegram Test Server flows, with responsive starter choices and observed late account publication after seven-second synthetic provider responses. Historical upgrade and native-boundary evidence retain their original revisions. Prepared screenshots concern related login recovery and were not counted as current discovery proof.
  • proof: sufficient: Contributor real behavior proof is sufficient. The hash-matched body records the changed catalog owner exercised through pinned-head browser login and Telegram Test Server flows, with responsive starter choices and observed late account publication after seven-second synthetic provider responses. Historical upgrade and native-boundary evidence retain their original revisions. Prepared screenshots concern related login recovery and were not counted as current discovery proof.
  • proof: telegram-e2e: This PR needs Telegram Test Server proof with the repository E2E skill. Shared model menus gain visible pending status and late account choices; the supplied Test Server evidence covers this behavior.

Evidence

What I checked:

  • Verified contribution boundary: The local merge-base-to-head comparison supplies all 84 introduced paths, completing the truncated prompt inventory. The reviewed checkout is the pinned original head; the supplied test merge is stale and was not used to claim removal of current-main behavior. (ad7ecff5cf4d)
  • Central behavior remains absent on fetched main: Fetched main still documents manual discovery or first-open discovery in Models. Its runtime publication path announces the prepared generation without this branch's automatic catalog refresh. Public docs: docs/concepts/models.md. (docs/concepts/models.md:91, 27e810cf2625)
  • Discovery and publication owner: The catalog owner separates acquisition from static publication, retains compatible inventory, checks current generation around worker results, and allows acquisition to finish after the five-second foreground wait. (src/agents/prepared-model-runtime.catalog-access.ts:58, ad7ecff5cf4d)
  • Captured proof identity and observations: The complete 64,986-unit live body matched captured SHA-256 a7fe664b65ebc18691ec2720edf7353a0a86fc7397263690d8ef12661494132b and was inspected in successive ranges. It reports pinned-head browser login with a 7,002 ms acquisition and same-picker publication 144 ms later, plus Telegram Test Server menus retaining starter rows and receiving late account rows. Provider responses were synthetic. Historical upgrade evidence used the published v2026.9.4 driver and candidate e7aedff3; it is not relabeled as current-head execution. (ad7ecff5cf4d)
  • Regression coverage at registered boundaries: Inspected registered Gateway tests cover delayed login discovery, passive reads, same-account renewal, account replacement, logout during held discovery, native failure recovery, successful empty results, and scoped preservation. These were source-reviewed, not executed during this read-only review. (src/gateway/server-methods/models-auth-refresh.catalog.integration.test.ts:10, ad7ecff5cf4d)
  • SDK compatibility explicitly documented: The existing public augmentation helper gains an optional hook selector, preserving omitted-selector behavior and supplemental returned rows. Documentation explains empty, canonical, alias, and family selections and requires a supporting host for plugins relying on selection. Public docs: docs/plugins/sdk-provider-plugins/model-catalogs.md. (docs/plugins/sdk-provider-plugins/model-catalogs.md:263, ad7ecff5cf4d)

Likely related people:

  • openclaw/openclaw-secops: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • 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 (22 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-12T02:45:34.184Z sha e7aedff324c270dca10d21e9ec1381fdd42ac202 :: blocked before merge. :: none
  • reviewed 2026-09-12T03:20:58.032Z sha ddfcbb341293c33a4cf7e16bcb137ba8306b6d14 :: blocked before merge. :: none
  • reviewed 2026-09-12T03:53:33.388Z sha ddfcbb341293c33a4cf7e16bcb137ba8306b6d14 :: blocked before merge. :: none
  • reviewed 2026-09-12T04:09:01.659Z sha fc5daa9 :: blocked before merge. :: none
  • reviewed 2026-09-12T05:01:42.106Z sha cce3743 :: blocked before merge. :: none
  • reviewed 2026-09-12T05:35:37.345Z sha 41371e8 :: blocked before merge. :: none
  • reviewed 2026-09-12T05:50:19.812Z sha ad7ecff :: blocked before merge. :: none
  • reviewed 2026-09-12T06:02:20.496Z sha ad7ecff :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. 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 11, 2026
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Sep 11, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Sep 11, 2026
@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Sep 11, 2026
@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. 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. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. 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. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Sep 11, 2026
obviyus added a commit that referenced this pull request Sep 14, 2026
## What Problem This Solves
Login catalog tests can fail while automatic discovery is working correctly.

## Why This Change Was Made
Wait for the automatic HTTP request, hold its response through early reads, then confirm the published account row through passive `models.list`. This state has one writer: the fixture. This extends #147228 and preserves coverage for #145190. The fixed final-observation deadline is removed; the seven-second endpoint delay, read-latency limit, and 120-second test timeout remain.

## User Impact
No production behavior changes.

## Evidence
Failures: [34761804381](https://github.com/openclaw/openclaw/actions/runs/34761804381), [34799773048](https://github.com/openclaw/openclaw/actions/runs/34799773048), [34817608735](https://github.com/openclaw/openclaw/actions/runs/34817608735).

`node scripts/run-vitest.mjs src/gateway/server-methods/models-auth-login.catalog.integration.test.ts`: reversing the automatic discovery calls from #145190 fails both cases; twenty corrected runs pass. Local lint, types, protocol and guards pass.

Both hosted cases [pass](https://github.com/openclaw/openclaw/actions/runs/34824551516/job/103914012589) on merge `e847ce8327cf`, combining main `43d413bd3938` with head `f100a3fc2efb`. Both credential-refresh tests pass with this patch on main `7066d660a6fd`; they already observe request receipt or acknowledged publication.

## Compatibility
No public contract changes.

## Consumers
Only the login catalog test changes. The separate client-stop timeout remains outside this repair: no evidence links its socket-close failure to this observation race.

## Invalidation
Request receipt and catalog publication drive observations; cleanup removes listeners.

## Tests
Both endpoint delays and all passive-read and manual-refresh checks remain. Both held early responses must report pending; exactly one automatic request is required.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 15, 2026
## What Problem This Solves
Login catalog tests can fail while automatic discovery is working correctly.

## Why This Change Was Made
Wait for the automatic HTTP request, hold its response through early reads, then confirm the published account row through passive `models.list`. This state has one writer: the fixture. This extends openclaw#147228 and preserves coverage for openclaw#145190. The fixed final-observation deadline is removed; the seven-second endpoint delay, read-latency limit, and 120-second test timeout remain.

## User Impact
No production behavior changes.

## Evidence
Failures: [34761804381](https://github.com/openclaw/openclaw/actions/runs/34761804381), [34799773048](https://github.com/openclaw/openclaw/actions/runs/34799773048), [34817608735](https://github.com/openclaw/openclaw/actions/runs/34817608735).

`node scripts/run-vitest.mjs src/gateway/server-methods/models-auth-login.catalog.integration.test.ts`: reversing the automatic discovery calls from openclaw#145190 fails both cases; twenty corrected runs pass. Local lint, types, protocol and guards pass.

Both hosted cases [pass](https://github.com/openclaw/openclaw/actions/runs/34824551516/job/103914012589) on merge `e847ce8327cf`, combining main `37c97a239f5f` with head `f100a3fc2efb`. Both credential-refresh tests pass with this patch on main `1077e0c609e6`; they already observe request receipt or acknowledged publication.

## Compatibility
No public contract changes.

## Consumers
Only the login catalog test changes. The separate client-stop timeout remains outside this repair: no evidence links its socket-close failure to this observation race.

## Invalidation
Request receipt and catalog publication drive observations; cleanup removes listeners.

## Tests
Both endpoint delays and all passive-read and manual-refresh checks remain. Both held early responses must report pending; exactly one automatic request is required.

Co-authored-by: Ayaan Zaidi <[email protected]>
steipete added a commit that referenced this pull request Sep 28, 2026
* ci: advance trusted Kova pin to 2026.9.7 release budgets

Kova openclaw/Kova#157 (95a25b6b) raises five release-profile budgets that current main exceeds by design, approved by Peter for 2026.9.7: gateway-performance gateway-tree RSS and gateway CPU, bundled-plugin-startup gateway CPU, fresh-install gateway CPU, and the embedded agent CLI RSS cap. Causes: #145190 startup provider-catalog acquisition and #152840 SQLite state-worker growth; follow-up #160501.

* ci: include the gateway-tree CPU budget in the trusted Kova pin

Advance to openclaw/Kova#158 (5f2e98a5): gateway-performance gateway-tree maxCpuPercent 300 -> 325, which the strict release gate reported as BLOCKED at 272-300.3 % on main (run 36455844495).
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 29, 2026
…w#160573)

* ci: advance trusted Kova pin to 2026.9.7 release budgets

Kova openclaw/Kova#157 (95a25b6b) raises five release-profile budgets that current main exceeds by design, approved by Peter for 2026.9.7: gateway-performance gateway-tree RSS and gateway CPU, bundled-plugin-startup gateway CPU, fresh-install gateway CPU, and the embedded agent CLI RSS cap. Causes: openclaw#145190 startup provider-catalog acquisition and openclaw#152840 SQLite state-worker growth; follow-up openclaw#160501.

* ci: include the gateway-tree CPU budget in the trusted Kova pin

Advance to openclaw/Kova#158 (5f2e98a5): gateway-performance gateway-tree maxCpuPercent 300 -> 325, which the strict release gate reported as BLOCKED at 272-300.3 % on main (run 36455844495).
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 extensions: xai gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts 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