bug: branch_name 去空白后通过校验,但下游仍用原始值创建 PR

Open Beginner friendly
#369 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
ci-cd

Research direction

The validator .github/scripts/validate_implementation_output.py strips branch_name only for the target_branch comparison (lines 38-47) and returns raw metadata at line 58. Read it alongside .github/scripts/commit_implementation_branch.py:192 (which strips) and .github/scripts/finalize_implementation_pr.py:79 (which does not), then normalize once so all three agree. Add a whitespace-padded branch_name case to test_validate_implementation_output.py; done means the returned metadata carries the stripped name and the new test passes.

Written by the indexing model from the issue text.

Description

area:tests area:workflow bug repro:high triaged

问题位置

.github/scripts/validate_implementation_output.py:38

触发条件

实现代理在 standalone 实现分支模式下,把 pr-metadata.json 的 branch_name 写成带前导或尾随空白的字符串,例如 " spec/implement-issue-18 "。

实际影响

校验器先 strip 再与 target_branch 比较,因此放行;commit_implementation_branch.py 也会 strip 后成功推送分支,但 finalize_implementation_pr.py 使用未清理的 branch_name 查询或创建 PR,找不到已推送分支,最终无法生成或更新 implementation PR。

核实依据

validate_implementation_output.py 第 38-47 行只把 strip 后的值用于比较,第 58 行返回原始 metadata,main 没有回写;commit_implementation_branch.py 第 192 行对 branch 做 strip,而 finalize_implementation_pr.py 第 79 行直接使用 metadata 中的 branch_name 调用 open_pr_for_branch 或 create_pr。现有 test_validate_implementation_output.py 只覆盖无空白 branch_name。

扫描提交:e777f60106e401b086925270af317a4b36722be0;扫描日期:2026-11-24(北京时间);轮巡分片:54/90。

Dominant language
Python
Stars
171
Forks
24
Avg merge
3h 13m
Merged PRs (30d)
13

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Terry-Mao/AICodingFlow

All issues in Terry-Mao/AICodingFlow

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.