Skip to content

idd-update: body+comments 一起餵 jq 解析失敗 → $BODY 空字串 → gh issue edit 把整個 issue body 覆蓋成只剩 Current Status #345

Description

@kiki830621

Problem

Original text:
「跑 idd-update 時,把 body 和 comments 一起餵給 jq 解析炸掉,body 變數變空,我一度把 #223 的 body 覆蓋成只剩 Current Status。⋯這也是 idd-update skill 自己 Step 1 建議的指令形狀,值得回 plugin 修。 可以幫忙開/idd-issue 在plugin裡面」
— Source: 使用者對話(2026-09-12,educator#223 的 idd-diagnose → idd-update 鏈)

idd-update Step 1 建議一次抓 --json title,body,labels,state,comments,再用 jq -r .body 取 body。當任一 comment 含未跳脫的控制字元(本例是 Diagnosis comment),jq 直接 parse error: Invalid string: control characters from U+0000 through U+001F must be escaped,$BODY 變成空字串。Step 5 接著執行 gh issue edit --body "${BODY}${CURRENT_STATUS}",整個 issue body 被覆蓋成只剩 Current Status:原始記錄、### Clarity Surface audit block 全部消失,而且沒有任何錯誤擋下這一步。

Type

bug

Priority

P1(不可逆地毀掉 issue 的原始記錄與 audit trail;正是 #178 想保護的東西)

Expected

  • 讀 body 與讀 comments 分兩次 gh 呼叫,或用 --jq 讓 gh 內部解析(gh 對控制字元的容忍度比外部 jq 高)
  • 任何 gh issue edit --body 之前,[ -n "$BODY" ] || abort;Branch B append 之後 grep 確認原有 ## Problem 等 heading 仍在
  • 這條 guard 應該進 gh-egress.sh edit(choke-point)而不只是 idd-update:所有 append 型 body 編輯(idd-issue Step 4.6 / 4.7、idd-clarify、idd-diagnose Layer V clarify)都走同一條路

Actual

  • body 空字串被靜默接受,issue body 被覆蓋;靠對話裡留存的原文手動重建(educator#223,2026-09-12)

Impact

  • 任何 issue 只要有一則 comment 含控制字元(LLM 生成的 Diagnosis 很容易帶),之後每次 idd-update 都會把 body 清空
  • 受影響的 skill:idd-update(直接)、以及所有在結尾自動呼叫它的 skill(diagnose / implement / verify / close)

建議修法

  1. gh-egress.sh edit:--body 為空或不含至少一個 ^## heading 時 refuse(exit 5,具名原因)
  2. idd-update Step 1 改成 gh issue view N --json body --jq .body 與 gh issue view N --json comments --jq '.comments[].body' 分開抓
  3. 補一個回歸測試:含 \x01 的 comment + 跑 idd-update → body 不變

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions