Skip to content

Feat/add aitable datasource tools - #1069

Open
WHUTzju wants to merge 31 commits into
DingTalk-Real-AI:mainfrom
WHUTzju:feat/add-aitable-datasource-tools
Open

Feat/add aitable datasource tools#1069
WHUTzju wants to merge 31 commits into
DingTalk-Real-AI:mainfrom
WHUTzju:feat/add-aitable-datasource-tools

Conversation

@WHUTzju

@WHUTzju WHUTzju commented Aug 20, 2026

Copy link
Copy Markdown

Summary

  • Adds 7 new shortcuts to the aitable service for datasource sync management: +datasource-create, +datasource-update, +datasource-sync, +datasource-sync-status, +datasource-get-config, +datasource-list-sources, +datasource-get-fields
  • Each shortcut maps 1:1 to a deployed MCP tool on the aitable server
  • Updates dingtalk-aitable SKILL.md with routing rules and shortcut table entries for all 7 commands
  • Adds skills/multi/dingtalk-aitable/references/aitable/aitable-datasource.md reference guide covering typical workflows, sourceConfig protocol, autoSyncSetting frequency config, and known limitations
  • Fixes sourceConfig handling: CLI validates JSON but passes raw string to MCP (MCP types it as string, not object)

Risk tier

  • Standard: ordinary implementation change with a stable package graph

Verification

  • Release fragment added: .changes/aitable-datasource-shortcuts.md
  • ./scripts/policy/check-generated-drift.sh — no drift
  • ./scripts/policy/check-command-surface.sh --strict — command surface updated correctly
  • All 7 MCP tools confirmed deployed on live endpoint
  • End-to-end OA approval datasource creation flow verified against live MCP server

Notes

  • +datasource-sync-status known limitation: downstream queryTaskStatus currently returns status=0 (RUNNING) for all tasks; FINISHED/FAILED not reliably available. Users should verify via documentUrl instead.
  • splitParentTableField and enableDataSyncOaDetailList are downstream-internal fields, intentionally not exposed in CLI flags
  • Only OA approval datasource (datasourceType=OA) is supported; other types reserved for future expansion

Agent 测试报告截图(aitable)

开始执行AI表格数据源指令

image #### 列举可用数据源 002 #### 创建、更新、查询、触发数据源 ,查询数据源字段、状态、 003 #### Agent测试结论 004

指令 CI 集成测试(aitable)

image

@github-actions
github-actions Bot requested a review from haofeng0705 August 20, 2026 06:57
@github-actions
github-actions Bot enabled auto-merge August 20, 2026 06:57
auto-merge was automatically disabled August 20, 2026 07:03

Head branch was pushed to by a user without write access

@github-actions
github-actions Bot enabled auto-merge August 20, 2026 07:03
auto-merge was automatically disabled August 20, 2026 07:08

Head branch was pushed to by a user without write access

@github-actions
github-actions Bot enabled auto-merge August 20, 2026 07:08
auto-merge was automatically disabled August 20, 2026 07:44

Head branch was pushed to by a user without write access

@github-actions
github-actions Bot requested a review from wxianfeng August 20, 2026 07:45
@github-actions
github-actions Bot enabled auto-merge August 20, 2026 07:45
@wxianfeng

Copy link
Copy Markdown
Collaborator

开源 DWS Codex 自动 CR:不通过,CI 未通过

Feat/add aitable datasource tools

  • 评审 SHA:a0fc7bafafcd092efe6324babc49c73093f964d0
  • CI 状态:未通过(26 通过,4 跳过,5 未通过)
  • 冲突状态:无冲突
  • Agent 测试报告:不通过,缺少“Agent 测试报告”截图(aitable)
  • 指令 CI 集成测试:不通过,缺少“指令 CI 集成测试”截图(aitable)
  • 自动 CR 结论:不通过,CI 未通过
  • 代码评审结论:通过

变更总结

本次变更新增 7 个 AI 表格数据源原始命令及对应 Shortcut,并补充 Schema 身份、安全元数据、语义目录和使用文档;命令到 MCP 参数的主要映射保持一致,未发现阻塞合并的安全或数据损失问题。静态审查发现两处文档与实际 CLI/契约不一致,会导致用户照文档操作失败,建议修正;受安全限制未执行测试或构建。

CI 单测结果

结论说明

自动 CR 不通过,原因如下:

  • CI 单测存在失败、取消或超时
  • PR 描述或发起人评论缺少 aitable Agent 测试截图
  • PR 描述或发起人评论缺少 aitable 指令 CI 集成测试截图

代码问题

  1. [P2 | 建议修改] 移除未实现的 --conflict-strategy 参数说明docs/datasource-usage-guide.md:132

    • 说明:指南把 --conflict-strategy 列为 +datasource-create 的可用参数,并在后文描述其覆盖/跳过语义,但新增的 DatasourceCreate.Flags 中没有这个 flag,执行任何照此编写的命令都会被 Cobra 以 unknown flag 拒绝。请删除这些说明,或在 Shortcut 中真正声明、映射并验证该参数。
  2. [P2 | 建议修改] 按真实嵌套结构解析 list-sources 的 resultdocs/datasource-usage-guide.md:49

    • 说明:这里宣称每个 source 的 result 就是 processCode,后面的完整工作流也直接使用 sources[0].result=PROC-XXXX;但同一 PR 的 Shortcut 契约和专用 reference 均说明 result 是包含 approvals 数组的 JSON 字符串,processCode/name/iconUrl/url 位于选中的 approval 内。照当前指南会把整段 JSON 当作 processCode,或遗漏 name 等必填透传字段,导致 get-fields/create 请求失败。请统一为解析 result、选择唯一 approval 后提取四个字段的流程。

自动 CR 结论为不通过;未提交 GitHub Review,也不会自动合并。

auto-merge was automatically disabled August 20, 2026 09:12

Head branch was pushed to by a user without write access

@github-actions
github-actions Bot enabled auto-merge August 20, 2026 09:12

@wxianfeng wxianfeng left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

开源 DWS Codex 自动 CR:不通过,需修复

Feat/add aitable datasource tools

  • 评审 SHA:d24f4be447de0ae4876fd5345ca83c68c68b5a0c
  • CI 状态:未通过(29 通过,4 跳过,2 未通过)
  • 冲突状态:无冲突
  • Agent 测试报告:不通过,缺少“Agent 测试报告”截图(aitable)
  • 指令 CI 集成测试:不通过,缺少“指令 CI 集成测试”截图(aitable)
  • 自动 CR 结论:不通过,需修复
  • 代码评审结论:不通过,需修复

变更总结

本次变更新增了 7 个 AITable 数据源直连命令和对应 Shortcut,并补充 Schema、语义目录及使用文档。命令注册和基本参数映射整体一致,但批量上限未在运行时落实,且 Reference 中存在互相冲突的枚举值和未实现的参数,会让 Agent 生成无效调用;建议修复后再合并。受审查约束未执行测试或构建。

CI 单测结果

结论说明

Codex 静态审查发现 P0/P1 阻断问题,需要修复后提交新 commit 重新 CR。

代码问题

  1. [P1 | 必须修改] 批量同步未落实声明的 1–5 个数量限制internal/shortcut/aitable/datasource.go:281

    • 说明:契约、帮助和 Reference 都声明 table-ids 单次只能传 1–5 个,但这里直接将任意长度的切片发送给 run_datasource_sync+datasource-sync 因而会接受 6 个以上 ID;新增的非 Shortcut aitable datasource sync 也只检查非空而没有检查上限。这样 Agent 按契约验证后仍可能发出服务端必然拒绝的写请求,而且没有执行文档要求的拆批。请在两个入口调用 MCP 前统一校验 1–5 个,并为边界值和超限拒绝补测试;task-ids 的最多 5 个限制也应同样落实。
  2. [P2 | 建议修改] 自动同步配置文档发布了两套互斥枚举skills/multi/dingtalk-aitable/references/aitable/aitable-datasource.md:98

    • 说明:该 Reference 将 syncType/scheduleType 写成 scheduleday|week|month,并给出可复制示例;同一 PR 的 Shortcut 参数契约却声明 scheduleddaily|weekly|monthly。由于实现只校验 JSON 形状并原样透传,至少其中一套会导致创建或更新失败。请以真实接口契约为准统一 Reference、Flag 描述和示例,并考虑在 CLI 侧校验这些枚举。
  3. [P2 | 建议修改] Reference 声明了命令并不接受的 conflict-strategy 参数skills/multi/dingtalk-aitable/references/aitable/aitable-datasource.md:177

    • 说明:创建命令的参数表公开了 --conflict-strategy,但 DatasourceCreate.Flags 和新增的 aitable datasource create 都没有注册或转发这个参数。Agent 按 Reference 使用时会在 Cobra 参数解析阶段直接失败。请删除该说明,或在两个公开入口及其 Contract/MCP 映射中完整实现该参数。

此结论已作为 GitHub CHANGES_REQUESTED 提交;不会自动合并。

@wxianfeng

Copy link
Copy Markdown
Collaborator

开源 DWS Codex 自动 CR:不通过,需修复

Feat/add aitable datasource tools

  • 评审 SHA:d24f4be447de0ae4876fd5345ca83c68c68b5a0c
  • CI 状态:未通过(29 通过,4 跳过,2 未通过)
  • 冲突状态:无冲突
  • Agent 测试报告:不通过,缺少“Agent 测试报告”截图(aitable)
  • 指令 CI 集成测试:不通过,缺少“指令 CI 集成测试”截图(aitable)
  • 自动 CR 结论:不通过,需修复
  • 代码评审结论:不通过,需修复

变更总结

本次变更新增了 7 个 AITable 数据源直连命令和对应 Shortcut,并补充 Schema、语义目录及使用文档。命令注册和基本参数映射整体一致,但批量上限未在运行时落实,且 Reference 中存在互相冲突的枚举值和未实现的参数,会让 Agent 生成无效调用;建议修复后再合并。受审查约束未执行测试或构建。

CI 单测结果

结论说明

Codex 静态审查发现 P0/P1 阻断问题,需要修复后提交新 commit 重新 CR。

代码问题

  1. [P1 | 必须修改] 批量同步未落实声明的 1–5 个数量限制internal/shortcut/aitable/datasource.go:281

    • 说明:契约、帮助和 Reference 都声明 table-ids 单次只能传 1–5 个,但这里直接将任意长度的切片发送给 run_datasource_sync+datasource-sync 因而会接受 6 个以上 ID;新增的非 Shortcut aitable datasource sync 也只检查非空而没有检查上限。这样 Agent 按契约验证后仍可能发出服务端必然拒绝的写请求,而且没有执行文档要求的拆批。请在两个入口调用 MCP 前统一校验 1–5 个,并为边界值和超限拒绝补测试;task-ids 的最多 5 个限制也应同样落实。
  2. [P2 | 建议修改] 自动同步配置文档发布了两套互斥枚举skills/multi/dingtalk-aitable/references/aitable/aitable-datasource.md:98

    • 说明:该 Reference 将 syncType/scheduleType 写成 scheduleday|week|month,并给出可复制示例;同一 PR 的 Shortcut 参数契约却声明 scheduleddaily|weekly|monthly。由于实现只校验 JSON 形状并原样透传,至少其中一套会导致创建或更新失败。请以真实接口契约为准统一 Reference、Flag 描述和示例,并考虑在 CLI 侧校验这些枚举。
  3. [P2 | 建议修改] Reference 声明了命令并不接受的 conflict-strategy 参数skills/multi/dingtalk-aitable/references/aitable/aitable-datasource.md:177

    • 说明:创建命令的参数表公开了 --conflict-strategy,但 DatasourceCreate.Flags 和新增的 aitable datasource create 都没有注册或转发这个参数。Agent 按 Reference 使用时会在 Cobra 参数解析阶段直接失败。请删除该说明,或在两个公开入口及其 Contract/MCP 映射中完整实现该参数。

此结论已作为 GitHub CHANGES_REQUESTED 提交;不会自动合并。

auto-merge was automatically disabled August 20, 2026 09:59

Head branch was pushed to by a user without write access

@github-actions
github-actions Bot requested a review from wxianfeng August 20, 2026 10:00
@github-actions
github-actions Bot enabled auto-merge August 20, 2026 10:00
auto-merge was automatically disabled August 20, 2026 10:10

Head branch was pushed to by a user without write access

@github-actions
github-actions Bot enabled auto-merge August 20, 2026 10:12
auto-merge was automatically disabled August 20, 2026 10:19

Head branch was pushed to by a user without write access

@github-actions
github-actions Bot enabled auto-merge August 20, 2026 10:20

@wxianfeng wxianfeng left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

开源 DWS Codex 自动 CR:不通过,需修复

Feat/add aitable datasource tools

  • 评审 SHA:af5419dbc2b2a6a75e01384c9a6b300dca7350af
  • CI 状态:未通过(29 通过,4 跳过,2 未通过)
  • 冲突状态:无冲突
  • Agent 测试报告:不通过,缺少“Agent 测试报告”截图(aitable)
  • 指令 CI 集成测试:不通过,缺少“指令 CI 集成测试”截图(aitable)
  • 自动 CR 结论:不通过,需修复
  • 代码评审结论:不通过,需修复

变更总结

本次变更新增 7 个 AI 表格数据源快捷命令及对应的底层 CLI 入口、Schema 声明、测试和使用文档。命令到 MCP 参数的基本映射及 1–5 个 ID 的边界检查总体一致,但创建命令发布的可复制示例缺少其自身契约标明的必填字段,会让标准接入流程直接失败;此外两份文档对数据源返回结构和自动同步枚举存在互相冲突的说明。未执行测试或仓库代码,结论仅来自静态检查。

CI 单测结果

结论说明

Codex 静态审查发现 P0/P1 阻断问题,需要修复后提交新 commit 重新 CR。

代码问题

  1. [P1 | 必须修改] 创建数据源的公开示例遗漏必填的 name 字段internal/shortcut/aitable/datasource.go:69

    • 说明:该命令对 source-config 的参数契约明确说明 processCodenameiconUrlurl 都必须从 list-sources 原样透传,但这里发布到 Schema 的两个可复制示例均没有 name;新使用指南中的主要创建示例也同样遗漏,并把 name 标成可选。按照本 PR 自己的错误排查说明,缺少这些字段会导致创建失败,因此 Agent 或用户照标准示例执行完整接入流程时无法成功。请在所有 create/get-fields/update 示例中加入选定来源的 name,并把指南中的必填性改为与命令契约一致;最好增加覆盖最终发布示例所含 sourceConfig 必填成员的契约测试。
  2. [P2 | 建议修改] 两份数据源指南对返回结构和调度枚举给出了不兼容协议docs/datasource-usage-guide.md:54

    • 说明:通用指南把 list-sourcesresult 直接描述为 processCode,而新增 Skill reference 及命令契约说明它是需要再次解析、内含 approvals 数组的 JSON 字符串;同一 reference 又把自动同步写成 syncType=schedulescheduleType=day/week/month,但快捷命令参数契约声明的是 scheduleddaily/weekly/monthly。Agent 按不同入口加载文档会构造完全不同的 sourceConfig 或 autoSyncSetting,其中至少一套会被下游拒绝。请以实际 MCP 协议为准统一两份文档、Flag 描述和示例,并用参数映射测试固定这些枚举及嵌套解析约定。

此结论已作为 GitHub CHANGES_REQUESTED 提交;不会自动合并。

@wxianfeng

Copy link
Copy Markdown
Collaborator

开源 DWS Codex 自动 CR:不通过,需修复

Feat/add aitable datasource tools

  • 评审 SHA:af5419dbc2b2a6a75e01384c9a6b300dca7350af
  • CI 状态:未通过(29 通过,4 跳过,2 未通过)
  • 冲突状态:无冲突
  • Agent 测试报告:不通过,缺少“Agent 测试报告”截图(aitable)
  • 指令 CI 集成测试:不通过,缺少“指令 CI 集成测试”截图(aitable)
  • 自动 CR 结论:不通过,需修复
  • 代码评审结论:不通过,需修复

变更总结

本次变更新增 7 个 AI 表格数据源快捷命令及对应的底层 CLI 入口、Schema 声明、测试和使用文档。命令到 MCP 参数的基本映射及 1–5 个 ID 的边界检查总体一致,但创建命令发布的可复制示例缺少其自身契约标明的必填字段,会让标准接入流程直接失败;此外两份文档对数据源返回结构和自动同步枚举存在互相冲突的说明。未执行测试或仓库代码,结论仅来自静态检查。

CI 单测结果

结论说明

Codex 静态审查发现 P0/P1 阻断问题,需要修复后提交新 commit 重新 CR。

代码问题

  1. [P1 | 必须修改] 创建数据源的公开示例遗漏必填的 name 字段internal/shortcut/aitable/datasource.go:69

    • 说明:该命令对 source-config 的参数契约明确说明 processCodenameiconUrlurl 都必须从 list-sources 原样透传,但这里发布到 Schema 的两个可复制示例均没有 name;新使用指南中的主要创建示例也同样遗漏,并把 name 标成可选。按照本 PR 自己的错误排查说明,缺少这些字段会导致创建失败,因此 Agent 或用户照标准示例执行完整接入流程时无法成功。请在所有 create/get-fields/update 示例中加入选定来源的 name,并把指南中的必填性改为与命令契约一致;最好增加覆盖最终发布示例所含 sourceConfig 必填成员的契约测试。
  2. [P2 | 建议修改] 两份数据源指南对返回结构和调度枚举给出了不兼容协议docs/datasource-usage-guide.md:54

    • 说明:通用指南把 list-sourcesresult 直接描述为 processCode,而新增 Skill reference 及命令契约说明它是需要再次解析、内含 approvals 数组的 JSON 字符串;同一 reference 又把自动同步写成 syncType=schedulescheduleType=day/week/month,但快捷命令参数契约声明的是 scheduleddaily/weekly/monthly。Agent 按不同入口加载文档会构造完全不同的 sourceConfig 或 autoSyncSetting,其中至少一套会被下游拒绝。请以实际 MCP 协议为准统一两份文档、Flag 描述和示例,并用参数映射测试固定这些枚举及嵌套解析约定。

此结论已作为 GitHub CHANGES_REQUESTED 提交;不会自动合并。

auto-merge was automatically disabled August 20, 2026 12:37

Head branch was pushed to by a user without write access

@github-actions
github-actions Bot requested a review from wxianfeng August 20, 2026 12:37
@github-actions
github-actions Bot enabled auto-merge August 20, 2026 12:37
@WHUTzju

WHUTzju commented Aug 20, 2026

Copy link
Copy Markdown
Author

测试截图
image

auto-merge was automatically disabled August 20, 2026 12:48

Head branch was pushed to by a user without write access

@github-actions
github-actions Bot enabled auto-merge August 20, 2026 12:49
@wxianfeng

wxianfeng commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

开源 DWS Codex 自动 CR:不通过,CI 未通过

Feat/add aitable datasource tools

  • 评审 SHA:f632d100dd679aecb08540da1b6d884dd14dec71
  • CI 状态:未通过(27 通过,4 跳过,4 未通过)
  • 冲突状态:无冲突
  • Agent 测试报告:不通过,缺少“Agent 测试报告”截图(aitable)
  • 指令 CI 集成测试:不通过,缺少“指令 CI 集成测试”截图(aitable)
  • 自动 CR 结论:不通过,CI 未通过
  • 代码评审结论:通过

变更总结

本次变更新增了两套 AI 表格数据源命令入口及相应契约、测试和使用文档。快捷命令的参数转发、JSON 对象校验和批量上限处理基本一致;但新增长命令的能力声明与实际参数面不一致,且文档对自动同步频率支持存在自相矛盾,建议合入前修正。未执行测试或构建,仅完成静态审查。

CI 单测结果

结论说明

自动 CR 不通过,原因如下:

  • CI 单测存在失败、取消或超时
  • PR 描述或发起人评论缺少 aitable Agent 测试截图
  • PR 描述或发起人评论缺少 aitable 指令 CI 集成测试截图

代码问题

  1. [P2 | 建议修改] 长命令宣称支持调整同步字段,但没有暴露对应参数internal/helpers/aitable.go:8260

    • 说明:aitable datasource create/update 的选择契约将“调整字段”列为适用场景,但这两个命令只注册了 source-configauto,没有快捷命令已有的 field-idsauto-sync-setting,执行体也不会向 MCP 传递 fieldIdsautoSyncSetting。因此 Agent 可能依据已发布的 use_when 选择该入口,却无法完成调整同步字段或频率的请求;同一 PR 中的 +datasource-* 入口又支持这些能力,形成两套不一致的公开契约。应补齐长命令的参数声明、校验、转发和测试,或收窄其选择描述并明确引导到快捷命令。
  2. [P2 | 建议修改] 使用指南同时声称支持和不支持自定义同步频率docs/datasource-usage-guide.md:457

    • 说明:前文为 create/update 发布了 --auto-sync-setting,并详细说明其格式,但注意事项第 7 条又称“CLI 暂不支持自定义频率”。这会让用户无法判断该参数是否可用,并可能放弃已经实现的配置能力。应统一文档结论;若仅快捷入口支持,也应明确限定具体命令入口。

自动 CR 结论为不通过;未提交 GitHub Review,也不会自动合并。

陌渊 added 25 commits August 21, 2026 16:09
- Golden Route: add datasource entry (list-sources → create flow)
- 常用 leaf 直达: add datasource-* commands
- 当前最短路径: add list-sources-first rule
- 安全边界: add sync write warning
- 错误最短路径: add errorCode=4014 and sync=false handling
- 按需加载: add datasource reference trigger
- New reference: aitable-datasource.md with full workflow, sourceConfig
  protocol, autoSyncSetting config, command details, error codes
- Fix autoSyncSetting enum: scheduled/daily/weekly/monthly; mark
  selectedMonthDays/selectedWeekdays as required for monthly/weekly
- Remove splitParentTableField from --source-config user-settable fields;
  add note that splitParentTableField/enableDataSyncOaDetailList are
  internal downstream fields not to be passed
- Prepend sync-is-fire-and-forget notice to DatasourceSync descriptions
- Remove --conflict-strategy flag (syncConflictStrategy not in MCP schema)
- Add 7 datasource leaf commands to internal/helpers/aitable.go so
  coverage test can find tool name literals (fixes TestAllShortcutsAssemble)
- Add 7 entries to semantic_catalog_aitable.json and update catalog count
  from 93 to 100 (fixes TestCrossPlatformCoverageAITableSemanticCatalog)
- Update publicShortcutCount/schemaPublishedShortcutCount/publiclyDelivered
  from 422/447/422 to 429/454/429 (fixes TestDeliverySchemaCoversOrExactly)
- Fix Contract.Selection.AgentSummary and UseWhen[0] in datasource.go to
  match Description and Intent exactly as required by schema contract test
ValidateRequiredFlags calls GetString which returns empty for
StringSlice flags, causing the examples test to report --table-ids
as missing. Switch to String + parseCSVValues to match the codebase
convention used by record-ids and other comma-separated flags.
Both the shortcut (+datasource-sync, +datasource-sync-status) and
helper (datasource sync, datasource sync-status) layers now validate
that table-ids contains 1-5 IDs and task-ids contains at most 5 IDs
before calling MCP, matching the declared contract.
…rage

21 tests covering all 7 datasource leaf commands' error paths (missing
required flags, count validation) and happy paths (source-config as raw
string, --auto flag, boundary cases for table-ids/task-ids).
The OA approval source-config contract requires processCode, name,
iconUrl, and url to be passed through unchanged from +datasource-list-sources.
Published examples for +datasource-create, +datasource-update, and
+datasource-get-fields were missing `name`, and the usage guide marked it
as optional. Fix all examples in the shortcut layer, helper layer, and
docs; update flag descriptions to mention name; and add a contract test
that validates every delivered example's source-config JSON contains the
required members.
- docs/datasource-usage-guide.md: clarify that list-sources result is a
  JSON string containing approvals[]; add missing --auto-sync-setting
  parameter table rows and a dedicated autoSyncSetting format section
  using the correct scheduled/daily/weekly/monthly enums.
- skills/references/aitable/aitable-datasource.md: fix autoSyncSetting
  enums (schedule/day/week/month -> scheduled/daily/weekly/monthly) and
  update the create example accordingly.
MCP requires the auto field in create_datasource / update_datasource_config
requests. Previously CLI only sent it when --auto was explicitly changed,
causing failures when users omitted the flag. Now both shortcut and helper
layers always include auto=false by default.

Also update flag descriptions and docs to clarify that the field is always
sent downstream, and add test assertions for the default-false behavior.
Omitting --auto on +datasource-update previously sent auto=false to
MCP, silently disabling auto-sync for existing datasources. Now auto
is only included in tool args when the flag is explicitly provided,
so --auto=true and --auto=false work while omission preserves the
existing setting. Updated flag descriptions and added tests.
+datasource-update now requires at least one mutable option
(--source-config, --auto, --field-ids, or --auto-sync-setting)
before calling update_datasource_config, preventing accidental
sync triggers. The native datasource update command enforces the
same guard for its supported flags. Also adds the required name
field to the +datasource-get-fields doc example.
…eate/update

Native datasource create/update now expose --field-ids and
--auto-sync-setting, matching the shortcut-layer capabilities:
- flags registered on both commands
- Contract Parameters updated
- values mapped to MCP tool args
- JSON validation for --auto-sync-setting
- no-change update guard now counts the new flags

Also fixes the missing required name in the usage-guide update example.
Make +datasource-sync-status consistent across shortcut and native
commands: --task-ids is now required, descriptions focus on querying
by taskId, and optional/IDLE semantics are removed. Update tests,
usage guide, reference doc, and SKILL description accordingly.
…tcut layer

Align shortcut layer validation with helper layer to prevent empty slices
from being sent to MCP, which could clear sync field selection due to
datasource update's overwrite semantics.

- Add empty string checks for --field-ids in both create and update shortcuts
- Add empty string checks for --auto-sync-setting in both create and update shortcuts
- Add regression tests verifying MCP is not called when empty values are rejected
- Both public entry points now have consistent validation behavior

Fixes P1 auto-CR issue for empty flag bypass vulnerability.
…ge gate

- Update --field-ids description in create/update shortcuts and the
  helper-layer datasource update to clarify that omitting the flag
  keeps existing config (create defaults to all fields), matching the
  actual update overwrite semantics.
- Rename datasource shortcut coverage tests to the
  TestCrossPlatformCoverage* prefix so they are picked up by the
  macOS platform coverage gate.
--field-ids is declared as FlagStringSlice, but DatasourceCreate and
DatasourceUpdate previously called rt.Str to check whether the flag
was empty. RuntimeContext.Str delegates to cobra's GetString, which
returns an empty string on slice-typed flags, so the empty-value
guard rejected every explicit --field-ids input and the downstream
MCP tool never received fieldIds.

Switch to rt.StrSlice, sanitize through a new trimNonEmpty helper
(drop whitespace-only / empty entries) and pass the cleaned slice
to MCP. Add success-passthrough tests for both create and update,
plus a whitespace-only rejection case, and enhance the mock caller
to record MCP arguments so fieldIds can be asserted.
…sCode docs

- Add trimNonEmpty for --table-ids in +datasource-sync and --task-ids in
  +datasource-sync-status, matching the existing field-ids pattern
- Add 4 test cases: whitespace-only rejection and trim-through for both
- Fix usage guide: typical workflow and notes no longer equate result
  with processCode; correctly describe result as JSON to parse for
  approvals[].processCode/name/iconUrl/url
auto-merge was automatically disabled August 21, 2026 08:20

Head branch was pushed to by a user without write access

@WHUTzju
WHUTzju force-pushed the feat/add-aitable-datasource-tools branch from 9f631f4 to c7510cd Compare August 21, 2026 08:20
@github-actions
github-actions Bot enabled auto-merge August 21, 2026 08:21

@wxianfeng wxianfeng left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

开源 DWS Codex 自动 CR:通过

Feat/add aitable datasource tools

  • 评审 SHA:c7510cd1a10fd213a16f77211ccdec8c32dbb96c
  • CI 状态:通过(34 通过,4 跳过)
  • 冲突状态:无冲突
  • Agent 测试报告:已通过(aitable,来源:PR 评论)
  • 指令 CI 集成测试:已通过(aitable,来源:PR 描述)
  • 自动 CR 结论:通过
  • 代码评审结论:通过

变更总结

本次变更新增了 7 个 AI 表格数据源原生命令及对应快捷命令,并补充 Schema 契约、语义目录、测试和使用文档。整体路由、参数映射和读写风险声明保持一致,未发现阻塞合并的安全问题;但原生命令对空字段列表的校验弱于快捷命令,且更新命令文档对省略字段列表的语义描述错误,建议修复后交付。受审查边界限制,未执行测试或构建。

CI 单测结果

结论说明

Codex 静态审查未发现 P0/P1 阻断问题;CI 单测已全部结束且通过,冲突和所需测试截图门禁均已满足。

代码问题

  1. [P2 | 建议修改] 原生命令会把仅含空白的字段列表作为空数组发送internal/helpers/aitable.go:8585

    • 说明:datasource create 仅用原始字符串是否为空判断 --field-idsdatasource update 也只拒绝字面空串;因此 --field-ids ' , 'parseCSVValues 后仍可能以空数组调用 MCP。对应快捷命令已使用 trimNonEmpty 并在清理后为空时拒绝,两个公开入口行为不一致,而且空数组可能被下游解释为清空同步字段。请在原生命令中解析后验证列表非空,并补充与快捷命令相同的空白输入测试。
  2. [P2 | 建议修改] 更新命令文档错误声称省略 field-ids 会同步全部字段docs/datasource-usage-guide.md:236

    • 说明:这里把 +datasource-update --field-ids 的省略语义写成“不传时同步全部字段”,但实现仅在该 flag 被显式提供时发送 fieldIds,省略时会保留现有配置;新增 reference 文档也重复了同一说法。调用者可能因此误以为省略参数能够恢复全字段同步。请统一改为“不传时保持现有配置”,并说明若产品支持恢复全部字段应使用何种显式输入。

此结论已作为 GitHub Approval 提交;不会自动合并。

@wxianfeng

Copy link
Copy Markdown
Collaborator

开源 DWS Codex 自动 CR:通过

Feat/add aitable datasource tools

  • 评审 SHA:c7510cd1a10fd213a16f77211ccdec8c32dbb96c
  • CI 状态:通过(34 通过,4 跳过)
  • 冲突状态:无冲突
  • Agent 测试报告:已通过(aitable,来源:PR 评论)
  • 指令 CI 集成测试:已通过(aitable,来源:PR 描述)
  • 自动 CR 结论:通过
  • 代码评审结论:通过

变更总结

本次变更新增了 7 个 AI 表格数据源原生命令及对应快捷命令,并补充 Schema 契约、语义目录、测试和使用文档。整体路由、参数映射和读写风险声明保持一致,未发现阻塞合并的安全问题;但原生命令对空字段列表的校验弱于快捷命令,且更新命令文档对省略字段列表的语义描述错误,建议修复后交付。受审查边界限制,未执行测试或构建。

CI 单测结果

结论说明

Codex 静态审查未发现 P0/P1 阻断问题;CI 单测已全部结束且通过,冲突和所需测试截图门禁均已满足。

代码问题

  1. [P2 | 建议修改] 原生命令会把仅含空白的字段列表作为空数组发送internal/helpers/aitable.go:8585

    • 说明:datasource create 仅用原始字符串是否为空判断 --field-idsdatasource update 也只拒绝字面空串;因此 --field-ids ' , 'parseCSVValues 后仍可能以空数组调用 MCP。对应快捷命令已使用 trimNonEmpty 并在清理后为空时拒绝,两个公开入口行为不一致,而且空数组可能被下游解释为清空同步字段。请在原生命令中解析后验证列表非空,并补充与快捷命令相同的空白输入测试。
  2. [P2 | 建议修改] 更新命令文档错误声称省略 field-ids 会同步全部字段docs/datasource-usage-guide.md:236

    • 说明:这里把 +datasource-update --field-ids 的省略语义写成“不传时同步全部字段”,但实现仅在该 flag 被显式提供时发送 fieldIds,省略时会保留现有配置;新增 reference 文档也重复了同一说法。调用者可能因此误以为省略参数能够恢复全字段同步。请统一改为“不传时保持现有配置”,并说明若产品支持恢复全部字段应使用何种显式输入。

此结论已作为 GitHub Approval 提交;不会自动合并。

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