fix: gh CLI 加 --repo 参数适配 workspace 本地 remote - #124
Conversation
工作区 git remote 指向本地缓存路径,gh 无法自动识别 GitHub host。 在普通模式 workspace prompt 和 pipeline push prompt 中加入提示: 始终使用 --repo owner/repo 参数。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Claude finished @lishuceo's task in 1m 33s —— View job PR Review: gh CLI
|
|
|
||
| **重要:gh CLI 注意事项** | ||
| 工作区的 git remote 指向本地缓存路径(非 GitHub URL),\`gh\` 无法自动识别仓库。 | ||
| 所有 \`gh\` 命令必须加 \`--repo owner/repo\` 参数(从 git remote URL 或项目配置中推断 owner/repo)。 |
There was a problem hiding this comment.
🟡 Minor inconsistency (confidence: 80)
Step 8 above (line 118) still shows gh pr create --fill without --repo, which contradicts the new guidance on lines 120-122 that says all gh commands must use --repo. An agent might follow the specific step 8 example and omit --repo.
Consider updating step 8 to be consistent:
| 所有 \`gh\` 命令必须加 \`--repo owner/repo\` 参数(从 git remote URL 或项目配置中推断 owner/repo)。 | |
| 所有 \`gh\` 命令必须加 \`--repo owner/repo\` 参数(从 git remote URL 或项目配置中推断 owner/repo)。例如 \`gh pr create --fill --repo owner/repo\`。 |
| ## GitHub CLI (gh) 注意事项 | ||
|
|
||
| 工作区的 git remote 指向本地缓存路径(非 GitHub URL),\`gh\` CLI 无法自动识别仓库。 | ||
| **始终使用 \`--repo owner/repo\` 参数**,不要 cd 到其他目录: |
There was a problem hiding this comment.
🟡 Missing guidance on how to resolve owner/repo (confidence: 78)
The examples use literal owner/repo as a placeholder, but unlike prompts.ts (which says "从 git remote URL 或项目配置中推断 owner/repo"), this prompt doesn't tell the agent how to determine the actual owner/repo value. Since the workspace remote points to a local cache path, git remote -v won't directly reveal the GitHub owner/repo.
Consider adding a hint, e.g.:
owner/repo 可以从项目 CLAUDE.md、git log 中的 GitHub 链接、或 bare cache 路径结构推断。
工作区 git remote 指向本地缓存路径,gh 无法自动识别 GitHub host。 在普通模式 workspace prompt 和 pipeline push prompt 中加入提示: 始终使用 --repo owner/repo 参数。 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Summary
ghCLI 无法自动识别 GitHub hostexecutor.ts) 和 pipeline push prompt (prompts.ts) 中加入提示:始终使用--repo owner/repo参数systemPromptOverride路径)改动文件
src/claude/executor.ts—buildWorkspaceSystemPrompt新增## GitHub CLI (gh) 注意事项src/pipeline/prompts.ts—PUSH_SYSTEM_PROMPT追加 gh 注意事项