Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

openspec new change prints Schema: spec-driven even when config.yaml selects a custom schema

Đã đóng Phù hợp với người mới
#2,117 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Một pull request liên quan đã được merge.

  • #2120 của @surlymochan — đã merge

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
84/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript, yaml
Lĩnh vực
cli

Hướng nghiên cứu

Bắt đầu với src/commands/workflow/new-change.ts và đường dẫn chọn schema trong src/core/root-selection.ts; so sánh với đường dẫn đọc cấu hình trong src/commands/workflow/instructions.ts. Xác minh cả schema được hiển thị và schema được lưu vào .openspec.yaml khi openspec/config.yaml chọn một schema tùy chỉnh, bao gồm cả kiểm tra fallback khi không có override.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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)

  1. src/commands/workflow/new-change.ts computes 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
  1. Fixing line 152 alone is not enough: root.defaultSchema is hardcoded to 'spec-driven' and never reflects config.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).

Ngôn ngữ chính
TypeScript
Star
72.3k
Fork
4.9k
Merge trung bình
2 ngày 10 giờ
Pull request đã merge (30 ngày)
72

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Fission-AI/OpenSpec

Tất cả issue của Fission-AI/OpenSpec

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.