Skip to content

fix(pi): SuperGrok Grok 4.6 可热切,并收紧 live catalog 刷新 - #2818

Merged
MagicLizi merged 13 commits into
mainfrom
dash/pi-live-model-catalog
Aug 18, 2026
Merged

fix(pi): SuperGrok Grok 4.6 可热切,并收紧 live catalog 刷新#2818
MagicLizi merged 13 commits into
mainfrom
dash/pi-live-model-catalog

Conversation

@dashhuang

@dashhuang dashhuang commented Aug 16, 2026

Copy link
Copy Markdown
Member

这次改了什么

摘要

Pi 任务切到 SuperGrok Grok 4.6 会报 Model not found。原因是 pinned Pi 0.83 自带 xAI 目录没有 grok-4.6,订阅 inheritModels 块又不会把它写成 catalog addition,getAvailable() 看不到这个模型。

本 PR 把未探测到的 grok-4.6 写成 openai-responses catalog addition,给 xAI 补占位 apiKey 和 xai/grok-4.6 别名。登录后热刷新只允许 SuperGrok 在占位 env / endpoint / header 未变时补模型;switch_session 失败会回滚。ChatGPT 别名改回指向 chatgpt/gpt-* spec id,避免订阅路由掉回 cindy 网关。

另外补上官方推理档:Grok 4.6 支持 low / medium / high(默认)/ xhigh。Pi 快照和 inheritModels 以前没发布 xhigh,选择器只有低/中/高,选了也不会发给 xAI。现在缺失模型和档位过期的 bundled 行都会带上官方梯子。Claude/Codex 静态目录留给 #2601,本 PR 不碰。

变更类型

  • fix 缺陷修复
  • feat 新功能
  • refactor / perf 重构或性能优化
  • docs / test / chore 文档、测试或工程维护
  • 其他:

范围

  • 关联 Issue / 需求:无
  • 本 PR 包含:
    • inheritModels xAI 把 pinned Pi 缺失的 grok-4.6 写成 catalog addition
    • 占位 apiKey,使 Pi getAvailable() 能看见已配置的 xAI 模型
    • 别名映射到 spec models[].id,UI 的 xai/grok-4.6 落到 wire id grok-4.6
    • 热刷新仅限 SuperGrok,且 env / baseUrl / header 不变;reload 失败回滚
    • Pi 目录 / thinkingLevelMap / inheritModels 发布 Grok 4.6 的 xhigh,默认 high
    • SuperGrok 发现接口只回三档时与官方梯子并集
    • sync-model-catalog 校正,避免下次从 pi.dev 同步打回 xhigh
  • 明确不包含:
  • 用户可见变化:已登录 SuperGrok 的 Pi 任务可以切到 Grok 4.6,不必为这个模型单独重开任务;推理强度会出现「超高」,重启 Pi 任务后才会真正发出
  • 是否存在 breaking change:无

UI 变化

不涉及:档位条目由目录驱动,没有新的视觉 / 交互 / 文案规则。

  • 引用的设计规范:不涉及:目录驱动的推理档位,未改选择器 UI

怎么验证的

自动验证

pnpm --filter desktop exec vitest run src/main/maker-host/__tests__/piNativeProviders.test.ts src/main/maker-host/__tests__/activeCatalogDiscovery.test.ts
结果:64 passed / 1 skipped

pnpm --filter @cindy/maker-core exec vitest run src/agents/pi/__tests__/pi-provider-routing.test.ts
结果:47 passed

pnpm --filter @cindy/model-providers exec vitest run src/__tests__/catalog.test.ts src/__tests__/piCatalogCorrections.test.ts
结果:58 passed

pnpm --filter desktop run typecheck
结果:通过

pnpm check:dco
结果:通过

pnpm test:unitghostInstallReceipt.test.ts 有 2 条失败。已在干净 origin/main 复现,与本 diff 无关,交给 CI 兜底。

手工验证

隔离沙箱 Cindy-dev2-pi-live-catalog--region=cn --isolated=pi-live-catalog)里,新建 Pi 任务后切到 Grok 4.6 可通过。用户已确认热切。xhigh 档位未再做真机目检。

未执行的验证

未用真实 SuperGrok 账号跑完整带工具回合;未验证远端 SSH Pi;未在实机点选「超高」发一回合。

风险

风险分类

  • 无已知风险
  • SQLite / migration
  • system prompt
  • 协议兼容
  • 权限 / 安全 / 用户数据
  • 存量插件兼容(批准状态 / 指纹 / manifest 校验 / 安装布局 / 包格式)
  • 原生层 / fingerprint / OTA
  • 跨平台差异
  • 其他:

影响与回滚

  • 影响范围:Pi 会话的 SuperGrok / ChatGPT 订阅模型路由与 models.json 热写。热刷新故意不改已 spawn 进程的 env,避免把旧 BYOM 凭证带到新 endpoint。xhigh 进入 inheritModels overlay 与 Pi 快照。
  • 回滚 / 降级方式:回退本 PR。既有 Pi 会话若已按新 models.json 启动,回退后重开会话即可。
  • 存量插件影响:无

提交前检查

  • 已 review 完整 diff
  • 每个 commit 都带 DCO 签名(git commit -s,见 DCO
  • UI 改动已在「UI 变化」注明引用的设计规范章节(不涉及 UI 则跳过)
  • 未提交凭证、令牌或授权文件
  • 已补充必要文档
  • 已确认测试结果或说明未执行原因

@dashhuang
dashhuang requested a review from a team as a code owner August 16, 2026 09:14
@greptile-apps

greptile-apps Bot commented Aug 16, 2026

Copy link
Copy Markdown

Greptile Summary

本 PR 为 Pi 补齐 SuperGrok Grok 4.6 的运行时目录、别名和官方推理档位,并增加登录后的受限目录热刷新及失败回滚。

  • 将缺失的 Grok 4.6 作为 openai-responses catalog addition 写入 Pi 配置,并保持 ChatGPT/xAI 的 spec id 与 wire id 路由关系
  • 为 Grok 4.6 发布 low / medium / high / xhigh 档位,默认使用 high
  • 仅在端点、请求头和启动时环境兼容时热刷新 SuperGrok 目录,并通过 switch_session 触发重载
  • 为目录重载失败增加回滚、会话终止错误码及多语言提示

Confidence Score: 5/5

当前证据中没有仍需阻止合并的故障,PR 看起来可以安全合并。

没有发现仍然存在的阻塞性故障。

Important Files Changed

Filename Overview
packages/maker-core/src/agents/pi/index.ts 为运行中 Pi 会话增加受限的 xAI 目录刷新、switch_session 重载、失败回滚和未确认状态下的 fail-closed 终止。
apps/desktop/src/main/maker-host/pi-host.ts 生成 ChatGPT/xAI 模型别名、xAI 占位凭证、Grok 4.6 catalog addition,并校正官方推理能力。
apps/desktop/src/main/maker-host/active-catalog.ts 将 Grok 4.6 discovery 与官方推理梯子合并,同时保留其他 xAI 模型的账号 discovery 能力。
apps/desktop/src/main/maker-host/catalog-to-descriptors.ts 在 Pi descriptor 投影中保留 xAI Grok 4.6 的显式推理档位。
packages/model-providers/catalog/pi-model-catalog.json 将 Grok 4.6 标记为支持 reasoning effort,并补齐包含 xhigh 的 thinkingLevelMap。
tools/pi/xai-catalog-corrections.mjs 为目录同步提供 Grok 4.6 官方推理能力校正,防止后续同步覆盖 xhigh 和默认 high。

Sequence Diagram

sequenceDiagram
  participant UI as 模型选择器
  participant Host as PiAgent
  participant Catalog as Native Provider Resolver
  participant File as models.json
  participant Pi as Pi 进程
  UI->>Host: setModel(xai/grok-4.6)
  Host->>Catalog: 解析最新 SuperGrok provider
  Catalog-->>Host: xAI provider + 占位 env
  Host->>Host: 校验 endpoint/header/env 未变化
  Host->>File: 写入 Grok 4.6 catalog addition
  Host->>Pi: switch_session(sessionPath)
  alt 重载成功
    Pi-->>Host: success
    Host->>Pi: set_model(xai, grok-4.6)
  else 明确失败
    Pi-->>Host: "success=false"
    Host->>File: 恢复旧目录
    Host-->>UI: 切换失败
  else 结果未确认
    Pi--xHost: 超时或连接异常
    Host->>Pi: 终止会话
    Host-->>UI: PI_CATALOG_RELOAD_UNCONFIRMED
  end
Loading

Reviews (14): Last reviewed commit: "fix(pi): 钉回网关时不要按 xai/ 前缀热刷目录" | Re-trigger Greptile

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

Copy link
Copy Markdown

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: 8f6d4812d7

ℹ️ 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 packages/maker-core/src/agents/pi/index.ts Outdated

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

Copy link
Copy Markdown

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: 2a450c4ef2

ℹ️ 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 packages/maker-core/src/agents/pi/index.ts
Comment thread packages/maker-core/src/agents/pi/index.ts Outdated

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

Copy link
Copy Markdown

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: 8ddd2bc08f

ℹ️ 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 apps/desktop/src/main/maker-host/pi-host.ts Outdated

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

Copy link
Copy Markdown

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: 21721556b7

ℹ️ 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 packages/model-providers/catalog/providers.json
@MagicLizi MagicLizi added the touches:core 改动碰到架构核心路径(review-pr 自动维护,仅展示) label Aug 17, 2026

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

  • P1 packages/maker-core/src/agents/pi/index.ts:2552-2555 — 新增用户可见错误文案「已终止本会话」「重开会话」违反 docs/product-rules/task-and-conversation-naming.md §6.0.2 的 forbidden 译法(session 面向用户一律叫「任务」),且该错误无错误码:renderer 的 extractIpcError 只认 [CODE] 形态,落到主展示路径上只会弹泛化「切换失败」toast——「任务已终止、需重开」的可行动解释根本到不了用户眼前,这正是 §6.0.4「一句一句追展示路径」点名的漏判。建议:仿照同 handler 的 CREDENTIAL_SWITCH_BUSY 模式,抛带错误码的错误(如 [PI_CATALOG_RELOAD_UNCONFIRMED])并在 renderer 补五语 i18n;文案用「任务」口径(如「模型目录重载未确认,已终止本任务,请重新打开任务后再切换模型」)。

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

审查发现 1 个 P1:

P1 — packages/model-providers/src/tests/piCatalogCorrections.test.ts:6

新测试 import { applyKnownXaiCorrections, preferredDefaultEffort } from '../../../../tools/pi/xai-catalog-corrections.mjs' 引入的根目录工具没有类型声明,在 model-providers 自己的 tsconfig(strict)下 pnpm --filter @cindy/model-providers run build(tsc --noEmit)新增一个 TS7016(implicit any)。该命令此前已有 2 个存量错误(catalog.test.ts:684/686,与 main 逐字节一致),本 PR 让它变成 3 个。诚实口径:不破坏任何强制门禁(该 package 没有 typecheck script,提交门禁自动跳过,CI 只 typecheck desktop/mobile,typecheck-merged 只跑 desktop tsconfig,desktop typecheck 通过)——但你触碰的 package 比来时更不可编译,且之后修存量 2 错的人会踩到这颗新雷。

建议(便宜):给 tools/pi/xai-catalog-corrections.d.mts 补一份匹配声明;或把 corrections 表挪进 packages/model-providers/src/、由同步工具从那里读。

验证方式:pnpm --filter @cindy/model-providers run build 应只剩 catalog.test.ts:684/686 两条存量错误。

其余无 P0:live catalog 收紧的端点/header/env 相等守卫、switch_session 失败原子回滚、未确认 reload fail-closed、remote 路径拒绝启动后才加的 xAI 代理等全部核实通过;我实际跑过 desktop typecheck(pass)、piNativeProviders/activeCatalogDiscovery(65/1)、maker-core pi-provider-routing(47)、model-providers catalog+corrections(58)全部通过,DCO 通过。ghostInstallReceipt.test.ts 的 2 个失败与 main 一致、与本 diff 无关。

@MagicLizi

Copy link
Copy Markdown
Contributor

@dashhuang 👋 这个 PR 目前与 main 有合并冲突,auto-review 因此暂时跳过、没法继续审查 / 合并。

请在本地 merge 最新的 origin/main 解决冲突后推送;冲突解除后,下一轮 auto-review 会自动重新处理这个 PR。

@MagicLizi MagicLizi added status:awaiting-author 等作者修改(review-pr 自动维护,仅展示) touches:core 改动碰到架构核心路径(review-pr 自动维护,仅展示) and removed touches:core 改动碰到架构核心路径(review-pr 自动维护,仅展示) labels Aug 17, 2026
@MagicLizi
MagicLizi dismissed stale reviews from themself August 17, 2026 09:53

当前 head 已修复此前 CR 指出的问题(格式门/安全门已通过),自动 dismiss 以解除合并阻塞

@dashhuang
dashhuang force-pushed the dash/pi-live-model-catalog branch from e82d2e0 to d708d97 Compare August 18, 2026 01:28

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

Copy link
Copy Markdown

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: d708d9715e

ℹ️ 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 apps/desktop/src/main/maker-host/active-catalog.ts Outdated

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

Copy link
Copy Markdown

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: 4c8a9ecd49

ℹ️ 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 apps/desktop/src/main/maker-host/active-catalog.ts Outdated
@MagicLizi

Copy link
Copy Markdown
Contributor

@dashhuang 👋 这个 PR 还有 1 条 review conversation 没 resolve(apps/desktop/src/main/maker-host/active-catalog.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。

如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。

@MagicLizi

Copy link
Copy Markdown
Contributor

@dashhuang 👋 这个 PR 目前与 main 有合并冲突,auto-review 因此暂时跳过、没法继续审查 / 合并。

请在本地 merge 最新的 origin/main 解决冲突后推送;冲突解除后,下一轮 auto-review 会自动重新处理这个 PR。

@MagicLizi MagicLizi added status:conflict 与目标分支有冲突(review-pr 自动维护,仅展示) and removed status:awaiting-author 等作者修改(review-pr 自动维护,仅展示) labels Aug 18, 2026
@dashhuang
dashhuang force-pushed the dash/pi-live-model-catalog branch from 4c8a9ec to 77a118e Compare August 18, 2026 10:21

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

Copy link
Copy Markdown

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: 77a118e6b6

ℹ️ 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 apps/desktop/src/main/maker-host/pi-host.ts Outdated
Comment thread packages/maker-core/src/agents/pi/index.ts Outdated

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

Copy link
Copy Markdown

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: b1acd5bc63

ℹ️ 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 packages/maker-core/src/agents/pi/index.ts

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

Copy link
Copy Markdown

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: fa5cd15d65

ℹ️ 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 packages/maker-core/src/agents/pi/index.ts Outdated
@dashhuang

Copy link
Copy Markdown
Member Author

合并前不变量(第 10 轮后冻结)

本 PR 不再给 live catalog 热切加 RPC / precheck / 复水。人审可按下面核对:

  1. 只有启动时已预置身份的 xAI 可热刷。 live spec 带 hostProxyForward 但启动没有 proxySessionToken(或当前 xAI 块本来没有隧道)→ 拒绝,重开任务。
  2. 热刷 fail-closed: endpoint / headers / env(及 hostProxyForward 兼容性)必须与启动快照一致,否则不写盘。
  3. 只给探针证明缺席的 Grok 4.6 合成 catalogAddition + openai-responses 探针失败或 listedIds 缺其它 id,不把 grok-4.3 / grok-build-0.1 等改成 addition。
  4. 写盘后 switch_session success:false 回滚 models.json 与内存 map;reject / 超时 / 回滚写盘失败 → 终止任务(PI_CATALOG_RELOAD_UNCONFIRMED)。不再在写盘后再加 get_tree 等 RPC。
  5. Grok 4.6 官方梯子只有 low | medium | high | xhigh,默认 high,不合成 minimal inheritModels overlay / xhigh 不另开一套。其它 SuperGrok 模型保留 discovery 的档位和默认值。
  6. 历史分支 / 身份变化 / remote 热加代理: 已知限制,请重开任务。完整树复水或通用 BYOM 热刷新不在本 PR。

Claude/Codex 静态目录留给 #2601ghostInstallReceipt.test.ts 两条失败是 origin/main 基线,不进本 PR。

@MagicLizi MagicLizi added the status:ci-running CI 还在跑(review-pr 自动维护,仅展示) label Aug 18, 2026
@dashhuang
dashhuang force-pushed the dash/pi-live-model-catalog branch from afa3978 to ee20056 Compare August 18, 2026 12:20

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

Copy link
Copy Markdown

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: ee20056744

ℹ️ 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 apps/desktop/src/main/maker-host/pi-host.ts
@MagicLizi MagicLizi added status:threads-open 还有未 resolve 的评审讨论(review-pr 自动维护,仅展示) and removed status:ci-running CI 还在跑(review-pr 自动维护,仅展示) status:threads-open 还有未 resolve 的评审讨论(review-pr 自动维护,仅展示) labels Aug 18, 2026

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

Code review passed (heavy): SuperGrok hot-switch and catalog tightening are correct. All 10 rounds of prior bot-flagged bugs verified fixed. No malicious code or exfiltration patterns found.

Pi 0.83 自带 xAI 目录没有 grok-4.6。订阅 inheritModels 块此前既没有
占位 apiKey,也不会把缺失模型写成 catalog addition,set_model 会报
Model not found。补上 apiKey、xai/ 别名,并把未探测到的 grok-4.6
写成 openai-responses catalog addition。

热刷新只允许 SuperGrok 在占位 env / endpoint / header 未变时补模型;
switch_session 失败会回滚 maps 与 models.json。ChatGPT 别名改回指向
chatgpt/gpt-* spec id,避免回落到 cindy 网关。

Signed-off-by: Dash <dashhuang@gmail.com>
success:false 仍回滚 models.json。reject/超时无法判断 Pi 是否已加载新目录,
回滚和放行都会分叉,按未确认 set_model 一样关掉进程,要求用户重开任务。

Signed-off-by: Dash <dashhuang@gmail.com>
inheritModels 里没有 api/catalogAddition 的行是 Pi 自带目录,热切不应
走 live refresh。远端会话启动时若没有 session token / 代理登记,登录后
新出现的 hostProxyForward 会建隧道但鉴权失败,改为拒绝并要求重开任务。

Signed-off-by: Dash <dashhuang@gmail.com>
Pi and SuperGrok still advertised only low/medium/high because the bundled
Pi snapshot and inheritModels overlay never published xhigh. Keep Claude/Codex
static catalog out of this change so it does not collide with #2601.

Signed-off-by: Dash <dashhuang@gmail.com>
readPiBundledModels 超时返回 null 时,不能把 grok-4.3 / grok-build-0.1
默认改成 openai-responses。只在探针成功且明确缺 grok-4.6 时合成
addition,保留 xhigh 那条 official thinking overlay。

Signed-off-by: Dash <dashhuang@gmail.com>
官方梯子是 low/medium/high/xhigh。toDescriptor 给 Pi 自动前置 minimal,
但 thinkingLevelMap.minimal 是 null,setEffort 会失败。xAI grok-4.6
保留目录里的显式档位,不合成 minimal。inheritModels overlay 不动。

Signed-off-by: Dash <dashhuang@gmail.com>
与 origin/main 的 listed-models 缺席证明对齐,不再用 bundled 表推断
xAI addition。未确认 switch_session 抛 [PI_CATALOG_RELOAD_UNCONFIRMED],
用户文案改用「任务」。给 xai-catalog-corrections.mjs 补声明,消除
model-providers 新增的 TS7016。

Signed-off-by: Dash <dashhuang@gmail.com>
SuperGrok discovery 给 4.5 等其它模型报出的缩水档位不再被静态目录并回
low/medium/high/xhigh。4.6 仍用已知官方梯子补 xhigh。inheritModels overlay
不动。

Signed-off-by: Dash <dashhuang@gmail.com>
官方 high / xhigh 只作用于 Grok 4.6。其它模型若 discovery 给出且落在
其档位列表里的 defaultEffort,不再被 registry / 静态目录盖掉。

Signed-off-by: Dash <dashhuang@gmail.com>
listedIds 证明缺席时不再给任意 xAI 行打 catalogAddition。目录回滚先写盘再
改内存;写失败与未确认 switch_session 一样终止任务,避免磁盘/内存分叉。

Signed-off-by: Dash <dashhuang@gmail.com>
switch_session 只带 sessionPath,会丢 navigateTree 的非最新叶。本 PR
不引入分支/plan mode 复水;当前叶不是 JSONL 重载默认叶时回滚目录并
拒绝热切,要求重开任务。

Signed-off-by: Dash <dashhuang@gmail.com>
This reverts commit fa5cd15.

Signed-off-by: Dash <dashhuang@gmail.com>
@dashhuang
dashhuang force-pushed the dash/pi-live-model-catalog branch from ee20056 to c4efd6a Compare August 18, 2026 13:40

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

Copy link
Copy Markdown

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: c4efd6a99f

ℹ️ 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 apps/desktop/src/main/maker-host/active-catalog.ts

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

审查结果:P1×1

P1: switchModel — null 与 undefined 混淆导致 gateway-pin 请求误触 xAI 热加载路径

位置: packages/maker-core/src/agents/pi/index.ts:2763-2794

问题: 新增的 xAI hot-reload 触发器使用 ?? 判断 requestedProviderId

const sourceHint = requestedProviderId
  ?? (model.startsWith('xai/') ? 'xai' : undefined);

当调用方传入 requestedProviderId: null(代码中已明确注释为"固定走默认路由 cindy,绝不按模型自动挑 BYOM"语义,见 index.ts:1038-1044)且 model 以 xai/ 开头时,?? 不会短路(null 不被跳过),sourceHint 仍解析为 'xai',导致:

  1. 一个明确要求走网关的请求被误导入 xAI native catalog 刷新路径
  2. 执行不必要的 resolvePiNativeProviders() 异步探测 + 磁盘写入 + switch_session RPC
  3. 若刷新失败(如无 SuperGrok 登录)进入 restoreNativeCatalogOrTerminate(),磁盘回写再失败时调用 terminateUnconfirmedCatalogReload 终止会话 — 该请求本身与 xAI 完全无关

修复建议:requestedProviderId ?? 改为显式判断 requestedProviderId === undefined,使 null(gateway-pin)永远不触发 xAI reload 逻辑。


其余改动(effort 合并、catalog corrections、capability wiring、i18n)审查通过,无其他问题。安全扫描未发现凭证泄露或恶意代码。

switchModel 用 ?? 取 sourceHint,providerId=null(钉回 Cindy 网关)会落到模型名前缀回退,误进 SuperGrok live catalog 刷新;刷新失败还可能终止任务。只在未传 providerId 时才按 xai/ 推断。

Signed-off-by: Dash <dashhuang@gmail.com>
@dashhuang

Copy link
Copy Markdown
Member Author

已修 MagicLizi 的 P1:requestedProviderId: null(钉回网关)不再走 xai/ 前缀回退。

?? 会把 null 当成「没有来源」吃掉,误进 live catalog 刷新;刷新失败还可能终止任务。现在只有 undefined(旧任务未持久化来源)才按模型名推断。451415bdf

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

Copy link
Copy Markdown

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: 451415bdfe

ℹ️ 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 packages/maker-core/src/agents/pi/index.ts

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

✅ 自动审查通过(heavy tier + 安全扫描)

审查范围:SuperGrok Grok 4.6 热切 + live catalog 刷新收紧。

验证项:

  • 测试通过:pi-provider-routing (66/66), activeCatalogDiscovery/catalogDerivedModels/piNativeProviders (104/105), catalog.test + piCatalogCorrections (58/58)
  • typecheck clean
  • refreshLiveXaiCatalog fail-closed 设计验证:reload 成功/拒绝+回滚/回滚失败→terminate/RPC 超时→terminate 四分支均有测试
  • 安全检查:无凭证泄露、无 eval/外发路径、env var 符合 spawn-env-stability 不变量

P2(不阻断):

  1. isOfficialGrok46Id 在 3 个文件中重复硬编码,建议后续统一
  2. refreshLiveXaiCatalog 的 memory-then-disk 写入顺序与同文件 disk-first 惯例不一致(当前有自愈兜底,不影响正确性)

@MagicLizi
MagicLizi merged commit cbaf296 into main Aug 18, 2026
25 of 27 checks passed
@MagicLizi
MagicLizi deleted the dash/pi-live-model-catalog branch August 18, 2026 16:39
@MagicLizi

Copy link
Copy Markdown
Contributor

合并了 🎉 SuperGrok 热切的 fail-closed 四分支设计很扎实——reload/rollback/terminate 的边界划得干净利落,用 switch_session 做 parent/child 状态同步是个聪明的选择。

@MagicLizi MagicLizi removed the touches:core 改动碰到架构核心路径(review-pr 自动维护,仅展示) label Aug 18, 2026
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