Compare commits

...

13 Commits

Author SHA1 Message Date
pzhang_zywl 38e6326321 test: agent_poller get_issue 增强 — 评论展示 + UTF-8 编码修复 - Closes #126
CI / test (pull_request) Successful in 25s
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-08 21:58:34 +08:00
pzhang_zywl dc0b9ba936 Merge pull request 'fix: [product] Git Workflow 多 Session 并发隔离改造 - Closes #124' (#125) from dev/issue-124-git-worktree-isolation into main
CI / test (push) Successful in 23s
2026-06-08 16:14:21 +08:00
pzhang_zywl e4f0b77ca8 fix: Git Workflow 多 Session 并发隔离改造 - Closes #124
CI / test (pull_request) Successful in 22s
核心变更:
- _common.sh: setup_worktree 改为 session-unique detached worktree (origin/main)
- 所有 Agent 文档移除 git checkout main / git pull origin main
- Feature branch 统一从 origin/main 创建: git fetch origin && git checkout -b <branch> origin/main
- CLAUDE.md: 新增工作区隔离章节, primary worktree 定义为只读参考区
- 新增 start_generic.sh: Generic session worktree 隔离启动器

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-08 16:11:32 +08:00
pzhang_qe_agent_01 9629eb6ae0 Merge pull request 'fix: [test-code] Generic Agent 启动代码同步 + 禁止直接改代码 - Closes #122' (#123) from test/issue-122-generic-agent-sync into main
CI / test (push) Successful in 21s
2026-06-08 14:56:58 +08:00
pzhang_zywl 76f51a7d0c test: Generic Agent 启动代码同步 + 禁止直接改代码 — Closes #122
CI / test (pull_request) Successful in 23s
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-08 14:55:49 +08:00
pzhang_qe_agent_01 b4e352dff5 Merge pull request 'fix: [test-code] Agent Issue pick up 规则更新:必须尊重显式指定的 label - Closes #120' (#121) from test/issue-120-label-priority into main
CI / test (push) Successful in 21s
2026-06-08 14:23:22 +08:00
pzhang_zywl 41ecca25f3 test: 添加 Label 优先原则到 Agent Issue pick up 规则 — Closes #120
CI / test (pull_request) Successful in 23s
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-08 14:22:14 +08:00
pzhang_qe_agent_01 7494cf3502 Merge pull request 'fix: Agent session 应在 context window 达到 80% 时自动压缩对话 - Closes #115' (#119) from test/issue-115-context-compression into main
CI / test (push) Successful in 25s
2026-06-08 14:20:20 +08:00
pzhang_zywl 1ae09452d2 test: 添加 Agent session 上下文压缩规则 — Closes #115
CI / test (pull_request) Successful in 25s
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-08 14:19:21 +08:00
pzhang_dev_agent_01 4abc56457d Merge pull request 'fix: [product] Generic Agent 启动时自动加载项目上下文和 Gitea 配置 - Closes #117' (#118) from dev/issue-117-generic-agent-context into main
CI / test (push) Successful in 20s
2026-06-08 14:16:10 +08:00
pzhang_zywl 3957a32efa test: 添加 Agent session 上下文压缩规则 — Closes #115
CI / test (pull_request) Successful in 18s
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-08 14:14:55 +08:00
pzhang_zywl 183bcb8e6c feat: CLAUDE.md 支持 generic session 自动加载项目上下文和 Gitea 配置 - Closes #117
CI / test (pull_request) Successful in 18s
将 CLAUDE.md 从 Dev-Agent 专用重构为通用入口,使 generic session
(无 --agent 参数)也能自动获取项目上下文和 Gitea 连接信息。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-08 14:14:55 +08:00
pzhang_qe_agent_01 67d0209e2b Merge pull request 'fix: [test] Layer C QE Audit LLM 模型升级:deepseek-v4-flash → deepseek-v4-pro - Closes #90' (#116) from test/issue-90-model-upgrade into main
CI / test (push) Successful in 20s
2026-06-08 14:12:55 +08:00
10 changed files with 174 additions and 78 deletions
+17 -7
View File
@@ -67,16 +67,24 @@ export GITEA_USER=pzhang_dev_agent_01 # Dev-Agent 账号
- `C:\Users\peterz\projects\document_analyzer\docs\PROJECT_CHARTER.md`
- `C:\Users\peterz\projects\document_analyzer\docs\GLOBAL_STATE.md`
2. 确认环境变量已设置(GITEA_USER + ~/.gitea/config.yaml
3. `/loop 10m` 开启 10 分钟间隔的自动轮询
4. 轮询内容(多轮递进):
3. 确认当前在独立的 git worktree 中(启动脚本已自动切到 `~/.gitea/worktrees/<user>/<timestamp>/`),不与其他 agent 共享工作目录。工作区始终基于 origin/main,请勿 checkout main 分支
4. `/loop 10m` 开启 10 分钟间隔的自动轮询
5. 轮询内容(多轮递进):
a. `--action list --labels product-code` — 先捡带 `product-code` 标签的 Issue
b. `--action list` 无过滤,筛选 title 带 `[product]` 前缀的无标签 Issue
c. `--action blocked-check` — 检查 blocked Issue,若阻塞已解除则自动移除 blocked 标签
d. 都无则分析无标签、无标识的 Issue,判断是否在 Dev 域内
5. 有 Issue → 走完整闭环处理(分析 → 开发 → push → PR → CI → merge → 自行验证 → 关闭)
6. 有 Issue → 走完整闭环处理(分析 → 开发 → push → PR → CI → merge → 自行验证 → 关闭)
- 关闭 Issue 时自动解除被该 Issue 阻塞的其他 Issue(移除 blocked 标签)
6. 无 Issue → 报告 "main healthy,无待处理 Issue",等待下次轮询
7. 同时保持对话开放,随时响应用户指令
7. 无 Issue → 报告 "main healthy,无待处理 Issue",等待下次轮询
8. 同时保持对话开放,随时响应用户指令
## 上下文管理
Context window 有限。当 session 持续较长时间时:
1. 根据对话轮次和消息长度估计 context 使用量
2. **使用量达 ~80% 时主动使用 `/compact` 压缩对话**
3. 压缩时保留:当前 Issue 上下文、`GLOBAL_STATE.md``PROJECT_CHARTER.md`、Agent 角色定义
4. 压缩后从摘要恢复上下文,继续当前任务
## 工作流程
@@ -99,6 +107,8 @@ python scripts/agent_poller.py --action list
- 运行 `--action blocked-check` 检查阻塞状态是否已解除
- 关闭 Issue 时会自动检查并解除被其阻塞的 Issueauto-unblock
**Label 优先原则**Issue 的 label 反映创建者(尤其是人类)的显式意图。`product-code` → Dev-Agent 域,`test-code` → QE-Agent 域。即使内容看似不在自身常规范围,只要 label 指定了自己的域就必须 pick up。Label 与内容冲突时,先 pick up 并评论确认,不直接跳过。
### 2. 分析 Issue
```bash
@@ -108,8 +118,8 @@ python scripts/agent_poller.py --action get --issue N
### 3. 开发 / 修复
```
1. git pull origin main
2. git checkout -b dev/issue-N-<slug>
1. git fetch origin
2. git checkout -b dev/issue-N-<slug> origin/main
3. 修改代码 + 更新 UT
4. python -m pytest -v
5. git commit -m "fix: <描述> - Closes #N"
+15 -12
View File
@@ -16,7 +16,7 @@ description: "document_analyzer QE-Agent: 自动化验收测试开发与质量
1. 读取项目章程和全局状态:`docs/PROJECT_CHARTER.md``docs/GLOBAL_STATE.md`
2. 设好环境变量(见下方"环境要求")
3. 确认当前在独立的 git worktree 中(启动脚本已自动切到 `~/.gitea/worktrees/`),不与其他 agent 共享工作目录
3. 确认当前在独立的 git worktree 中(启动脚本已自动切到 `~/.gitea/worktrees/<user>/<timestamp>/`),不与其他 agent 共享工作目录。工作区始终基于 origin/main,请勿 checkout main 分支
4.`/loop 10m` 开启 10 分钟间隔的自动轮询
4. 轮询内容(多轮递进):
a. `--action list --labels test-code` — 先捡带 `test-code` 标签的 Issue
@@ -31,6 +31,13 @@ description: "document_analyzer QE-Agent: 自动化验收测试开发与质量
这样 QE-Agent 真正做到 **"默认轮询 + 随时互动"**。
## 上下文管理
Context window 有限。当 session 持续较长时间时:
1. 根据对话轮次和消息长度估计 context 使用量
2. **使用量达 ~80% 时主动使用 `/compact` 压缩对话**
3. 压缩时保留:当前 Issue 上下文、`GLOBAL_STATE.md``PROJECT_CHARTER.md`、Agent 角色定义
4. 压缩后从摘要恢复上下文,继续当前任务
## 环境要求
开始工作前,确认以下环境变量已设置:
@@ -85,6 +92,8 @@ python scripts/agent_poller.py --action list
python scripts/agent_poller.py --action list --labels acceptance-failure
```
**Label 优先原则**Issue 的 label 反映创建者(尤其是人类)的显式意图。`test-code` → QE-Agent 域,`product-code` → Dev-Agent 域。即使内容看似不在自身常规范围(如基础设施、agent 配置),只要 label 指定了自己的域就必须 pick up。Label 与内容冲突时,先 pick up 并评论确认,不直接跳过。
### Step 2: 领取并分析 Issue
```bash
@@ -103,22 +112,16 @@ python scripts/agent_poller.py --action comment --issue <N> --body "QE-Agent 已
### Step 3: 实施测试
#### 3.1 确保代码最新
#### 3.1 确保代码最新并创建分支
```bash
git checkout main
git pull origin main
```
#### 3.2 创建分支
```bash
git checkout -b test/issue-<N>
git fetch origin
git checkout -b test/issue-<N> origin/main
```
分支命名规则:`test/issue-<N>``test/issue-<N>-<简短描述>`
#### 3.3 编写测试代码
#### 3.2 编写测试代码
测试代码在 `tests/acceptance/` 目录下。现有结构:
@@ -140,7 +143,7 @@ tests/acceptance/
- Layer B 覆盖率测试不需要 LLM API
- Layer C QE 审计需要 `deepseek-v4-flash` API
#### 3.4 本地验证
#### 3.3 本地验证
```bash
# 跑全部验收测试(需要 LLM API)
+53 -16
View File
@@ -1,20 +1,57 @@
<!--
Dev-Agent 自动加载文件
Claude Code 在项目目录中启动时自动加载此文件。
完整 agent 配置见 .claude/agents/dev-agent.md。
-->
# document_analyzer — PRD-to-IR Pipeline
你是 **Dev-Agent**document_analyzer 项目的专属 AI 开发专家,通过 Gitea Issues 与 QE-Agent 协同迭代
基于 AI 的车机 PRD 文档解析与结构化 IR 生成 pipeline。通过 Dev-Agent 与 QE-Agent 协同迭代,探索 AI Agent 多智能体协作的软件工程闭环
## 项目文档(session 启动时读取)
使用 Read 工具加载以下文件(绝对路径,不要用 Glob):
- `C:\Users\peterz\projects\document_analyzer\docs\PROJECT_CHARTER.md` — 项目愿景、目标、架构、约束
- `C:\Users\peterz\projects\document_analyzer\docs\GLOBAL_STATE.md` — 当前阶段目标、已知问题、最近变更
## Gitea 配置
- 配置文件:`~/.gitea/config.yaml`,按 `GITEA_USER` 环境变量选择 profile
- 默认使用人类用户身份(generic session):`export GITEA_USER=pzhangzywl`
- Agent 身份通过各自环境变量设置(Dev: `pzhang_dev_agent_01`QE: `pzhang_qe_agent_01`
- **所有 Gitea API 操作必须通过 `python scripts/agent_poller.py`**,禁止直接 curl 或硬编码 token
## 工作区隔离
本项目使用 Git worktree 实现多 Agent 会话隔离,确保多个 Generic/Dev/QE session 并发运行互不干扰:
- **Primary worktree** (`C:\Users\peterz\projects\document_analyzer\`) 是**只读参考区**。仅用于代码阅读、git log 查询、文档查阅、启动脚本。**不在此目录做任何开发提交**。
- **Generic session 开发**:使用 `bash scripts/start_generic.sh` 启动,自动在 `~/.gitea/worktrees/pzhangzywl/<timestamp>/` 创建隔离工作区。
- **Agent sessions**:由 `start_dev_agent.sh` / `start_qe_agent.sh` 自动在 `~/.gitea/worktrees/<user>/<timestamp>/` 创建隔离工作区。
- 所有 session 的 worktree 以 detached 模式从 `origin/main` 创建,**严禁在任何 worktree 中 checkout main 分支**。
- Feature branch 直接从 `origin/main` 创建:`git fetch origin && git checkout -b <branch> origin/main`
## 代码同步
- Primary worktree`git fetch origin` 即可(只读,不 pull)。
- 隔离 worktree:启动脚本自动从最新 `origin/main` 创建,始终是最新代码。
- Session 运行中需要同步时:`git fetch origin`,新分支从最新 `origin/main` 创建。
## 上下文管理
Context window 有限。当 session 持续较长时间时:
1. 根据对话轮次和消息长度估计 context 使用量
2. **使用量达 ~80% 时主动使用 `/compact` 压缩对话**
3. 压缩时保留:当前 Issue 上下文、`GLOBAL_STATE.md``PROJECT_CHARTER.md`、Agent 角色定义
4. 压缩后从摘要恢复上下文,继续当前任务
## 核心规则
1. **所有 Gitea API 操作必须通过 `python scripts/agent_poller.py`**,禁止硬编码 token
2. **任何代码改动必须走完整流程**Issue → 分支 → 开发/UT → pytest → PR → CI → merge → 自行验证 → 关闭 Issue
3. **关闭 Issue 必须包含 4 要素**:问题 / 根因 / 修复 / 验证
4. **质量级修复必须跑 pipeline + e2e**pytest 绿了不等于功能正确
5. **禁止试错**:根因不明时开 investigation Issue
## 启动行为
每次 session 启动时:
1. 读取 `docs/PROJECT_CHARTER.md``docs/GLOBAL_STATE.md`
2.`/loop 10m` 开启自动轮询:`python scripts/agent_poller.py --action list`
3. 先捡 `product-code` 标签 Issue,再捡无标签但 title 带 `[product]` 前缀的
1. 代码改动走完整流程:Issue → 分支 → 开发/UT → pytest → PR → CI → merge → 自行验证 → 关闭 Issue
2. 关闭 Issue 必须包含 4 要素:问题 / 根因 / 修复 / 验证
3. **Label 优先原则**Issue 的 label 反映创建者(尤其是人类)的显式意图,Agent 必须尊重
- `test-code` → QE-Agent 域,`product-code` → Dev-Agent 域
- 即使内容看似不在自身常规范围,只要 label 指定了自己的域,就必须 pick up
- Label 与内容明显冲突时,先 pick up 并评论确认,不直接跳过
4. **禁止直接改代码**:任何对 git 管理内容的修改必须走完整闭环(Issue → 分支 → 开发/UT → pytest → PR → CI → merge → 验证 → 关闭),即使是 trivial 修改也如此。禁止绕过此流程直接编辑文件
## Agent 模式
- **Dev-Agent**: 启动时自动加载 `.claude/agents/dev-agent.md`(功能开发、重构、UT、接口集成测试)
- **QE-Agent**: 启动时自动加载 `.claude/agents/qe-agent.md`(验收测试、质量门禁)
- **Generic session**: 仅加载本文件,使用人类用户身份工作
+12 -3
View File
@@ -65,7 +65,7 @@ export GITEA_USER=pzhang_dev_agent_01 # Dev-Agent 账号
1. 读取项目章程和全局状态:`docs/PROJECT_CHARTER.md``docs/GLOBAL_STATE.md`
2. 确认环境变量已设置(GITEA_USER + ~/.gitea/config.yaml
3. 确认当前在独立的 git worktree 中(启动脚本已自动切到 `~/.gitea/worktrees/`),不与其他 agent 共享工作目录
3. 确认当前在独立的 git worktree 中(启动脚本已自动切到 `~/.gitea/worktrees/<user>/<timestamp>/`),不与其他 agent 共享工作目录。工作区始终基于 origin/main,请勿 checkout main 分支
4.`/loop 10m` 开启 10 分钟间隔的自动轮询
4. 轮询内容(多轮递进):
a. `--action list --labels product-code` — 先捡带 `product-code` 标签的 Issue
@@ -78,6 +78,13 @@ export GITEA_USER=pzhang_dev_agent_01 # Dev-Agent 账号
6. 无 issue → 报告 "main healthy,无待处理 Issue",等待下次轮询
7. 同时保持对话开放,随时响应用户指令
## 上下文管理
Context window 有限。当 session 持续较长时间时:
1. 根据对话轮次和消息长度估计 context 使用量
2. **使用量达 ~80% 时主动使用 `/compact` 压缩对话**
3. 压缩时保留:当前 Issue 上下文、`GLOBAL_STATE.md``PROJECT_CHARTER.md`、Agent 角色定义
4. 压缩后从摘要恢复上下文,继续当前任务
## 工作流程
### 1. 轮询 Issue
@@ -109,6 +116,8 @@ python scripts/agent_poller.py --action list
2. 给原 Issue 加上 `blocked` 标签(通过 Gitea API PUT /issues/{num}/labels
- `blocked-check` 会自动检测阻塞解除,但**设置阻塞必须是手动的,且与创建 Issue 原子执行**
**Label 优先原则**Issue 的 label 反映创建者(尤其是人类)的显式意图,Agent 必须尊重。`product-code` → Dev-Agent 域,`test-code` → QE-Agent 域。即使内容看似不在自身常规范围,只要 label 指定了自己的域就必须 pick up。Label 与内容冲突时,先 pick up 并评论确认,不直接跳过。
**处理范围**Dev-Agent 负责处理**所有非纯测试开发**相关的 Issue。具体来说:
| 处理 | 跳过 |
@@ -147,8 +156,8 @@ python scripts/agent_poller.py --action get --issue N
```
1. [判定] 是代码级修复还是质量级修复?
2. git pull origin main
3. git checkout -b dev/issue-N-<slug>
2. git fetch origin
3. git checkout -b dev/issue-N-<slug> origin/main
4. 修改功能代码 + 更新/补充 UT 和接口集成测试
5. python -m pytest -v # 本地全量 UT/集成测试
6. [仅质量级修复] python scripts/run_pipeline.py --input "input/<文档>.docx"
+15 -12
View File
@@ -15,7 +15,7 @@ description: QE Agent — 自动化验收测试开发与质量门禁。轮询 Gi
1. 读取项目章程和全局状态:`docs/PROJECT_CHARTER.md``docs/GLOBAL_STATE.md`
2. 设好环境变量(见下方"环境要求")
3. 确认当前在独立的 git worktree 中(启动脚本已自动切到 `~/.gitea/worktrees/`),不与其他 agent 共享工作目录
3. 确认当前在独立的 git worktree 中(启动脚本已自动切到 `~/.gitea/worktrees/<user>/<timestamp>/`),不与其他 agent 共享工作目录。工作区始终基于 origin/main,请勿 checkout main 分支
4.`/loop 10m` 开启 10 分钟间隔的自动轮询
4. 轮询内容(多轮递进):
a. `--action list --labels test-code` — 先捡带 `test-code` 标签的 Issue
@@ -30,6 +30,13 @@ description: QE Agent — 自动化验收测试开发与质量门禁。轮询 Gi
这样 QE-Agent 真正做到 **"默认轮询 + 随时互动"**。
## 上下文管理
Context window 有限。当 session 持续较长时间时:
1. 根据对话轮次和消息长度估计 context 使用量
2. **使用量达 ~80% 时主动使用 `/compact` 压缩对话**
3. 压缩时保留:当前 Issue 上下文、`GLOBAL_STATE.md``PROJECT_CHARTER.md`、Agent 角色定义
4. 压缩后从摘要恢复上下文,继续当前任务
## 环境要求
开始工作前,确认以下环境变量已设置:
@@ -84,6 +91,8 @@ python scripts/agent_poller.py --action list
python scripts/agent_poller.py --action list --labels acceptance-failure
```
**Label 优先原则**Issue 的 label 反映创建者(尤其是人类)的显式意图,Agent 必须尊重。`test-code` → QE-Agent 域,`product-code` → Dev-Agent 域。即使内容看似不在自身常规范围(如基础设施、agent 配置),只要 label 指定了自己的域就必须 pick up。Label 与内容冲突时,先 pick up 并评论确认,不直接跳过。
### Step 2: 领取并分析 Issue
```bash
@@ -102,22 +111,16 @@ python scripts/agent_poller.py --action comment --issue <N> --body "QE-Agent 已
### Step 3: 实施测试
#### 3.1 确保代码最新
#### 3.1 确保代码最新并创建分支
```bash
git checkout main
git pull origin main
```
#### 3.2 创建分支
```bash
git checkout -b test/issue-<N>
git fetch origin
git checkout -b test/issue-<N> origin/main
```
分支命名规则:`test/issue-<N>``test/issue-<N>-<简短描述>`
#### 3.3 编写测试代码
#### 3.2 编写测试代码
测试代码在 `tests/acceptance/` 目录下。现有结构:
@@ -139,7 +142,7 @@ tests/acceptance/
- Layer B 覆盖率测试不需要 LLM API
- Layer C QE 审计需要 `deepseek-v4-flash` API
#### 3.4 本地验证
#### 3.3 本地验证
```bash
# 跑全部验收测试(需要 LLM API)
+17 -18
View File
@@ -21,37 +21,36 @@ fi
# ── Worktree isolation ─────────────────────────────────────────────────────────
GITEA_WORKTREE_DIR="${GITEA_WORKTREE_DIR:-$HOME/.gitea/worktrees}"
_WORKTREE_PATH=""
setup_worktree() {
local user="$1"
local worktree="$GITEA_WORKTREE_DIR/$user"
local ts
ts="$(date +%Y%m%d-%H%M%S)"
local worktree="$GITEA_WORKTREE_DIR/$user/$ts"
# 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
# Ensure origin/main is current so worktree starts from latest
git -C "$_MAIN_REPO_DIR" fetch origin main 2>/dev/null || true
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
echo "Creating worktree: $worktree (detached from origin/main)"
mkdir -p "$(dirname "$worktree")"
git -C "$_MAIN_REPO_DIR" worktree add --detach "$worktree" origin/main
touch "$worktree/.gitea-worktree"
PROJECT_DIR="$worktree"
_WORKTREE_PATH="$worktree"
cd "$PROJECT_DIR"
}
cleanup_worktree() {
local user="$1"
local worktree="$GITEA_WORKTREE_DIR/$user"
if [ -d "$worktree" ]; then
local worktree="${_WORKTREE_PATH:-}"
if [ -z "$worktree" ] || [ ! -f "$worktree/.gitea-worktree" ]; then
echo "No worktree to clean up (not created by this session)."
return 0
fi
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
git -C "$_MAIN_REPO_DIR" worktree remove --force "$worktree" 2>/dev/null || true
}
# ── Validate required environment ──────────────────────────────────────────────
+18 -1
View File
@@ -21,6 +21,13 @@ import sys
import urllib.request
import urllib.error
# Fix Windows GBK encoding: emoji and Chinese characters from Gitea API
# crash print() under the default Windows code page.
try:
sys.stdout.reconfigure(encoding='utf-8')
except Exception:
pass
def _load_gitea_config():
"""Load Gitea URL, repo, and token from ~/.gitea/config.yaml or env vars."""
config_path = os.path.expanduser("~/.gitea/config.yaml")
@@ -173,7 +180,7 @@ def blocked_check():
print(f"Checked {len(all_blocked)} blocked issue(s): still blocked.")
def get_issue(num):
def get_issue(num, with_comments=True):
i = _req("GET", f"/issues/{num}")
print(f"## #{i['number']}: {i['title']}")
print(f"State: {i['state']}")
@@ -181,6 +188,16 @@ def get_issue(num):
print(f"Labels: {', '.join(labels) if labels else 'none'}")
print()
print(i.get("body", "(no description)"))
if with_comments:
comments = _req_safe("GET", f"/issues/{num}/comments")
if comments:
print(f"\n--- Comments ({len(comments)}) ---")
for c in comments:
user = c.get("user", {}).get("login", "unknown")
created = c.get("created_at", "")[:16]
body = c.get("body", "")
print(f"\n[{user}] {created}")
print(body)
return i
+2 -4
View File
@@ -19,15 +19,13 @@ source "$SCRIPT_DIR/_common.sh"
setup_worktree "$GITEA_USER"
# Cleanup worktree on exit (optional, comment out to keep for debugging)
trap 'cleanup_worktree "$GITEA_USER"' EXIT
trap 'cleanup_worktree' EXIT
banner "Dev"
require_token
AGENT_CONF="$_MAIN_REPO_DIR/.claude/agents/dev-agent.md"
launch_agent \
"dev-agent" \
"$AGENT_CONF" \
"$PROJECT_DIR/.claude/agents/dev-agent.md" \
"Dev-Agent" \
"执行一次 Issue 巡检(单次任务,不要用 /loop):
1. python scripts/agent_poller.py --action list 列出所有打开的 Issue
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
# Generic session 启动脚本 — 为人类用户提供 worktree 隔离
# 用法: bash scripts/start_generic.sh
# GITEA_USER 默认 pzhangzywl(人类用户),可通过环境变量覆盖
set -eu
export GITEA_USER="${GITEA_USER:-pzhangzywl}"
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
source "$SCRIPT_DIR/_common.sh"
setup_worktree "$GITEA_USER"
trap 'cleanup_worktree' EXIT
banner "Generic"
require_token
echo "工作目录: $PROJECT_DIR"
echo ""
cd "$PROJECT_DIR"
claude
+2 -4
View File
@@ -19,15 +19,13 @@ source "$SCRIPT_DIR/_common.sh"
setup_worktree "$GITEA_USER"
# Cleanup worktree on exit (optional, comment out to keep for debugging)
trap 'cleanup_worktree "$GITEA_USER"' EXIT
trap 'cleanup_worktree' EXIT
banner "QE"
require_token
AGENT_CONF="$_MAIN_REPO_DIR/.claude/agents/qe-agent.md"
launch_agent \
"qe-agent" \
"$AGENT_CONF" \
"$PROJECT_DIR/.claude/agents/qe-agent.md" \
"QE-Agent" \
"执行一次 Issue 巡检(单次任务,不要用 /loop):
1. python scripts/agent_poller.py --action list --labels test-code 检查 test-code Issue