Skip to content

fix(agents): resolve bare alias fallbacks via alias index#78395

Closed
AtelyPham wants to merge 1 commit into
openclaw:mainfrom
AtelyPham:tin/fix-model-picker-bare-alias-provider-leak
Closed

fix(agents): resolve bare alias fallbacks via alias index#78395
AtelyPham wants to merge 1 commit into
openclaw:mainfrom
AtelyPham:tin/fix-model-picker-bare-alias-provider-leak

Conversation

@AtelyPham

@AtelyPham AtelyPham commented May 6, 2026

Copy link
Copy Markdown

Summary

Fix Telegram/Discord/Mattermost /model pickers misclassifying configured CLI-runtime bare aliases (opus-cli, sonnet-cli, etc.) under the agent's primary provider.

buildAllowedModelSetWithFallbacks (src/agents/model-selection-shared.ts) was synthesizing a fake <defaultProvider>/<aliasName> catalog entry for any bare-name fallback because addAllowedModelRef did not consult the configured alias index. Repro: a config with model.fallbacks: ["opus-cli", ...] and models["claude-cli/claude-opus-4-6"].alias = "opus-cli" made opus-cli appear under openai-codex (the primary provider) in /model.

The fix builds the alias index up front in buildAllowedModelSetWithFallbacks and short-circuits bare-name resolution through aliasIndex.byAlias before falling through to existing resolveBareModelDefaultProvider logic. Alias-first lookup is scoped to the fallbackModels loop only (not the explicit agents.defaults.models allowlist keys) so a bare allowlist key whose string happens to match another entry's alias is not silently rewritten — addresses Codex P2 review.

Resolved CLI-runtime aliases hit the existing isModelPickerVisibleProvider filter and are hidden from the picker (option a — conservative). Canonicalising CLI-runtime refs to the canonical provider with a runtime selector (option b) is the design-correct end state but deferred — needs a coordinated answer across all CLI backends and interacts with the runtime selector UX.

Side effect of the same synthesis bug: allowedKeys in getModelRefStatusWithFallbackModels was getting the wrong key (openai-codex/opus-cli) instead of the resolved one (claude-cli/claude-opus-4-6), so this is not just a UI fix — it also corrects the routing-allowlist gate.

Real behavior proof

Behavior or issue addressed: Telegram/Discord/Mattermost /models picker incorrectly listing bare CLI-runtime aliases (e.g. opus-cli) under the agent's primary canonical provider (e.g. openai-codex), and the same misrouting in the getModelRefStatusWithFallbackModels allowlist gate.

Real environment tested: Local repo running the actual production picker-data path (buildModelsProviderData from src/auto-reply/reply/commands-models.ts:68 — the same function consumed by Telegram/Discord/Mattermost /models commands) and the routing-allowlist gate (getModelRefStatusWithFallbackModels from src/agents/model-selection-shared.ts:781) directly against the bug-report config and a regression-witness config across three commits on this branch.

Exact steps or command run after this patch: pnpm exec tsx <script> where the script calls buildModelsProviderData(cfg) and getModelRefStatusWithFallbackModels(...) against the configs below, on each of ffafa9008d (main pre-PR), 5e545005f4 (initial PR fix), and the current PR tip.

// bug-report cfg (from the gist)
{ agents: { defaults: {
  model: { primary: "openai-codex/gpt-5.5", fallbacks: ["opus-cli", "anthropic/claude-opus-4-6"] },
  models: {
    "openai-codex/gpt-5.5": {},
    "claude-cli/claude-opus-4-6": { alias: "opus-cli" },
    "anthropic/claude-opus-4-6": {},
  },
}}}

// regression-witness cfg (Codex P2 scenario)
{ agents: { defaults: {
  model: { primary: "openai/gpt-4o" },
  models: {
    "openai/gpt-4o": {},
    "gpt-5.5": {},
    "claude-cli/claude-opus-4-6": { alias: "gpt-5.5" },
  },
}}}

Evidence after fix: terminal output, copied live from a Node process running the actual buildModelsProviderData and getModelRefStatusWithFallbackModels runtime against the configs above on the PR tip:

=== bug-report cfg (primary openai-codex/gpt-5.5, fallbacks include 'opus-cli') ===
providers: [ 'anthropic', 'openai-codex' ]
byProvider: {
  "anthropic": [ "claude-opus-4-6" ],
  "openai-codex": [ "gpt-5.5" ]
}
openai-codex contains 'opus-cli'? false
claude-cli present as provider? false

=== regression cfg (bare key 'gpt-5.5' + another entry alias = 'gpt-5.5') ===
providers: [ 'openai' ]
byProvider: {
  "openai": [ "gpt-4o", "gpt-5.5" ]
}

=== routing-allowlist gate (Codex P2 regression scenario) ===
openai/gpt-5.5 (bare allowlist key, not the default) allowed? true (must be true)

Before fix (ffafa9008d, main) — original bug visible in same runtime:

=== bug-report cfg ===
byProvider: {
  "openai-codex": [ "gpt-5.5", "opus-cli" ]   <-- leaked alias
}
openai-codex contains 'opus-cli'? true

Before fix (5e545005f4, initial PR fix) — Codex P2 regression visible:

=== regression cfg ===
byProvider: { "openai": [ "gpt-4o" ] }   <-- bare 'gpt-5.5' allowlist key dropped
=== routing-allowlist gate ===
openai/gpt-5.5 allowed? false   <-- regression

Observed result after fix: At PR tip, the byProvider map produced by the live buildModelsProviderData runtime no longer contains opus-cli under openai-codex for the bug-report config, and getModelRefStatusWithFallbackModels correctly returns allowed: true for openai/gpt-5.5 in the regression-witness config. Both pre-existing failing states (original bug + Codex P2 regression) are gone on the tip.

What was not tested: Live end-to-end Telegram bot interaction (sending /models openai-codex from a real Telegram chat to a running gateway) was not run, because the proof exercises the same shared buildModelsProviderData function the channel handler consumes — channel plugin button rendering is a pure passthrough of the byProvider map captured above.

Verification

  • pnpm test src/agents/model-selection.test.ts src/auto-reply/reply/commands-models.test.ts → all green.
  • New regression test in src/agents/model-selection.test.ts deterministically reproduces the original bug AND the Codex P2 regression: confirmed failing on main pre-fix and on 5e545005f4 (initial PR fix) respectively, passing on the PR tip.
  • New integration test in src/auto-reply/reply/commands-models.test.ts asserts byProvider.get("openai-codex") does not contain "opus-cli" for the bug-report config.
  • Existing commands-models.test.ts "deepseek-v4-flash" test still passes (catalog-inference fallback path preserved for non-aliased bare names).
  • pnpm exec oxfmt --check on touched files → clean.
  • pnpm check:changed → all gates pass.

Cross-surface impact

buildAllowedModelSetWithFallbacks is shared. Fix benefits: Telegram /model, Discord model picker, Mattermost model picker, and any caller of buildModelsProviderData / getModelRefStatusWithFallbackModels.

Related

Test plan

  • Failing seam unit test exercises bug-report config; passes after fix.
  • Failing seam unit test for Codex P2 regression scenario; passes after fix.
  • Integration test through buildModelsProviderData confirms openai-codex provider list does not contain bare CLI-runtime aliases.
  • Full model-selection.test.ts + commands-models.test.ts suites pass post-fix.
  • oxfmt --check clean on touched files.
  • pnpm check:changed clean.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 6, 2026
@clawsweeper

clawsweeper Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 3, 2026, 11:45 PM ET / 03:45 UTC.

Summary
The PR updates shared agent model allowlist construction so providerless fallback aliases resolve through the configured alias index, with model-selection and /models regression tests.

PR surface: Source +27, Tests +176. Total +203 across 3 files.

Reproducibility: yes. Current main lacks alias-first lookup in the fallback allowlist path, and Mantis baseline proof plus the PR's runtime output show opus-cli leaking under openai-codex.

Review metrics: 1 noteworthy metric.

  • Configured fallback resolution: 1 behavior changed, 0 config keys added. Existing providerless fallback strings can be interpreted differently during upgrade without a new opt-in setting.

Stored data model
Persistent data-model change detected: vector/embedding metadata: src/agents/model-selection-shared.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster ✨ media proof bonus
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Maintainers should decide whether alias-first precedence is acceptable for existing providerless fallback strings.

Risk before merge

  • [P2] Existing configs where a providerless fallback token matches a configured alias may route to the alias target after merge instead of the previous synthesized default-provider model row.
  • [P1] If the alias target uses a different provider, CLI runtime, or auth profile, upgraded setups may need different provider/auth readiness for the same config string.

Maintainer options:

  1. Accept Alias-First Fallback Routing (recommended)
    Land if maintainers agree providerless fallback strings should follow configured alias precedence even when an existing setup changes provider/auth routing.
  2. Pause For Runtime Selector Policy
    Hold or redirect the PR if maintainers want CLI-runtime selector and alias-collision policy settled before changing shared fallback allowlist behavior.

Next step before merge

  • [P2] Human maintainer acceptance is needed for the compatibility-sensitive fallback routing behavior; no narrow automated repair is left.

Security
Cleared: The diff changes TypeScript model-selection logic and tests only; no dependency, workflow, lockfile, secrets, publishing, or code-execution surface is changed.

Review details

Best possible solution:

Land after maintainers explicitly accept alias-first semantics for providerless fallback strings, or pause for a broader runtime-selector and upgrade policy if that behavior is not intended.

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

Yes. Current main lacks alias-first lookup in the fallback allowlist path, and Mantis baseline proof plus the PR's runtime output show opus-cli leaking under openai-codex.

Is this the best way to solve the issue?

Yes, with compatibility signoff. The shared helper feeds both /models picker data and model-ref allowlist status, so fixing it there avoids a channel-only workaround.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: This is a focused model picker and fallback-routing bug with limited blast radius but real provider-routing impact.
  • merge-risk: 🚨 compatibility: Providerless fallback strings that match configured aliases can resolve to different provider/model keys after merge than they do on current main.
  • merge-risk: 🚨 auth-provider: Alias targets may use different provider auth or CLI-runtime credentials than the previous synthesized default-provider fallback.
  • 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 (linked_artifact): Sufficient: the PR body includes copied live runtime output and Mantis artifacts/screenshots show the misplaced opus-cli row present on baseline Telegram and gone on the candidate.
  • proof: sufficient: Contributor real behavior proof is sufficient. Sufficient: the PR body includes copied live runtime output and Mantis artifacts/screenshots show the misplaced opus-cli row present on baseline Telegram and gone on the candidate.
  • mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. The PR changes visible Telegram /models picker rows, and the existing Mantis proof already demonstrates the behavior in Telegram Desktop.
Evidence reviewed

PR surface:

Source +27, Tests +176. Total +203 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 41 14 +27
Tests 2 176 0 +176
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 217 14 +203

What I checked:

Likely related people:

  • steipete: Recent history shows repeated shared model-selection, provider identity, and /models browse normalization changes in the affected helper and caller surfaces. (role: feature-history contributor; confidence: high; commits: 3eed32108187, 9fc71e90761e, e8895f0a9958; files: src/agents/model-selection-shared.ts, src/auto-reply/reply/commands-models.ts, docs/gateway/config-agents.md)
  • vincentkoc: Recent commits touched exact custom provider models and catalog deduplication in the shared model-selection helper. (role: recent area contributor; confidence: medium; commits: 160aad6fb359, daf7c92db3e5; files: src/agents/model-selection-shared.ts)
  • anagnorisis2peripeteia: Authored the merged CLI-runtime /models picker visibility change that the new integration test explicitly references. (role: adjacent picker contributor; confidence: medium; commits: bcb9fa42be18; files: src/auto-reply/reply/commands-models.ts, src/auto-reply/reply/commands-models.test.ts)
  • samson910022: Recent /models browse discovery work touched the same provider-data path and validation surface. (role: recent picker contributor; confidence: medium; commits: 44f45d8729f5; files: src/auto-reply/reply/commands-models.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5e545005f4

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/model-selection-shared.ts Outdated
@AtelyPham

AtelyPham commented May 6, 2026

Copy link
Copy Markdown
Author

Real behavior proof (shared /models picker-data path)

Captured by exercising buildModelsProviderData (the same function the Telegram, Discord, and Mattermost /models commands consume — src/auto-reply/reply/commands-models.ts:68) and getModelRefStatusWithFallbackModels (the routing-allowlist gate — src/agents/model-selection-shared.ts:781) directly, against the bug-report config and a regression-witness config across three commits on this branch.

Configs

// bug-report cfg (the one from the gist)
{ agents: { defaults: {
  model: { primary: "openai-codex/gpt-5.5", fallbacks: ["opus-cli", "anthropic/claude-opus-4-6"] },
  models: {
    "openai-codex/gpt-5.5": {},
    "claude-cli/claude-opus-4-6": { alias: "opus-cli" },
    "anthropic/claude-opus-4-6": {},
  },
}}}

// regression-witness cfg (Codex P2 scenario — bare allowlist key shares string with another entry's alias)
{ agents: { defaults: {
  model: { primary: "openai/gpt-4o" },
  models: {
    "openai/gpt-4o": {},
    "gpt-5.5": {},
    "claude-cli/claude-opus-4-6": { alias: "gpt-5.5" },
  },
}}}

Results

state bug-report cfg: openai-codex byProvider regression cfg: openai byProvider regression cfg: openai/gpt-5.5 allowed by routing gate
ffafa9008d (main, pre-PR) ["gpt-5.5", "opus-cli"]  bug present ["gpt-4o", "gpt-5.5"] ok true ok
5e545005f4 (initial PR fix) ["gpt-5.5"] fixed ["gpt-4o"]  Codex P2 regression false  Codex P2 regression
f6ecb9f73e (PR tip) ["gpt-5.5"] fixed ["gpt-4o", "gpt-5.5"] fixed true fixed

Raw output, PR tip (f6ecb9f73e)

=== bug-report cfg (primary openai-codex/gpt-5.5, fallbacks include 'opus-cli') ===
providers: [ 'anthropic', 'openai-codex' ]
byProvider: {
  "anthropic": [ "claude-opus-4-6" ],
  "openai-codex": [ "gpt-5.5" ]
}
openai-codex contains 'opus-cli'? false
claude-cli present as provider? false

=== regression cfg (bare key 'gpt-5.5' + another entry alias = 'gpt-5.5') ===
providers: [ 'openai' ]
byProvider: {
  "openai": [ "gpt-4o", "gpt-5.5" ]
}

=== routing-allowlist gate (Codex P2 regression scenario) ===
openai/gpt-5.5 (bare allowlist key, not the default) allowed? true (must be true)

Raw output, main pre-PR (ffafa9008d) — original bug

=== bug-report cfg (primary openai-codex/gpt-5.5, fallbacks include 'opus-cli') ===
providers: [ 'anthropic', 'openai-codex' ]
byProvider: {
  "anthropic": [ "claude-opus-4-6" ],
  "openai-codex": [ "gpt-5.5", "opus-cli" ]
}
openai-codex contains 'opus-cli'? true

Raw output, initial PR fix (5e545005f4) — Codex P2 regression visible

=== regression cfg (bare key 'gpt-5.5' + another entry alias = 'gpt-5.5') ===
providers: [ 'openai' ]
byProvider: {
  "openai": [ "gpt-4o" ]
}

=== routing-allowlist gate (Codex P2 regression scenario) ===
openai/gpt-5.5 (bare allowlist key, not the default) allowed? false (must be true)

Reproducer

import { buildModelsProviderData } from "src/auto-reply/reply/commands-models.ts";
import { getModelRefStatusWithFallbackModels } from "src/agents/model-selection-shared.ts";

const cfg = { /* either config above */ };
const data = await buildModelsProviderData(cfg);
console.log([...data.byProvider.entries()].map(([k, v]) => [k, [...v].toSorted()]));

Run via pnpm exec tsx <script>. Verifies both:

  • the original /models picker leak (opus-cli no longer listed under openai-codex)
  • the Codex P2 regression fix (bare allowlist key not silently rewritten by an unrelated alias entry).

@clawsweeper re-review

Re-review progress:

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 6, 2026
@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 6, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 6, 2026
@AtelyPham
AtelyPham force-pushed the tin/fix-model-picker-bare-alias-provider-leak branch from f6ecb9f to 7936106 Compare May 6, 2026 11:49
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 6, 2026
@AtelyPham

Copy link
Copy Markdown
Author

@clawsweeper re-review
@codex review

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 6, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Can't wait for the next one!

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 6, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 6, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

💡 Codex Review

https://github.com/openclaw/openclaw/blob/6e6e22b0e3599f8a0ec7fef70434e670ed63c8d4/src/agents/model-selection-shared.ts#L681-L685
P2 Badge Resolve fallback aliases with inferred provider for bare model keys

When a fallback alias points to a agents.defaults.models entry keyed by a bare model id, this branch uses aliasIndex.byAlias directly, but buildModelAliasIndex parses bare keys with the global default provider rather than resolveBareModelDefaultProvider inference. In configs like default openai-codex, model key "claude-opus-4-6" (aliased as "opus"), and catalog ownership under anthropic, fallbacks: ["opus"] now resolves to openai-codex/claude-opus-4-6 instead of the inferred anthropic/claude-opus-4-6, producing the wrong allowlist/provider grouping for /models and fallback gating.

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 6, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 6, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 7, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5582a93bce

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/model-selection-shared.ts
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 7, 2026
@AtelyPham
AtelyPham force-pushed the tin/fix-model-picker-bare-alias-provider-leak branch from fa1edc6 to 7b9cfd7 Compare May 7, 2026 19:59
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 7, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 7, 2026
@AtelyPham
AtelyPham force-pushed the tin/fix-model-picker-bare-alias-provider-leak branch from 5779d98 to ee7aa7d Compare May 7, 2026 20:16
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 7, 2026
@AtelyPham

Copy link
Copy Markdown
Author

Hi @steipete @vincentkoc @joshavant @sallyom — sorry to ping directly. This PR is a small /models picker fix (bare-alias entries leaking under wrong providers) and has been sitting since clawsweeper and codex reviews landed. Would any of you have a moment to take a look? Happy to address feedback quickly. Thanks!

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 19, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jun 3, 2026
@AtelyPham
AtelyPham force-pushed the tin/fix-model-picker-bare-alias-provider-leak branch from 64da605 to 05addd3 Compare June 3, 2026 09:18
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 3, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 3, 2026
@AtelyPham
AtelyPham force-pushed the tin/fix-model-picker-bare-alias-provider-leak branch from 05addd3 to 642b3cb Compare June 3, 2026 09:30
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 3, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jun 3, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Jun 15, 2026
@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels Jun 15, 2026
@clawsweeper
clawsweeper Bot temporarily deployed to qa-live-shared June 15, 2026 06:50 Inactive
@openclaw-mantis

Copy link
Copy Markdown
Contributor

Mantis Telegram Desktop Proof

Summary: Mantis captured native Telegram Desktop before/after GIFs for the /models openai-codex picker.

Main screenshot This PR screenshot
Baseline native Telegram Desktop screenshot Candidate native Telegram Desktop screenshot
Main This PR
Baseline native Telegram Desktop proof GIF Candidate native Telegram Desktop proof GIF

Motion-trimmed clips:

Raw QA files: https://artifacts.openclaw.ai/mantis/telegram-desktop/pr-78395/run-27529047830-1/index.json

Bare CLI-runtime alias fallbacks (e.g. opus-cli) leaked into the Telegram, Discord, and Mattermost /model pickers as fake <defaultProvider>/<alias> entries. Resolve fallback aliases through the configured alias index, infer the catalog provider for the target, and forward the caller's manifest normalization context so /models snapshots resolve alias targets the same way the rest of the allowlist does.
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@AtelyPham

Copy link
Copy Markdown
Author

Closing — this is now fixed on main.

The bare CLI-runtime alias leak this PR targeted (e.g. opus-cli listed under the primary provider in the /models picker and the fallback allowlist gate) no longer reproduces. Bare fallback/allowlist resolution now runs through resolveModelRefFromString, which consults the configured alias index (aliasIndex.byAlias) before any default-provider inference (src/agents/model-selection-shared.ts:769). For the report config, opus-cli resolves to its real claude-cli/claude-opus-4-6 ref instead of a synthesized openai-codex/opus-cli, on both surfaces:

  • picker: buildModelsProviderDataaddRawModelRefresolveModelRefFromString(aliasIndex) (src/auto-reply/reply/commands-models.ts)
  • allowlist gate: buildAllowedModelSetWithFallbacks fallback loop → resolveSelectionModelRef → same resolver (src/agents/model-selection-shared.ts:1071)

Delivered by #110888 (wiring the alias index into the fallback/allowlist path), building on #100209 and the resolveModelRefFromString byAlias-first refactor. The invariant is covered on main (model-selection.test.ts, model-fallback.test.ts). Superseded, so closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling mantis: telegram-visible-proof Mantis should capture Telegram visible proof. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. 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: supplied External PR includes structured after-fix real behavior proof. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M stale Marked as stale due to inactivity 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