fix(daemon-beta t3): headless claude -p 寫卡卡權限確認——帶 --permission-mode acceptEdits(真機 e2e 第二枚實撞)

This commit is contained in:
2026-07-24 12:28:47 +08:00
parent 18a873001b
commit c0bf83def4
+3 -1
View File
@@ -68,7 +68,9 @@ func ExtractWithClaude(binPath, absRoot, relPath string) ([]string, error) {
ctx, cancel := context.WithTimeout(context.Background(), claudeExtractTimeout)
defer cancel()
// /rag-extract-filetemplate 既有萃取 skillcwd=監看根(template 已代裝,skill 就在 .claude/commands/)。
cmd := exec.CommandContext(ctx, binPath, "-p", fmt.Sprintf("/rag-extract-file %s", relPath))
// --permission-mode acceptEditsheadless 無人按核准,寫卡會卡在權限確認(07-24 真機 e2e 實撞);
// acceptEdits 只自動放行檔案編輯、不放行任意 Bash,範圍侷限在監看根(cwd)。
cmd := exec.CommandContext(ctx, binPath, "-p", fmt.Sprintf("/rag-extract-file %s", relPath), "--permission-mode", "acceptEdits")
cmd.Dir = absRoot
out, err := cmd.CombinedOutput()
if ctx.Err() == context.DeadlineExceeded {