Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 29c2e3d3b0 |
+1
-2
@@ -63,8 +63,7 @@ export GITEA_USER=pzhang_dev_agent_01 # Dev-Agent 账号
|
|||||||
|
|
||||||
1. 读取项目章程和全局状态:`docs/PROJECT_CHARTER.md` 和 `docs/GLOBAL_STATE.md`
|
1. 读取项目章程和全局状态:`docs/PROJECT_CHARTER.md` 和 `docs/GLOBAL_STATE.md`
|
||||||
2. 确认环境变量已设置(GITEA_USER + ~/.gitea/config.yaml)
|
2. 确认环境变量已设置(GITEA_USER + ~/.gitea/config.yaml)
|
||||||
3. 确认当前在独立的 git worktree 中(启动脚本已自动切到 `~/.gitea/worktrees/`),不与其他 agent 共享工作目录
|
3. 用 `/loop 10m` 开启 10 分钟间隔的自动轮询
|
||||||
4. 用 `/loop 10m` 开启 10 分钟间隔的自动轮询
|
|
||||||
4. 轮询内容(多轮递进):
|
4. 轮询内容(多轮递进):
|
||||||
a. `--action list --labels product-code` — 先捡带 `product-code` 标签的 Issue
|
a. `--action list --labels product-code` — 先捡带 `product-code` 标签的 Issue
|
||||||
b. `--action list` 无过滤,筛选 title 带 `[product]` 前缀的无标签 Issue
|
b. `--action list` 无过滤,筛选 title 带 `[product]` 前缀的无标签 Issue
|
||||||
|
|||||||
+1
-2
@@ -15,8 +15,7 @@ description: QE Agent — 自动化验收测试开发与质量门禁。轮询 Gi
|
|||||||
|
|
||||||
1. 读取项目章程和全局状态:`docs/PROJECT_CHARTER.md` 和 `docs/GLOBAL_STATE.md`
|
1. 读取项目章程和全局状态:`docs/PROJECT_CHARTER.md` 和 `docs/GLOBAL_STATE.md`
|
||||||
2. 设好环境变量(见下方"环境要求")
|
2. 设好环境变量(见下方"环境要求")
|
||||||
3. 确认当前在独立的 git worktree 中(启动脚本已自动切到 `~/.gitea/worktrees/`),不与其他 agent 共享工作目录
|
3. 用 `/loop 10m` 开启 10 分钟间隔的自动轮询
|
||||||
4. 用 `/loop 10m` 开启 10 分钟间隔的自动轮询
|
|
||||||
4. 轮询内容(多轮递进):
|
4. 轮询内容(多轮递进):
|
||||||
a. `--action list --labels test-code` — 先捡带 `test-code` 标签的 Issue
|
a. `--action list --labels test-code` — 先捡带 `test-code` 标签的 Issue
|
||||||
b. `--action list` 无过滤,筛选 title 带 `[test]` 前缀的无标签 Issue
|
b. `--action list` 无过滤,筛选 title 带 `[test]` 前缀的无标签 Issue
|
||||||
|
|||||||
+1
-37
@@ -6,8 +6,7 @@ set -eu
|
|||||||
|
|
||||||
# ── Resolve paths ──────────────────────────────────────────────────────────────
|
# ── Resolve paths ──────────────────────────────────────────────────────────────
|
||||||
_COMMON_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
_COMMON_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
_MAIN_REPO_DIR="$(cd "$_COMMON_DIR/.." && pwd)"
|
PROJECT_DIR="${PROJECT_DIR:-$(cd "$_COMMON_DIR/.." && pwd)}"
|
||||||
PROJECT_DIR="${PROJECT_DIR:-$_MAIN_REPO_DIR}"
|
|
||||||
|
|
||||||
# ── Load Gitea configuration ────────────────────────────────────────────────────
|
# ── Load Gitea configuration ────────────────────────────────────────────────────
|
||||||
# Primary: ~/.gitea/config.yaml (requires GITEA_USER)
|
# Primary: ~/.gitea/config.yaml (requires GITEA_USER)
|
||||||
@@ -19,41 +18,6 @@ if ! eval "$(python "$_COMMON_DIR/_get_gitea_config.py" 2>/dev/null)"; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ── Worktree isolation ─────────────────────────────────────────────────────────
|
|
||||||
GITEA_WORKTREE_DIR="${GITEA_WORKTREE_DIR:-$HOME/.gitea/worktrees}"
|
|
||||||
|
|
||||||
setup_worktree() {
|
|
||||||
local user="$1"
|
|
||||||
local worktree="$GITEA_WORKTREE_DIR/$user"
|
|
||||||
|
|
||||||
# Already inside a worktree we created — reuse it.
|
|
||||||
if [ -f "$worktree/.gitea-worktree" ]; then
|
|
||||||
echo "Using existing worktree: $worktree"
|
|
||||||
PROJECT_DIR="$worktree"
|
|
||||||
cd "$PROJECT_DIR"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
local branch="agent/${user}/$(date +%Y%m%d-%H%M%S)"
|
|
||||||
echo "Creating worktree: $worktree (branch: $branch)"
|
|
||||||
mkdir -p "$GITEA_WORKTREE_DIR"
|
|
||||||
git -C "$_MAIN_REPO_DIR" worktree add -b "$branch" "$worktree" origin/main
|
|
||||||
touch "$worktree/.gitea-worktree"
|
|
||||||
PROJECT_DIR="$worktree"
|
|
||||||
cd "$PROJECT_DIR"
|
|
||||||
}
|
|
||||||
|
|
||||||
cleanup_worktree() {
|
|
||||||
local user="$1"
|
|
||||||
local worktree="$GITEA_WORKTREE_DIR/$user"
|
|
||||||
if [ -d "$worktree" ]; then
|
|
||||||
rm -f "$worktree/.gitea-worktree"
|
|
||||||
echo "Cleaning up worktree: $worktree"
|
|
||||||
git -C "$_MAIN_REPO_DIR" worktree remove "$worktree" 2>/dev/null || true
|
|
||||||
rm -rf "$worktree" 2>/dev/null || true
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# ── Validate required environment ──────────────────────────────────────────────
|
# ── Validate required environment ──────────────────────────────────────────────
|
||||||
require_token() {
|
require_token() {
|
||||||
if [ -z "${GITEA_API_TOKEN:-}" ]; then
|
if [ -z "${GITEA_API_TOKEN:-}" ]; then
|
||||||
|
|||||||
@@ -15,12 +15,6 @@ export GITEA_USER="$1"
|
|||||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
source "$SCRIPT_DIR/_common.sh"
|
source "$SCRIPT_DIR/_common.sh"
|
||||||
|
|
||||||
# Switch to isolated worktree so multiple agents don't conflict
|
|
||||||
setup_worktree "$GITEA_USER"
|
|
||||||
|
|
||||||
# Cleanup worktree on exit (optional, comment out to keep for debugging)
|
|
||||||
trap 'cleanup_worktree "$GITEA_USER"' EXIT
|
|
||||||
|
|
||||||
banner "Dev"
|
banner "Dev"
|
||||||
require_token
|
require_token
|
||||||
|
|
||||||
|
|||||||
@@ -15,12 +15,6 @@ export GITEA_USER="$1"
|
|||||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
source "$SCRIPT_DIR/_common.sh"
|
source "$SCRIPT_DIR/_common.sh"
|
||||||
|
|
||||||
# Switch to isolated worktree so multiple agents don't conflict
|
|
||||||
setup_worktree "$GITEA_USER"
|
|
||||||
|
|
||||||
# Cleanup worktree on exit (optional, comment out to keep for debugging)
|
|
||||||
trap 'cleanup_worktree "$GITEA_USER"' EXIT
|
|
||||||
|
|
||||||
banner "QE"
|
banner "QE"
|
||||||
require_token
|
require_token
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user