Problem
scripts/process-attachments.sh download <N> 在 issue 完全沒有 attachment 時,detect_urls 內的 grep -oE '...' 零 match 回傳 exit 1,在 set -e 下讓整個 script 於 URLS=$(detect_urls) 處早退 — exit 1、不寫 empty _manifest.json、無任何 stderr 輸出。
實證(2026-06-10,plugin cache 2.85.0,target repo PsychQuant/che-apple-mail-mcp issue #173 — 純文字 issue、零 attachment):
$ IDD_CALLER=idd-diagnose bash scripts/process-attachments.sh download 173
$ echo $?
1
# .claude/.idd/attachments/issue-173/ 目錄已建立但完全空(無 _manifest.json)
bash -x 追蹤確認死點在 URLS=$(detect_urls),detect_urls pipeline 尾端的 grep 零 match exit 1。
Type
bug
Expected
依 rules/process-attachments.md 與 idd-diagnose SKILL.md Step 1.5 的契約:
Exit code:
0 — 下載完成(或 issue 無 attachment,empty manifest 已寫)
零 attachment 是合法且常見的狀態,應 exit 0 並寫 empty manifest。
Actual
零 attachment → exit 1、無 manifest、無輸出。Caller(idd-diagnose Step 1.5)契約把 exit 1 解讀為「部分檔案下載失敗(error 條目已寫進 manifest)」— 但 manifest 根本不存在,兩邊矛盾,AI caller 需要人工介入判斷。
可能修法
detect_urls 的 grep 尾端加 || true(或 grep ... || :),讓零 match 回空字串而非 exit 1;後續以 [ -z "$URLS" ] 分支寫 empty manifest + exit 0(該分支可能已存在、只是永遠到不了)。
Impact
每個對「純文字 issue」跑 idd-diagnose / idd-implement / idd-verify 的 session 都會在 Step 1.5 撞到非預期 exit 1,需 AI 或人工 workaround(手寫 empty manifest)。純文字 issue 是大宗,命中率高。
Source: surfaced during /idd-diagnose PsychQuant/che-apple-mail-mcp#173 sister concern surfacing (Step 3.6) — cross-repo filing
Problem
scripts/process-attachments.sh download <N>在 issue 完全沒有 attachment 時,detect_urls內的grep -oE '...'零 match 回傳 exit 1,在set -e下讓整個 script 於URLS=$(detect_urls)處早退 — exit 1、不寫 empty_manifest.json、無任何 stderr 輸出。Type
bug
Expected
依
rules/process-attachments.md與 idd-diagnose SKILL.md Step 1.5 的契約:零 attachment 是合法且常見的狀態,應 exit 0 並寫 empty manifest。
Actual
零 attachment → exit 1、無 manifest、無輸出。Caller(idd-diagnose Step 1.5)契約把 exit 1 解讀為「部分檔案下載失敗(error 條目已寫進 manifest)」— 但 manifest 根本不存在,兩邊矛盾,AI caller 需要人工介入判斷。
可能修法
detect_urls的 grep 尾端加|| true(或grep ... || :),讓零 match 回空字串而非 exit 1;後續以[ -z "$URLS" ]分支寫 empty manifest + exit 0(該分支可能已存在、只是永遠到不了)。Impact
每個對「純文字 issue」跑 idd-diagnose / idd-implement / idd-verify 的 session 都會在 Step 1.5 撞到非預期 exit 1,需 AI 或人工 workaround(手寫 empty manifest)。純文字 issue 是大宗,命中率高。
Source: surfaced during /idd-diagnose PsychQuant/che-apple-mail-mcp#173 sister concern surfacing (Step 3.6) — cross-repo filing