Skip to content

feat(web): add Atlas Cloud omni provider preset - #461

Open
binyangzhu000-sudo wants to merge 6 commits into
XiaoMi:mainfrom
binyangzhu000-sudo:codex/atlas-cloud-provider-preset
Open

feat(web): add Atlas Cloud omni provider preset#461
binyangzhu000-sudo wants to merge 6 commits into
XiaoMi:mainfrom
binyangzhu000-sudo:codex/atlas-cloud-provider-preset

Conversation

@binyangzhu000-sudo

@binyangzhu000-sudo binyangzhu000-sudo commented Jul 26, 2026

Copy link
Copy Markdown

Summary

  • add Xiaomi MiMo, Atlas Cloud, and custom provider presets to the omni model form
  • prefill Atlas Cloud with https://api.atlascloud.ai/v1 and the existing xiaomi/mimo-v2.5 multimodal model
  • keep provider detection stable when users switch to another model under the same endpoint
  • add English/Chinese labels and focused preset tests

Validation

  • npm test (246 passed, 1 skipped)
  • npm test -- tests/omniPresets.test.ts tests/i18n.test.ts (119 passed, 1 skipped)
  • npm run typecheck
  • npm run build
  • git diff --check
  • Atlas Cloud /v1/models live catalog returned 121 models and includes xiaomi/mimo-v2.5 and xiaomi/mimo-v2.5-pro

pnpm install --frozen-lockfile --ignore-scripts is currently blocked by an inherited empty workspace configuration (ERR_PNPM_INVALID_WORKSPACE_CONFIGURATION), so dependencies were installed with npm install --ignore-scripts --package-lock=false without changing the lockfile.

No README, documentation, logo, sponsor, credits, or partner changes.

Follow-up validation (2026-07-29)

  • fixed the provider-selector race so only the latest model-list request can update state
  • selecting Custom now preserves the existing model ID while detaching the preset Base URL
  • npm test: 247 passed, 1 skipped
  • npm run typecheck
  • npm run build
  • git diff --check
  • live Atlas Cloud xiaomi/mimo-v2.5 requests using the exact MiMoAdapter extensions:
    • python backend/miloco/tests/perception/engine/test_mimo_single.py --window 1 --base-url https://api.atlascloud.ai/v1 --model xiaomi/mimo-v2.5
    • video block with fps, media_resolution: "max", and thinking disabled: HTTP 200
    • audio block with the data:audio/m4a;base64,... data URI and no format field: HTTP 200
    • immediate combined video+audio retries reached the provider's HTTP 429 capacity limit; the two extension paths were therefore verified separately

Follow-up validation (2026-08-04)

  • reset stale model-list loading immediately when changing providers, including Custom
  • invalidate previous form-session requests when opening Add
  • npm test (247 passed, 1 skipped)
  • npm run typecheck
  • npm run build
  • git diff --check
  • no paid live request was rerun; the existing 2026-07-29 HTTP 200 evidence above was retained and its reproduction command documented

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions

Copy link
Copy Markdown

👋 感谢提交 PR @binyangzhu000-sudo!维护者会尽快 review。

提交前请确认:

  • CI 全绿(test / lint / build)
  • 改动聚焦单一主题,便于审阅
  • 若改动了依赖(lockfile / pyproject.toml / package.json),需维护者评论 /allow-dependencies-change <当前 head SHA> 放行(之后再 push 需重新放行)

@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown

PR #461: feat(web): add Atlas Cloud omni provider preset

作者: binyangzhu000-sudo
范围: codex/atlas-cloud-provider-preset → main

修改方案

给「模型」页 omni 配置卡的新增 / 编辑表单顶部加一个「服务商预设」下拉框,选中即自动回填 Base URL 和模型 id,免去手动输入。纯新增改动(5 文件,+117/-1,无删除符号)。

  • 预设清单单独成文件当数据源:新建 omniPresets.ts,导出两条预设——Xiaomi MiMo(https://api.xiaomimimo.com/v1)和本次新增的 Atlas Cloud(https://api.atlascloud.ai/v1),两家都预填同一个多模态模型 xiaomi/mimo-v2.5。后端 get_adapter 只看 model 字符串的子串(qwen / gemini 有专属 adapter,其余全部回落 MiMoAdapter),所以 xiaomi/mimo-v2.5 发往 Atlas Cloud 时会走 MiMo 私有方言(fpsmedia_resolutiondata-URI 音频、thinking 这些 OpenAI 规范外的扩展字段),PR 已在注释和 Validation 段给出真机验证证据(见下文对账)。

  • 选中预设后表单怎么变,按选的是不是真实预设分两条路(applyProviderPreset):

    用户选了什么 Base URL 模型 id 残留状态 是否拉模型目录
    某个服务商预设 写入预设值 写入预设值 候选列表 / 提示 / 错误码 / 测试结果全清 是,立刻用新 endpoint 拉一次
    「自定义」(id 查不到) 清空为空串 原样保留 同上全清;loading 就地关闭

    两条路都不动 API Key——保留用户已输入的 key。

  • 下拉框回显靠反查、不另存 state:每次渲染拿表单里的 Base URL 去清单里反查(selectedPreset + findOmniProviderPreset),只按 Base URL 匹配、不看模型。这样用户在同一服务商 endpoint 下把模型换成别的(如 xiaomi/mimo-v2.5-pro),下拉框仍稳定停在该服务商上、不跳回「自定义」。反查时对两边 Base URL 都做去空格 + 去尾部斜杠归一化。

  • 防止慢请求覆盖新结果(流水号守卫):给每次模型目录拉取发一个单调递增的流水号(modelsReqId),返回时先比对自己是不是最新那次,不是就整段跳过不写 state——包括 finally 里的 setModelsLoading(false)L317)。三个地方会推进流水号:

    applyProviderPreset ──→ +1(作废切换前 blur 发出的请求)──→ 若选中真实预设再 +1 并发新请求
    startAdd            ──→ +1(作废上一个表单会话的遗留请求)──→ 不发新请求
    fetchModels 内部    ──→ +1(每次拉取正常递增)
    

    任何推进流水号的地方都同步 setModelsLoading(false)——因为被作废的请求返回时会跳过 finally 里的关闭,若没有新请求接手就必须就地关,否则模型框永久卡在「正在拉取模型列表…」。

  • i18n 与测试:中英两套各加两个 key(providerPresetLabel / providerPresetCustom),i18n.test.ts 自动扫描组件引用的 usage.* key 是否双侧都存在。

    主线 测试文件::describe 用例摘要
    预设清单数据源 omniPresets.test.ts::omni provider presets Atlas Cloud 条目逐字段比对
    下拉框反查 同上 入参带首尾空格 + 尾斜杠仍能命中、预设定义侧带尾斜杠也能命中、未知 endpoint 回落 undefined

上轮 ci-bot 基线对账

上轮问题 本轮状态
🟡 选「自定义」时流水号被推进却没有新请求接手关 loading,模型框永久卡住 已修复8f1b996):L240 在推进流水号后立刻 setModelsLoading(false),无论后续是否发新请求都能正确关闭
🟡 Atlas Cloud 与 MiMo 私有方言绑定,验证证据未入档 已修复omniPresets.ts:19-20 注释写明复核方式(test_mimo_single.py --base-url https://api.atlascloud.ai/v1 --window 1),PR body 新增 "Follow-up validation (2026-07-29)" 段给出 video / audio 分别 HTTP 200 的结果与 429 限流说明
🔵 startAdd 未作废上一个表单会话的在飞拉取 已修复8f1b996):L252-253 加入 modelsReqId.current += 1 + setModelsLoading(false)
🔵 编辑态选「自定义」清空模型 id 已修复(上一轮已确认):L242 只在 preset 存在时才写模型

已排除(有代码证据,不计为问题)

  • 流水号守卫完整性:三个推进点(applyProviderPreset / startAdd / fetchModels)都正确处理了「谁来关 loading」的责任——applyProviderPresetstartAdd 就地关(可能不发新请求),fetchModelsfinally 只在非 stale 时关。两条路径互不遗漏。
  • startEdit 是否需要加流水号:不需要——它末尾调 fetchModelsL280),内部 ++modelsReqId.current 已经作废旧请求,且新请求会负责关 loading。
  • Cancel 按钮(L814)未推进流水号:Cancel 关闭表单(setAdding(false)),在飞请求返回后写 state 但 UI 不可见。下次打开新表单时 startAdd / startEdit 会重新初始化,不会泄漏旧数据。
  • 跨服务商 API Key 复用:编辑态切换预设时前端仍带着原档案的 editing label 调 listOmniModels,但后端 _key_by_labelbase_url 与存档值不一致时返回 ""(防跨 URL 复用凭证的 SSRF 防线),行为正确。
  • 反向引用扫描:纯新增、无删除符号,git grep atlascloud 全仓仅命中本 PR 新增文件。
  • i18n 覆盖:en / zh 双侧都已加 providerPresetLabel + providerPresetCustom,i18n 测试会自动校验。

结论

LGTM — 上轮 3 条问题(2 🟡 + 1 🔵)全部按建议修复,流水号守卫覆盖完整(三个推进点均正确处理 loading 关闭责任),Atlas Cloud 方言兼容性验证证据已入档(PR body + 代码注释均可复核),PR 描述与代码逐条对齐无偏差。


由 review-pr skill v1.6 生成

@binyangzhu000-sudo

Copy link
Copy Markdown
Author

Follow-up pushed in 8f1b996 to address the current PR review findings:

  • stop the stale model-list loading state immediately when switching providers, including Custom
  • invalidate an earlier form session's in-flight model request when opening Add
  • document the existing 2026-07 Atlas MiMoAdapter live-validation method in the preset comment and PR body

Validation:

  • npm test (247 passed, 1 skipped)
  • npm run typecheck
  • npm run build
  • git diff --check

No paid live request was rerun; the existing HTTP 200 video/audio evidence was retained and its reproduction command is now documented. The new head currently has all code CI checks green, with pr-review still running and CLA pending externally.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants