Skip to content
This repository was archived by the owner on Aug 11, 2026. It is now read-only.

fix(model-access): 对齐 Provider 上报元数据契约 - #38

Open
horizon554 wants to merge 5 commits into
makecindy:mainfrom
horizon554:fix/provider-reported-resolve-fields
Open

fix(model-access): 对齐 Provider 上报元数据契约#38
horizon554 wants to merge 5 commits into
makecindy:mainfrom
horizon554:fix/provider-reported-resolve-fields

Conversation

@horizon554

Copy link
Copy Markdown
Contributor

动机 / Motivation

服务端 resolve 已按字段消费 Provider 官方端点返回的名称、描述、分组、effort、成本和生命周期等事实,但共享 ProviderReportedModel 与严格 parser 仍只声明旧的六个字段,导致正式客户端无法表达服务端已经支持的输入。

关联:xindong/cindy-server#331 的 review thread PRRT_kwDOTTBY3M6WwLu2。

变更类型 / Change type

  • 协议变更(类型/字段/信封/路由语义/常量) / Protocol change
  • 文档 / Docs
  • 测试 / Tests

兼容性影响 / Compatibility impact

保持 schema v2,不删除或改名现有字段,只新增可选 Provider facts。现有客户端仍只发送旧字段子集,因此对旧服务端没有即时行为变化;新字段必须按“协议与服务端先就绪、客户端后开始上报”的顺序启用。由于 v2 固定对象 parser 严格拒绝未知字段,尚未升级的 v2 对端在未来收到新增字段时会拒收整批并保留上一份有效快照。

「三件套」自查 / The trio

  • 类型定义 / Type definitions
  • parse 运行时校验(错误信息带字段路径) / Runtime parse validation
  • 测试(round-trip + 坏帧拒收) / Tests
  • 文档 / Docs

检查项 / Checklist

  • 遵循 CONTRIBUTING 的协议演进纪律
  • commit message 符合规范
  • 一个 PR 只做一个逻辑变更
  • fixture 使用中性占位值
  • pnpm test 与 pnpm typecheck 通过

验证 / Verification

  • pnpm test(220 passed)
  • pnpm typecheck
  • pnpm format:check
  • git diff --check

Signed-off-by: JiangJiahao <jiangjiahao@xd.com>
@horizon554
horizon554 requested a review from zqchris as a code owner August 5, 2026 18:47
@greptile-apps

greptile-apps Bot commented Aug 5, 2026

Copy link
Copy Markdown

Greptile Summary

此 PR 扩展 ProviderReportedModel,使共享类型与严格 parser 能表达服务端已支持的 Provider 官方元数据,同时补齐归一化、文档和坏帧测试。

  • 新增名称、描述、分组、effort、成本、生命周期等可选 Provider facts
  • 严格校验新增字段,并移除空白可选文本
  • 要求同时上报时 defaultEffort 必须属于 efforts
  • 更新协议示例及 round-trip、异常输入测试

Confidence Score: 5/5

当前修复完整解决了此前的 effort 默认值一致性问题,PR 看起来可以安全合并。

当前代码在 efforts 与非空 defaultEffort 同时存在时校验成员关系,同时按已说明的合并语义允许仅上报 defaultEffort;未发现仍然存在的阻塞故障。

Important Files Changed

Filename Overview
packages/model-access-protocol/src/parse.ts 扩展 Provider 元数据的严格校验和空白文本归一化,并完整修复此前指出的 defaultEffort 成员关系问题。
packages/model-access-protocol/src/types.ts 以可选字段方式扩展 ProviderReportedModel,保持现有 v2 字段兼容。
packages/model-access-protocol/src/tests/protocol.test.ts 覆盖扩展字段 round-trip、异常值拒收、空白文本归一化及 effort 列表不一致场景。
docs/model-access-protocol.md 更新 resolve request 示例和新增 Provider facts 的语义、归一化及排序约定。

Reviews (5): Last reviewed commit: "fix(model-access): normalize blank provi..." | Re-trigger Greptile

Comment thread packages/model-access-protocol/src/parse.ts
Signed-off-by: JiangJiahao <jiangjiahao@xd.com>

@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: 9d7d1320f1

ℹ️ 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-access-protocol/src/parse.ts
Comment thread packages/model-access-protocol/src/parse.ts Outdated
Comment thread packages/model-access-protocol/src/parse.ts Outdated
Signed-off-by: JiangJiahao <jiangjiahao@xd.com>
@horizon554

Copy link
Copy Markdown
Contributor Author

@codex review

@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: d76d87a8e5

ℹ️ 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-access-protocol/src/parse.ts Outdated
Signed-off-by: JiangJiahao <jiangjiahao@xd.com>
@horizon554

Copy link
Copy Markdown
Contributor Author

@codex review

@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: bd617bded1

ℹ️ 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-access-protocol/src/parse.ts Outdated
Signed-off-by: JiangJiahao <jiangjiahao@xd.com>
@horizon554

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: ae6ec6a8d5

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant