Scaffolded templates put @ref LLP comments above the frontmatter, silently killing every key (alwaysRun, model, description)
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- typescript
调研方向
从 src/config/load.ts:386 的 parseFrontmatter 开始,检查 templates/ 下的四个文件,然后跟踪 src/config/load.ts:173-175 中的使用情况,以及 src/core/prompts.ts:726 中的描述渲染。完成标准是:新 scaffold 的仓库保留 templates 的 frontmatter 键,并有一个回归测试断言每个随附的 template 都能被解析为非空键集合。
由索引模型根据 Issue 内容生成。
描述
Summary
Every markdown template we ship starts with an @ref LLP … HTML comment placed above the opening ---. The frontmatter parser requires --- at byte 0, so in a freshly scaffolded repo the frontmatter of the coordinator and all three agents parses as nothing at all. Every key is silently dropped — no error, no warning, no doctor complaint.
Found while scaffolding expo/expo with 0.10.0.
Root cause
src/config/load.ts:386:
export function parseFrontmatter(md: string): { data: Record<string, string>; body: string } {
if (!md.startsWith("---")) {
return { data: {}, body: md };
}
Any leading byte — including a comment we ourselves put there — returns { data: {} } and hands the whole file back as body.
All four shipped templates trip it:
$ for f in templates/coordinator.md templates/agents/*.md; do printf "%-40s %s\n" "$f" "$(head -c 3 "$f")"; done
templates/coordinator.md <!-
templates/agents/consistency.md <!-
templates/agents/correctness.md <!-
templates/agents/security.md <!-
Impact
Consumed at src/config/load.ts:173-175, so the dropped keys fall back to defaults:
| Template | Key lost | Consequence |
|---|---|---|
agents/security.md |
alwaysRun: true |
The security agent stops being always-run. It is now only included when the router happens to pick it. |
agents/security.md |
model: anthropic/claude-opus-5 |
Security reviews run on the config default instead of Opus. |
coordinator.md |
model: anthropic/claude-opus-5 |
Consolidation and the final decision run on the default model. |
| all three agents | description |
The router prompt renders (no description) for every agent — see src/core/prompts.ts:726. Routing has nothing to discriminate on. |
alwaysRun is the serious one: src/config/load.ts:174 tests the value against "", so it becomes false, and the guarantee that security always reviews every PR is quietly gone.
Reproduction
Scaffold a fresh repo and run any review. Observed on a real run against expo/expo PR #48510:
[coordinator] started claude-sonnet-5
Models used — … coordinator: anthropic/claude-sonnet-5
despite model: anthropic/claude-opus-5 sitting in coordinator.md.
Why it went unnoticed
This repo's own .expo-code-review/ files are correct — they start with ---. So do the hand-tuned configs in expo/eas-cli and brentvatne/euxy. Only a freshly scaffolded repo gets the broken shape, and the failure is silent, so nothing surfaces it.
Suggested fix
- Move the
@ref LLPannotations intemplates/coordinator.mdandtemplates/agents/*.mdto below the closing---, or into the frontmatter as#comment lines (the parser already allows those). - Consider making
parseFrontmattertolerate leading whitespace and HTML comments before the delimiter. It is a small change and stops this whole class of silent misconfiguration for adopters who add a license header or a comment of their own. - Add a
doctorcheck: if a prompt file contains a line matching^(description|alwaysRun|model|temperature):that the parser did not pick up, fail with a pointer to the delimiter. This is the check that would have caught it.
A regression test asserting that every shipped template's frontmatter parses to a non-empty key set would keep it from coming back.
- 主要语言
- TypeScript
- 星标
- 4
- 派生
- 0
- 平均合并
- 2 天 11 小时
- 30 天内合并 PR
- 3
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
expo/code-review-cli 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 48/100
expo/code-review-cli#55 ·
-
难度 4/5 3-5 天 新手友好度 48/100
expo/code-review-cli#54 ·
-
难度 4/5 3-5 天 新手友好度 55/100
expo/code-review-cli#53 ·
-
难度 5/5 一周以上 新手友好度 35/100
expo/code-review-cli#36 ·
查看 expo/code-review-cli 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
pingdotgg/t3code#24900 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
inu-appcenter/UNIDorm-web#411 ·
维护者通常 1 天内回复
-
🐛 bug
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
ranxianglei/billion-context#4720 ·
维护者通常 1 天内回复
-
area:arcade game p3-medium ready-for-agent type:bug
难度 2/5 1-3 小时 新手友好度 82/100
fderuiter/deruiter.dev#2840 ·
维护者通常 1 天内回复