Skip to content

fix(models): keep typed-only models out of chat pickers - #197326

Merged
obviyus merged 4 commits into
mainfrom
openclaw/decision-picker-leak
Nov 12, 2026
Merged

obviyus merged 4 commits into
mainfrom
openclaw/decision-picker-leak

Conversation

@obviyus

@obviyus obviyus commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

When a Decision-only (inference.chat: false) model such as typesafe/jev-latest is listed explicitly in agents.defaults.models (or modelPolicy.allow), the Control UI chat picker shows it as "Sign-in needed". Selecting it cannot work: the agent refuses it with "does not support chat inference".

Root cause: buildAllowedModelSetFromPrepared in src/agents/model-selection-shared.ts looks up each authored ref only in the chat-filtered catalog (inventory.filter(chat !== false), added with the Decision catalog work). The typed-only row misses that lookup, so the policy treats it as unknown and synthesizes a placeholder entry with no inference field. The picker then lists that placeholder as a chat model. models.list also filtered the catalog before building the policy, so the policy could not see the typed row at all.

A related leak in the same list owner: prepareLogicalVisibleModelCatalog (src/agents/model-catalog-visibility.ts) publishes rows from whatever catalog the caller passes. Channel pickers such as Telegram /model pass the full prepared catalog, which includes typed-only manifest rows, so with an allow-any or provider/* policy those rows were listed as well.

Fix

  • Selection policy: an authored ref that no chat catalog knows but that exists in the unfiltered inventory (a known chat: false row) gets no placeholder and no conversational authorization. This matches the existing contract that typed-only rows are excluded from conversational selection.
  • The placeholder itself stays. It exists so that a configured model not yet published by any catalog (for example before live discovery lists it) stays visible and selectable. Refs that no catalog knows still get it.
  • Visible-catalog owner: drops typed-only rows before building picker candidates in every view. The policy still sees the unfiltered rows.
  • models.list: passes the unfiltered rows to the policy and keeps the chat-filtered list for everything else. Net zero lines in that file.

There are no per-surface patches. The Control UI picker, CLI models list (through models.list), channel /model pickers (through the shared visible-catalog owner) and session model switching (through the shared policy's allows) all consume these two owners.

Evidence

  • Regression tests, red on the base and green with the fix:
    • src/agents/model-selection.test.ts: an allowlisted typed-only ref yields no placeholder and is not allowed, while an uncataloged ref still gets its synthetic entry.
    • src/agents/model-catalog-visibility.test.ts: typed-only rows never appear under allow-any, wildcard or explicit policies in the default, configured and all views, and the uncataloged ref stays listed.
  • Consumer suites pass locally: models-list-result.* (12 files), commands-models*, sessions-patch-model-selection, decision-inference.integration, model-selection*, model-catalog-visibility*. src/commands/models/auth.test.ts (2 tests) and list.status.test.ts (1 test) fail identically on the base.
  • Test cost: model-catalog-visibility.test.ts about 8 s, model-selection.test.ts about 17 s for the whole file (--maxWorkers=1). The line-cap ratchet passes.
  • Test-line allocation: config/test-lines-allocations/decision-picker-typed-rows.txt = 15. The two regressions were first folded into an existing test plus one compact looped test, and the result fit locally with zero slack. Main has since used that slack, so CI saw +15 net lines over the ceiling. The record covers exactly this PR's net growth: one test per owner (the selection policy and the visible-catalog list), each red on the base.
  • Real product proof: an isolated Gateway, built from the base and then from this head, with every child under env -i (PATH, temp HOME, TMPDIR, OPENCLAW_STATE_DIR only), loopback only, its own port and token, no channels and no model credentials. Config lists openai/gpt-5.6-luna, typesafe/jev-latest and acme/unlisted-model explicitly. Control UI picker, captured with Playwright:
    • Before: 3 options, and searching jev finds typesafe/jev-latest marked "Sign-in needed".
    • After: 2 options (openai/gpt-5.6-luna, acme/unlisted-model). Searching jev gives no matches, and acme/unlisted-model is still listed.
    • openclaw models list --json against the fixed Gateway lists openai/gpt-5.6-luna and acme/unlisted-model.

Screenshots are attached in a comment.

obviyus and others added 2 commits November 11, 2026 23:44
An allowlisted chat:false row (a Decision model) missed the chat-filtered
catalog, so the selection policy synthesized a placeholder chat entry for it
and the Control UI picker showed it as "Sign-in needed". The policy now
recognizes the row in its unfiltered inventory and adds no placeholder;
refs no catalog knows still get one. The shared visible-catalog owner also
drops typed-only rows, so channel pickers that pass the full prepared
catalog stop listing them under allow-any and wildcard policies.

Co-authored-by: obviyus <[email protected]>
OpenClaw-Publication: 5a395168-fc03-4ce4-a923-88b013b2cc92
@clawsweeper

clawsweeper Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime agents Agent runtime and tooling size: S labels Nov 11, 2026
@obviyus

obviyus commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator Author

Control UI chat model picker on an isolated loopback Gateway. Config explicitly lists openai/gpt-5.6-luna, typesafe/jev-latest (chat:false Decision row) and acme/unlisted-model (unknown to every catalog). Before is the base build; after is this head. The order is: before full list, before search jev, after full list, after search jev.

Before: picker lists jev-latest (Decision-only) as Sign-in needed

Before: searching jev finds the Decision-only model

After: jev-latest is gone; unlisted-model still listed

After: searching jev finds no models

@obviyus

obviyus commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
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. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 11, 2026
@clawsweeper

clawsweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR prevents known Decision-only models from becoming chat-picker choices while preserving placeholders for unknown configured models.

Example: Configure typesafe/jev-latest and acme/unlisted-model in agents.defaults.models.

  • Before: The Control UI offers jev-latest with “Sign-in needed,” although it cannot perform chat inference.
  • After: jev-latest disappears from the picker and search results, while unlisted-model remains visible.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused shared-owner repair with inspected product proof, distinct regressions, green reported exact-head checks, and no actionable introduced findings.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after Control UI screenshots exercise the changed policy through an isolated Gateway: the explicitly configured typesafe/jev-latest row disappears, its search returns no matches, and acme/unlisted-model remains; the later head changes only test-line allocation.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: The chat picker presents a known Decision-only model as needing sign-in even though signing in cannot make it support chat.
Reason: The maintainer-authored direction restores the existing chat-capability contract with a small shared-owner repair and preserves useful unknown-model entries.

Regression provenance

Regression provenance — verified: source commit 3dd7f576829f by RoboClaw; canonical PR #157225 (blame-to-merge-commit).

Merge readiness

✅ Ready for maintainer review

Keep open: this PR fixes a source-confirmed picker bug that remains on current main, with relevant screenshot proof and no actionable introduced defects found.

Priority: P2
Reviewed head: ae6383a23240e2de01154bbe02397f7655825e70

Before merge

None.

Findings

None.

Agent review details

How this fits together

Prepared provider catalogs and configured model references enter the shared selection and visibility owners, which supply model choices to Gateway, CLI, and channel consumers.

flowchart TD
  A[Prepared model inventory] --> C[Selection policy]
  B[Configured model references] --> C
  A --> D[Chat catalog projection]
  C --> D
  D --> E[Gateway models list]
  D --> F[Channel model menus]
  E --> G[Control UI and CLI]
Loading

Technical review

Best possible solution:

Merge the focused repair through the existing selection and catalog-visibility owners while preserving genuine unknown-model placeholders.

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

Yes: current-main source exposes the placeholder path, and the supplied isolated-Gateway screenshots show the reported picker failure and its corrected result; no target code was run during this read-only review.

Is this the best way to solve the issue?

The repair uses the existing policy and visibility owners, retains the documented purpose of unknown-model placeholders, and requires no new configuration or persisted format.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Conversational inventory filtering keeps the original intent (3dd7f57: Decision runtime integration separated typed-only catalog rows from conversational selection.)
  • Synthetic configured rows and literal identities keeps the original intent (fix(models): preserve literal rows in model policy catalogs #143954: Genuinely missing configured models remain visible as sparse synthetic entries, with literal provider/model identities preserved.)
  • Logical catalog publication keeps the original intent (90567a8: Catalog projection preserves selected model identity and provider-owned physical routes through one shared owner.)
  • Gateway model-list composition keeps the original intent (faaae32: Runtime preparation facts were consolidated in their existing lexical owner without intended availability changes.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 90567a8 adds src/agents/model-catalog-visibility.ts:123 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 90567a8bfd42; files: src/agents/model-catalog-visibility.ts)
  • Ayaan Zaidi: Raw commit 271554f adds src/agents/model-catalog-visibility.ts:133 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 271554fbb31a; files: src/agents/model-catalog-visibility.ts)
  • Vincent Koc: Raw commit 645c188 adds src/agents/model-catalog-visibility.ts:20 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 645c18850bac; files: src/agents/model-catalog-visibility.ts)

PR surface

Source +4, Tests +15, Other +2. Total +21 across 6 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 31 27 +4
Tests 2 15 0 +15
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 6 48 27 +21

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Production versus regression growth Production +4 net lines; tests +15 lines The small production increase repairs two existing owners; the regression additions protect distinct selection and publication failures.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Known non-chat models appear as unusable chat choices under specific model configurations; ordinary chat-capable choices remain available.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • 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 (1 earlier review cycle)
  • reviewed 2026-11-11T18:30:33.362Z sha da69bd1 :: needs maintainer review before merge. :: none

Reviewed November 11, 2026, 2:07 PM ET / 19:07 UTC (Revision 2).

obviyus and others added 2 commits November 12, 2026 00:09
OpenClaw-Publication: f5da4540-321a-4328-8367-f4f51a187fcb
@obviyus

obviyus commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
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. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 11, 2026
@clawsweeper clawsweeper Bot removed the clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. label Nov 11, 2026
@obviyus
obviyus merged commit 55cac59 into main Nov 12, 2026
136 checks passed
@obviyus
obviyus deleted the openclaw/decision-picker-leak branch November 12, 2026 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling gateway Gateway runtime 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. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S 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