- conftest.py: secrets 路径改为多位置查找 (QE_SECRETS_PATH env → ~/.openclaw/config/ → workspace-document-analyzer/config/) - conftest.py: IR 默认路径改为 output/final/ir_final.json (匹配 config.IR_FINAL_JSON) - conftest.py: parsed 默认路径改为项目相对路径 - agent_poller.py: 添加 --labels 过滤 (向后兼容) - 新增 agents/QE_AGENT.md + scripts/start_qe_agent.sh
This commit is contained in:
+16
-8
@@ -1,10 +1,11 @@
|
||||
"""Helper for dev agent to interact with Gitea issues and PRs.
|
||||
"""Helper for QE/Dev agents to interact with Gitea issues and PRs.
|
||||
|
||||
Usage:
|
||||
python scripts/agent_poller.py --action list
|
||||
python scripts/agent_poller.py --action list --labels test-dev
|
||||
python scripts/agent_poller.py --action get --issue 1
|
||||
python scripts/agent_poller.py --action comment --issue 1 --body "Working on this"
|
||||
python scripts/agent_poller.py --action create-pr --issue 1 --branch fix/issue-1
|
||||
python scripts/agent_poller.py --action create-pr --issue 1 --branch test/issue-1
|
||||
python scripts/agent_poller.py --action pr-status --pr 4
|
||||
python scripts/agent_poller.py --action merge-pr --pr 4
|
||||
python scripts/agent_poller.py --action close-issue --issue 2 --body "Done"
|
||||
@@ -45,14 +46,19 @@ def _req(method, path, data=None):
|
||||
|
||||
# ── Issue operations ─────────────────────────────────────────────────────────
|
||||
|
||||
def list_issues():
|
||||
issues = _req("GET", "/issues?state=open")
|
||||
def list_issues(labels: list[str] | None = None):
|
||||
url = "/issues?state=open"
|
||||
if labels:
|
||||
for lb in labels:
|
||||
url += f"&labels={lb}"
|
||||
issues = _req("GET", url)
|
||||
if not issues:
|
||||
print("No open issues found.")
|
||||
label_hint = f" (filtered by {labels})" if labels else ""
|
||||
print(f"No open issues found{label_hint}.")
|
||||
return []
|
||||
for i in issues:
|
||||
labels = [l["name"] for l in i.get("labels", [])]
|
||||
print(f"#{i['number']} [{', '.join(labels) if labels else 'no label'}] {i['title']}")
|
||||
issue_labels = [l["name"] for l in i.get("labels", [])]
|
||||
print(f"#{i['number']} [{', '.join(issue_labels) if issue_labels else 'no label'}] {i['title']}")
|
||||
return issues
|
||||
|
||||
|
||||
@@ -200,6 +206,7 @@ def main():
|
||||
parser.add_argument("--pr", type=int)
|
||||
parser.add_argument("--branch")
|
||||
parser.add_argument("--body")
|
||||
parser.add_argument("--labels", help="Comma-separated labels to filter issues (for 'list' action)")
|
||||
args = parser.parse_args()
|
||||
|
||||
if not GITEA_TOKEN:
|
||||
@@ -208,7 +215,8 @@ def main():
|
||||
sys.exit(1)
|
||||
|
||||
if args.action == "list":
|
||||
list_issues()
|
||||
label_filter = [l.strip() for l in args.labels.split(",") if l.strip()] if args.labels else None
|
||||
list_issues(label_filter)
|
||||
elif args.action == "get":
|
||||
if not args.issue:
|
||||
print("--issue is required for 'get' action", file=sys.stderr)
|
||||
|
||||
Reference in New Issue
Block a user