From 7612c97ae7fb8649e4eaa18706d639a2772329f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=A9=98?= Date: Thu, 28 May 2026 23:51:46 +0000 Subject: [PATCH] fix(solve-issue): committer post-condition verification + use API instead of tea MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add git ls-remote verification after push - Switch from tea pr create to Gitea API (tea fails in worktrees) - Add PR creation verification (check response JSON has number field) - Explicitly mark steps 4 and 6 as verification gates 小橘 🍊 --- workflows/solve-issue.yaml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/workflows/solve-issue.yaml b/workflows/solve-issue.yaml index 638abeb..6cee7f4 100644 --- a/workflows/solve-issue.yaml +++ b/workflows/solve-issue.yaml @@ -242,12 +242,11 @@ roles: capabilities: [] procedure: "The worktree path, branch name, and repo remote (owner/repo) are provided in your task prompt.\ncd into the worktree first.\n\nNote: You inherit the developer's worktree and branch. Do NOT\ \ create a new branch.\n1. Stage all changes: `git add -A`\n2. Commit with a descriptive message referencing the issue: `git commit -m \"type: description\\n\\nFixes #N\"`\n3. Push the branch: `git\ - \ push -u origin `\n - If push hook fails: capture the error log in your output, mark hook_failed\n4. On push success: create a PR via `tea pr create --repo --title \"\ - ...\" --description \"...\"`\n - The repo remote (owner/repo format, e.g. \"uncaged/workflow\") is given in your task prompt — use it directly, do NOT try to parse it from git remote URL.\n -\ - \ PR description must include: What / Why / Changes / Ref sections, with `Fixes #N` in Ref\n - If `tea pr create` fails, try the Gitea API as fallback:\n ```bash\n GITEA_TOKEN=$(cfg get\ - \ GITEA_TOKEN)\n curl -s -X POST -H \"Authorization: token $GITEA_TOKEN\" -H \"Content-Type: application/json\" \\\n \"https://git.shazhou.work/api/v1/repos///pulls\" \\\n \ - \ -d '{\"title\":\"...\",\"body\":\"...\",\"head\":\"\",\"base\":\"main\"}'\n ```\n - On total failure: capture stderr/stdout, include PR details for manual creation, mark hook_failed\n\ - 5. After PR creation, clean up the worktree:\n - cd to the repo root (parent of .worktrees)\n - `git worktree remove `" + \ push -u origin `\n4. **Verify push succeeded** — run `git ls-remote origin ` and confirm it prints a commit hash.\n - If no output or push failed: capture the error, mark hook_failed\n\ + 5. Create a PR using the Gitea API (do NOT use `tea pr create` — it fails in worktrees):\n ```bash\n GITEA_TOKEN=$(cfg get GITEA_TOKEN)\n curl -s -X POST -H \"Authorization: token $GITEA_TOKEN\" -H \"Content-Type: application/json\" \\\n\ + \ \"https://git.shazhou.work/api/v1/repos///pulls\" \\\n -d '{\"title\":\"...\",\"body\":\"...\",\"head\":\"\",\"base\":\"main\"}'\n ```\n - The repo remote (owner/repo format, e.g. \"uncaged/workflow\") is given in your task prompt — use it directly.\n\ + \ - PR body must include: What / Why / Changes / Ref sections, with `Fixes #N` in Ref\n6. **Verify PR was created** — parse the curl response JSON: it must contain a `\"number\"` field. Print the PR URL.\n\ + \ - If curl returns an error or no number field: capture the response, mark hook_failed\n7. After PR creation, clean up the worktree:\n - cd to the repo root (parent of .worktrees)\n - `git worktree remove `" output: Include PR URL on success or error log on failure. Set $status to committed (with prUrl) or hook_failed (with error). frontmatter: oneOf: