DSH / Atlas
2026-10-22implementedfeature

Model selector badges come from the model listing

模型选择器角标来自模型列表

The Web model selector showed `1017` beside `DeepSeek-V4.1-Flash` through a dedicated client package that matched two DeepSeek providers, one model id, and one exact catalog name. Changing or retiring that release marker, or labeling another model, required a client release, while both DeepSeek routes already read model metadata from the service's `GET /models` listing.

English

Problem

The Web model selector showed 1017 beside DeepSeek-V4.1-Flash through a dedicated client package that matched two DeepSeek providers, one model id, and one exact catalog name. Changing or retiring that release marker, or labeling another model, required a client release, while both DeepSeek routes already read model metadata from the service's GET /models listing.

Decision

  • Each /models entry may declare badge: { text, tone } under client_metadata["deepseek-harness"], keyed like client_requirements by the User-Agent product token. client_metadata holds client-specific data that every build may ignore, so the public model fields stay unchanged and later DeepSeek Harness fields join the same object. text uses the package-metadata LocalizedText form: one string, or translations keyed by lowercase language id that include en. Each text is trimmed and holds 1 to 12 user-perceived characters on one line; controls, Unicode line separators, bidi controls, and text made only of whitespace or default-ignorable characters are rejected.
  • tone is neutral, info, success, or warning: the Tag palettes for a plain fact, a highlight, a benefit, and attention. The shipped release marker used info; the surveyed selectors draw plan and capability tags neutral, new features with an accent, and usage hints in a warning color. danger and solid keep their failure and selection meanings.
  • parseModelListing decodes the badge beside the entry's other declarations, and resolveListedCatalog keeps the badges of offered models; both routes attach them through catalogModelInfo. An absent or null value at any level of that path shows no badge, and an absent or unrecognized tone shows neutral. A level that is not an object or an unreadable badge drops the badge, which is reported with the listing's other problems and never hides its model.
  • LlmModelInfo.badge and ModelCatalogModel.badge carry the badge from discovery through the Host model catalog to the browser. resolveModelInfo omits it, and no model request, Session event, or model-facing tool reads it.
  • ui-model-selection renders the badge before the catalog name in the trigger and after it in the root-menu value and each option, resolving its text with ctx.locale.resolveText. A conversation.input.model.label contribution replaces the name and badge together and receives the badge in its owner props.
  • The build ships no badge of its own: a route before its first listing shows none. The API-key route does not follow listings for customized catalogs or non-official endpoints; the account route follows the origin of its configured baseURL, including custom endpoints. The fixed ui-deepseek-model-label-1017 package and its Web bundle row are removed.
  • After first use, the credential-scoped cache refreshes automatically at modelsMaxAgeMs (ten minutes by default) and publishes changed catalogs through llm/models-updated. Successful listings replace all badge metadata, so omission or null clears an old badge. Failed refreshes retain the last successful listing, including badges: a failed request does not establish that the server withdrew a badge. This avoids independent polling in every browser. A zero interval preserves access-only refresh.

Alternatives considered

A top-level badge field. The public /models fields describe model capabilities and limits for every client, while the badge is DeepSeek Harness release and campaign copy. A top-level field reads as a model attribute that other clients could start rendering, after which the service could no longer change or retire it freely, and two clients could not show different badges.

badge inside client_requirements["deepseek-harness"]. It adds no top-level field, and released builds ignore an extra key there. But an unreadable requirement hides its model on every build, released ones included, so a serializer that writes the emptied object as null after a badge is retired would hide the model. Requirements gate availability; display data must stay ignorable.

A narrower map such as client_presentation or client_annotations. These names limit the object to display data or descriptive notes, so the next client-specific field of another kind, such as a default, would need another top-level field; client_metadata takes any field a build may ignore.

A semantic badge kind mapped to client dictionaries. OpenCode, ZCode, and DeepSeek-Reasonix translate a closed set of client-owned tag kinds, and none renders text a server sends. A fixed vocabulary cannot express a release code such as 1017, and each new wording would need the client release the listing exists to avoid. Listing text is provider data, which the locale-owned copy decision renders verbatim; the LocalizedText form still lets the service supply translations.

Accept colors, CSS, or markup from the listing. No surveyed product accepts styling from a catalog, and arbitrary colors bypass the theme's light and dark palettes and their contrast. A closed tone set maps onto the existing Tag palettes, and an unrecognized tone degrades to neutral, so a value a newer service adds never removes the text.

Keep 1017 as a built-in default. A bundled badge would keep the marker offline and on custom endpoints. Under the listing rule that an absent field keeps the build's value, the service could then remove it only with a special empty value, and old builds would keep the stale marker wherever no listing loads. Shipping no badge makes the listing the only source, so omitting the field removes the badge.

An expiry or start time on the badge. The listing cache lives in memory and refreshes on access after modelsMaxAgeMs, so a badge the service drops disappears within one refresh. Client-side time windows would add dependence on the client clock without removing reachable staleness.

Drop the whole entry or listing for a bad badge. OpenCode drops a model whose catalog status it cannot decode, and Codex fails its catalog decode on one unknown enum value. A badge is presentation only, so a bad one is dropped by itself.

A DeepSeek-specific badge Remote beside the catalog. Keeping the badge out of LlmModelInfo would need a second Remote, a second client fetch, and agreement between two caches about which models exist. One optional field on the existing catalog reaches every placement in one load.

Consequences

  • The service changes, localizes, or removes a badge without a client release; a running client shows the change after its next listing refresh and catalog reload.
  • A condition that older builds must enforce belongs in client_requirements; every field under client_metadata must be safe for a build that does not read it.
  • deepseek-flash shows no badge until the service declares one and a listing loads. Customized catalogs and non-official endpoints on the API-key route do not receive listed badges.
  • The /model popup, the trigger's accessible name, and the Models settings page keep plain names.
  • A profile patch that still targets ui-deepseek-model-label-1017 matches no row and boots with a warning (upgrade guide).

中文

问题

Web 模型选择器通过一个专门的客户端包在 DeepSeek-V4.1-Flash 旁显示 1017,该包写死匹配两个 DeepSeek 提供方、一个模型 id 和一个确切的目录名称。修改或撤下这个版本标记、给其他模型加标签,都要发一次客户端版本;而两条 DeepSeek 路由早已从服务端的 GET /models 列表读取模型元数据。

决策

  • 每个 /models 条目可以在 client_metadata["deepseek-harness"] 下声明 badge: { text, tone },与 client_requirements 一样以 User-Agent 的产品名为键。client_metadata 存放所有版本都可以忽略的客户端专属数据,因此公开的模型字段保持不变,以后新增的 DeepSeek Harness 字段也放进同一个对象。text 采用包元数据的 LocalizedText 形式:单个字符串,或以小写语言 id 为键且包含 en 的译文。每段文字去掉首尾空白后须为单行,长度为 1 到 12 个用户可见字符;拒绝控制字符、Unicode 行分隔符、双向控制符及仅由空白或默认可忽略字符组成的文字。
  • tone 取 neutral、info、success 或 warning,分别是 Tag 表示普通事实、强调、利好和需要注意的配色。已发布的版本标记使用 info;调研的选择器把套餐和能力标签画成中性色,新功能用强调色,用量提示用警示色。danger 和 solid 保留各自表示失败和当前选中的含义。
  • parseModelListing 与条目的其他声明一起解码角标,resolveListedCatalog 保留已提供模型的角标;两条路由都通过 catalogModelInfo 附上角标。这条路径上任何一层缺省或为 null 时不显示角标;tone 缺省或无法识别时按 neutral 显示。某一层不是对象或角标无法读取时,角标被丢弃,并与列表的其他问题一起报告,但不会隐藏所属模型。
  • LlmModelInfo.badge 与 ModelCatalogModel.badge 把角标从模型发现经 Host 模型目录送到浏览器。resolveModelInfo 不返回它,模型请求、Session 事件和面向模型的工具都不读取它。
  • ui-model-selection 在触发按钮中把角标放在目录名称之前,在根菜单当前值和各选项中仍放在名称之后,并用 ctx.locale.resolveText 解析其文字。conversation.input.model.label 的扩展会同时替换名称与角标,并从 owner props 收到角标。
  • 本版本不内置任何角标:路由加载到第一份列表之前不显示角标。API key 路由在自定义目录或非官方端点上不跟随列表;账号路由跟随配置的 baseURL 的源,包括自定义端点。写死的 ui-deepseek-model-label-1017 包及其 Web bundle 条目已移除。
  • 按凭据区分的缓存首次使用后按 modelsMaxAgeMs(默认十分钟)自动刷新,通过 llm/models-updated 发布目录变化。成功加载会替换所有角标元数据,因此省略或 null 都会清除旧角标。刷新失败时保留上次成功加载的列表及其角标:请求失败并不能证明服务端撤下了角标。这样也避免了每个浏览器独立轮询。间隔为零时仍只在访问时刷新。

考虑过的替代方案

顶层 badge 字段。 公开的 /models 字段为所有客户端描述模型的能力与限制,而角标是 DeepSeek Harness 的发版和运营文案。放在顶层会被当作模型属性,其他客户端可能开始显示它,此后服务端就无法随意修改或撤下;两个客户端也无法显示不同的角标。

把 badge 放进 client_requirements["deepseek-harness"]。 这样不增加顶层字段,已发布版本也会忽略其中多出的键。但版本要求无法读取时,所有版本都会隐藏该模型,已发布的版本也不例外;撤下角标后,序列化器若把清空的对象写成 null,模型就会被隐藏。版本要求决定模型能否使用,展示数据必须可以忽略。

范围更窄的映射,例如 client_presentation 或 client_annotations。 这些名称把对象限定为展示数据或附加说明,下一个其他类型的客户端专属字段(例如默认值)又要新开一个顶层字段;client_metadata 可以容纳任何版本都能忽略的字段。

用语义化的角标类别映射到客户端字典。 OpenCode、ZCode 和 DeepSeek-Reasonix 都翻译一组封闭的、由客户端持有的标签类别,没有一家直接渲染服务端发来的文字。固定词表表达不了 1017 这样的版本代号,每出现一种新说法都要发一次客户端版本,而列表正是为了免去这一步。列表文字属于提供方数据,按客户端文案归 locale 管理的决定原样渲染;LocalizedText 形式仍允许服务端提供译文。

接受列表下发的颜色、CSS 或标记。 调研的产品都不接受目录下发的样式;任意颜色会绕过主题的明暗配色及其对比度。封闭的语调集合直接对应现有 Tag 配色;无法识别的语调降级为 neutral,因此较新的服务端新增的取值不会让文字消失。

把 1017 保留为内置默认值。 内置角标能让标记在离线和自定义端点下继续显示。但按照“字段缺失时沿用本版本的值”的列表规则,服务端只能用特殊的空值才能去掉它,而且旧版本在加载不到列表时会一直显示过时的标记。不内置角标,列表就是唯一来源,省略字段即可去掉角标。

给角标加过期时间或生效时间。 列表缓存只在内存中,超过 modelsMaxAgeMs 后在访问时刷新,服务端撤下的角标在一次刷新内就会消失。客户端时间窗口会引入对客户端时钟的依赖,却消除不了实际可能出现的陈旧数据。

角标有误时丢弃整个条目或整份列表。 OpenCode 会丢掉目录状态无法解码的模型,Codex 遇到一个未知枚举值就让整份目录解码失败。角标只用于展示,有误时只丢弃角标本身。

在目录之外为 DeepSeek 单独提供角标 Remote。 让角标不进入 LlmModelInfo,就需要第二个 Remote、客户端的第二次请求,以及两份缓存对“有哪些模型”保持一致。在现有目录上增加一个可选字段,一次加载即可送到所有显示位置。

影响

  • 服务端无需客户端发版即可修改、翻译或撤下角标;运行中的客户端在下一次列表刷新和目录重新加载后显示变化。
  • 旧版本必须执行的条件放在 client_requirements;client_metadata 下的每个字段都必须保证不读取它的版本也能安全运行。
  • 服务端声明并加载到列表之前,deepseek-flash 不显示角标。API key 路由的自定义目录与非官方端点不接收列表角标。
  • /model 弹窗、触发按钮的无障碍名称和模型设置页仍只显示名称。
  • 仍指向 ui-deepseek-model-label-1017 的 profile patch 不再匹配任何条目,启动时会给出警告(升级指南)。