Skip to content

fix: respect model badge metadata - #11081

Merged
chrarnoldus merged 5 commits into
mainfrom
fix/model-selector-metadata-badges
Jun 10, 2026
Merged

fix: respect model badge metadata#11081
chrarnoldus merged 5 commits into
mainfrom
fix/model-selector-metadata-badges

Conversation

@chrarnoldus

Copy link
Copy Markdown
Collaborator

Summary

  • show the Free badge only when the catalog explicitly sets isFree to true
  • show the prompt-training disclosure only when mayTrainOnYourPrompts is true, independently of price or free status
  • preserve both metadata fields through the Kilo model catalog and provider pipeline

The catalog includes zero-priced models that explicitly are not free and paid models that may train on prompts, so deriving either indicator from price or from the other flag produces misleading model labels.

Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
@chrarnoldus chrarnoldus self-assigned this Jun 10, 2026
chrarnoldus and others added 3 commits June 10, 2026 15:13
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>

Copy link
Copy Markdown
Collaborator Author

Fixed the remaining UI condition: the training icon was still nested inside the Free badge render block, so paid models such as stealth/claude-opus-4.8 could not display it. The selector row and preview header now render the Free and training indicators independently, with regression coverage for that structure.

@kilo-code-bot

kilo-code-bot Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 2 Observations (pre-existing, not in diff) | Recommendation: Merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 0

The implementation is correct. mayTrainOnYourPrompts is consistently threaded from the Gateway API schema all the way through the provider pipeline, SDK types, and UI utilities. The old heuristic (deriving both badges from isFree + providerID === "kilo") is fully replaced by explicit catalog metadata. UI components (ModelSelector.tsx, ModelPreview.tsx) now correctly render the training-disclosure icon independently of the free badge, and tests exercise the actual implementation.

Other Observations (not in diff — pre-existing)

These are in files that were not modified by this PR.

File Line Issue
packages/kilo-vscode/webview-ui/agent-manager/MultiModelSelector.tsx 118–128 Training disclosure icon is still nested inside <Show when={model.isFree}>. Paid models with mayTrainOnYourPrompts: true will not show the icon in the Agent Manager multi-model selector — same bug that was fixed in ModelSelector.tsx and ModelPreview.tsx by this PR.
packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx 67 footer() still guards with providerID === "kilo" before calling FreeModelDisclosure.collectsData(). Now that collectsData only checks mayTrainOnYourPrompts, the provider guard is unnecessary and would suppress the TUI disclosure for any non-kilo provider whose catalog sets the flag.
Files Reviewed (13 files)
  • .changeset/honest-model-badges.md
  • packages/core/src/models.ts
  • packages/kilo-gateway/src/api/models.ts
  • packages/kilo-gateway/test/api/models.test.ts
  • packages/kilo-vscode/tests/unit/model-preview-data-line.test.ts
  • packages/kilo-vscode/tests/unit/model-selector-utils.test.ts
  • packages/kilo-vscode/webview-ui/src/components/shared/ModelPreview.tsx
  • packages/kilo-vscode/webview-ui/src/components/shared/ModelSelector.tsx
  • packages/kilo-vscode/webview-ui/src/components/shared/model-selector-utils.ts
  • packages/kilo-vscode/webview-ui/src/types/messages/providers.ts
  • packages/opencode/src/kilocode/components/free-model-disclosure.ts
  • packages/opencode/src/kilocode/provider/provider.ts
  • packages/opencode/test/kilocode/free-model-disclosure.test.ts
  • packages/opencode/test/kilocode/kilo-loader-auth.test.ts
  • packages/sdk/js/src/v2/gen/types.gen.ts
  • packages/sdk/openapi.json

Fix these issues in Kilo Cloud


Reviewed by claude-4.6-sonnet-20260217 · 1,877,867 tokens

Review guidance: REVIEW.md from base branch main

@chrarnoldus

Copy link
Copy Markdown
Collaborator Author

@lambertjosh lambertjosh 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.

LGTM! Thanks this is great.

@chrarnoldus
chrarnoldus merged commit 2aeb559 into main Jun 10, 2026
21 checks passed
@chrarnoldus
chrarnoldus deleted the fix/model-selector-metadata-badges branch June 10, 2026 19:17
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
…tadata-badges

fix: respect model badge metadata
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants