bug: spec 文件读取把所有非 404 API 错误静默当作文件缺失
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
Research direction
Start with .github/scripts/write_spec_context.py around fetch_file_content and run_gh_json, then read resolve_spec_context and the implementation context resolver that reuses it. Check how the existing test_missing_file_returns_none handles API errors and distinguish a missing file from other failures. Done means non-404 API errors are surfaced instead of silently treated as missing, with tests covering both cases.
Written by the indexing model from the issue text.
Description
问题位置
.github/scripts/write_spec_context.py:103
触发条件
存在 approved spec PR 或目录 spec 时,GitHub Contents API 对 gh api 返回 403、429、认证失败或 5xx 等非 404 错误。
实际影响
fetch_file_content 会返回 None,使 approved spec 被误判为不存在并回退到旧目录 spec 或空上下文;review 会跳过应有的 spec 一致性检查,implementation 也可能在没有 approved spec 的情况下继续。
核实依据
run_gh_json 使用 check=True,任何非成功 HTTP 状态都会抛出 CalledProcessError;第 101-104 行却把全部异常统一转换为文件缺失。resolve_spec_context 第 168-180 行因此静默降级,prepare_issue_implementation_context.resolve_implementation_spec_context 也复用同一逻辑且仅在存在未批准 PR 时 noop。test_missing_file_returns_none 用通用 CalledProcessError 固化了这一行为,未区分 404 与其他 API 故障。
扫描提交:e777f60106e401b086925270af317a4b36722be0;扫描日期:2026-12-02(北京时间);轮巡分片:62/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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Terry-Mao/AICodingFlow
-
area:tests area:workflow bug repro:high triaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Terry-Mao/AICodingFlow#377 · 1 comment ·
Maintainers usually reply within 1 day
-
area:tests area:workflow bug repro:high triaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Terry-Mao/AICodingFlow#372 · 1 comment ·
Maintainers usually reply within 1 day
-
area:tests area:workflow bug repro:high triaged
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Terry-Mao/AICodingFlow#371 · 1 comment ·
Maintainers usually reply within 1 day
-
area:tests area:workflow bug repro:high triaged
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Terry-Mao/AICodingFlow#369 · 1 comment ·
Maintainers usually reply within 1 day
-
area:tests area:workflow bug repro:high triaged
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Terry-Mao/AICodingFlow#368 · 1 comment ·
Maintainers usually reply within 1 day
All issues in Terry-Mao/AICodingFlow
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 69/100
anderspitman/awesome-tunneling#330 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
521xueweihan/HelloGitHub#4676 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Maintainers usually reply within 18 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
pandas-dev/pandas-stubs#2155 ·
Maintainers usually reply within 1 day
-
essreduce
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
Maintainers usually reply within 1 day