Feat/error schema hints - #2027
Merged
Merged
Conversation
为什么:豆包 Excel Agent 案例中模型 7 次参数错误,报错只说"错了"不说 "怎么改对",模型反复试错并静默降级交付(5 张饼图丢数据标签)。 怎么改: - strict unexpected-property 报错附该节点合法 key 列表(cap 15 截断) + did-you-mean(复用 internal/suggest) - required-missing 报错附缺失字段的 type/description/enum 一行提示 - 深层 type mismatch 报错附该字段 enum/description 后缀 - +batch-update 顶层 --sheet-id/--sheet-name(含下划线拼写)特判, 直接指明 per-op locator 契约,不给误导性 fuzzy 建议 - batch sub-op input 拒收 cell_styles/styles/cell_merges 包裹结构, 报错教学扁平 flags 写法 - 守护测试锁定 wrappedSubOpInputKeys 与 batchOpDispatch 的互斥假设 约束:不改 legacy 报错措辞前缀、保留 --print-schema 指针、不动宽松 AdditionalProperties 设计(内嵌 schema 当前无 strict 节点,该路径为预置)。 验证:gofmt -l 无输出、go vet 干净、go test -count=1 ./shortcuts/sheets/ ./internal/suggest/ 全部通过。
为什么:fail-fast 单错报错导致「挤牙膏」修复回路——修一处、重试、 撞下一处。评测实测(turbo 三批 247 次失败)约 32% 的失败轮次是 挤牙膏,其中 local→local 类(39 次)本可一次报出。 怎么改: - validateAgainstSchema 重构为 collectSchemaErrors 收集器版:命中 错误后继续遍历,全部问题一次报出(每条带各自的教学信息) - translateBatchOperations 同步做 op 级聚合:多个坏 op 一条报错 编号列出,不再 fail-fast 在第一个 - 三条护栏:单错误输出逐字不变(向后兼容);显示 cap 5 条 + 收集 到 6 即全树短路(病态大数组不爆炸);类型错节点不下钻、oneOf 用一次性探测器(防级联噪音/误报泄漏) 验证:gofmt/vet 干净,go test -count=1 全过(既有测试零改动, 新增 5 个聚合测试:多错编号、cap 截断、oneOf 不泄漏、batch 双 op 聚合、单 op 保持原文)。
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
xiongyuanwen-byted
approved these changes
Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
Test Plan
lark-cli <domain> <command>flow works as expectedRelated Issues