fix(sql,job): 修复字段截断破坏 JSON 结构的问题 - #16
Merged
Merged
Conversation
Co-Authored-By: cz-cli <noreply@clickzetta.com>
- truncateLargeFields 按 format 区分行为:json/jsonl/csv 干净截断不插标记, table 格式在格子里显示 ...(N chars) - 截断信息统一通过 ai_message 上报,包含受影响列名、原始长度及重定向到文件的完整用法 - job result 新增 --no-truncate 选项,与 cz-cli sql 行为对齐 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
lyman
approved these changes
Jun 16, 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.
问题
cz-cli sql和cz-cli job result对超长字段值进行截断时,直接将截断标记(如...(truncated, 24605 chars))嵌入字段值字符串,导致 JSON/JSONL 输出结构被破坏,agent 无法解析结果。变更
核心修复:按 format 区分截断行为
...(N chars)ai_message 报告截断信息
触发截断时统一通过
ai_message上报,包含:--no-truncate > output.json)示例:
job result 新增 --no-truncate
cz-cli job result补充--no-truncate选项,与cz-cli sql行为对齐。测试