openspec new change prints Schema: spec-driven even when config.yaml selects a custom schema
维护者通常 2 天内回复
已经有一个关联 PR 被合并了。
- #2120 来自 @surlymochan —— 已合并
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 84/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript, yaml
- 领域
- cli
调研方向
从 src/commands/workflow/new-change.ts 以及 src/core/root-selection.ts 中的 schema 选择路径开始;将其与 src/commands/workflow/instructions.ts 中的配置读取路径进行比较。验证当 openspec/config.yaml 选择自定义 schema 时,.openspec.yaml 中显示的 schema 和持久化保存的 schema,包括没有 override 时的 fallback 检查。
由索引模型根据 Issue 内容生成。
描述
Version
1.14.3 (also present on main @ c794978f)
What happens
With schema: <custom-schema> set in openspec/config.yaml, openspec new change <id> prints
Schema: spec-driven
even though artifact resolution (instructions, status) correctly uses the custom schema.
Why (two root causes)
src/commands/workflow/new-change.tscomputes the resolved value but persists the raw flag instead:
146: const resolvedSchema = options.schema ?? root.defaultSchema; // spinner only
152: schema: options.schema, // undefined when no --schema
- Fixing line 152 alone is not enough:
root.defaultSchemais hardcoded to'spec-driven'and never reflectsconfig.yaml:
// src/core/root-selection.ts:66 (type at :64, same literal at :127)
defaultSchema: 'spec-driven',
The schema configured in config.yaml is only reachable via readProjectConfig(projectRoot)?.schema, the route instructions.ts already takes.
Fix
Resolve from the project config and persist the resolved value:
const projectConfig = readProjectConfig(projectRoot);
const resolvedSchema = options.schema ?? projectConfig?.schema ?? root.defaultSchema;
...
schema: resolvedSchema,
Cosmetic only, but it misleads agents (and humans) auditing which schema a change was created under; I hit exactly that during a custom-schema run. A version-pinned patch with this fix (verified end to end: JSON payload, persisted .openspec.yaml, and text output) lives at https://github.com/cabi/openspec-cdd (patches/ + smoke test S26).
- 主要语言
- TypeScript
- 星标
- 72.3k
- 派生
- 4.9k
- 平均合并
- 2 天 10 小时
- 30 天内合并 PR
- 72
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Fission-AI/OpenSpec 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
Fission-AI/OpenSpec#2138 ·
维护者通常 2 天内回复
-
Triple-backtick inline code at line start opens a phantom code fence and hides the rest of the spec可能已有人在做 @kevin9327 于 5 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
Fission-AI/OpenSpec#2130 ·
维护者通常 2 天内回复
-
enhancement needs-triage
难度 2/5 1-3 小时 新手友好度 68/100
Fission-AI/OpenSpec#2105 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
Fission-AI/OpenSpec#1966 · 1 条评论 ·
维护者通常 2 天内回复
-
feat(schemas): open each proposal with a short review focus可能已有人在做 @GaoSSR 于 36 天前认领。 未关闭design-review
难度 1/5 1-3 小时 新手友好度 90/100
Fission-AI/OpenSpec#1908 ·
维护者通常 2 天内回复
查看 Fission-AI/OpenSpec 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
awesome-dsh-plugin/awesome-dsh-plugin#9184 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
farion1231/cc-switch#8829 ·
维护者通常 1 天内回复
-
[core-client] Remove unused hand-maintained transport helpers after the definition-table cutover未关闭doc-audit enhancement
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100