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

clarify_user duplicate question ids can overwrite answers

Đang mở Phù hợp với người mới
#184 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 1 ngày

Chưa có ai nhận issue này.

Đá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
75/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
Lĩnh vực
cli, tooling

Hướng nghiên cứu

Tìm kiếm hàm clarify_user và cách xử lý ID câu hỏi của nó, có thể trong một tệp liên quan đến TUI hoặc tương tác người dùng. Lỗi nằm trong một Map lưu trữ câu trả lời theo ID. Tìm bài kiểm tra được đề cập để hiểu hành vi mong đợi. Bản sửa lỗi liên quan đến việc xác thực ID cho tính duy nhất và tạo giá trị mặc định cho những ID bị bỏ qua. Chạy bài kiểm tra hồi quy bảng câu hỏi cốt lõi để xác minh bản sửa lỗi.

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

Mô tả

area/tools bug
What happened?

clarify_user accepts duplicate question IDs, but the native TUI stores answers in a Map<id, answer>. Two questions with the same ID therefore share one answer slot.

After answering the first duplicate ID, allAnswered() also sees the second question as answered, so the dialog can submit early and the final result contains only one answer. I reproduced this on clean main @ adcf37b in a core questionnaire regression test, without external extensions.

I have a local fix and tests ready: explicit duplicate IDs are rejected, while omitted IDs keep deterministic q1/q2/... defaults and avoid collisions with explicit IDs. I would like to submit a PR if this behavior is preferred.

Steps to reproduce
  1. Call clarify_user with two questions using the same ID:
    {
      "questions": [
        { "id": "x", "question": "First?", "options": [{ "label": "A", "value": "a" }] },
        { "id": "x", "question": "Second?", "options": [{ "label": "B", "value": "b" }] }
      ]
    }
    
  2. Answer the first question.
  3. Switch to the submit tab.
  4. The dialog considers both questions answered and can return only one answer for ID x.
Expected behavior

Question IDs used as answer keys should be unique. Explicit duplicate IDs should not silently overwrite answers; omitted IDs may be generated deterministically.

Version

main @ adcf37b / @step-harness/coding-agent 0.84.4

Ngôn ngữ chính
TypeScript
Star
850
Fork
62
Merge trung bình
1 ngày 9 giờ
Pull request đã merge (30 ngày)
48

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

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 stepfun-ai/Step-Code

Tất cả issue của stepfun-ai/Step-Code

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.