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: