sheet-edit 首战复盘两改进:① 内层动作键 op→action(run.py 兼容旧键 op 缺省 inspect),消除与 skill 工具外层 op=run 的撞名——AI 照抄示例漏外层参数、或把内层值填进外层枚举的根因;SKILL.md 顶部新增「调用形式」章节给出完整外层调用并声明下文均为 input_args。② 表头行不再靠 AI 自觉:locate.detect_header_row 扫描前 10 行(候选=非空全字符串且互不重复取最多列),inspect 每 sheet 返回 suggested_header_row;build_col_map 只解析出 1 列(典型:横跨全行的合并标题被当表头)且检测到不同行时直接报错给出 header_row=N 建议——跳过 inspect 直接 apply 也能一次报错自愈,正是「标题行+表头行」中文表格翻车现场的兜底

This commit is contained in:
2026-09-28 10:16:17 +08:00
parent efe3dcc910
commit d4f83b0694
4 changed files with 63 additions and 14 deletions
+1
View File
@@ -72,6 +72,7 @@ def _sheet_info(ws, name, header_row, limit):
'rows': ws.max_row,
'cols': ws.max_column,
'header_row': header_row,
'suggested_header_row': locate.detect_header_row(ws),
'headers': [
_json_safe(ws.cell(header_row, c).value)
for c in range(1, ws.max_column + 1)