Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

clarify_user duplicate question ids can overwrite answers

Open Beginner friendly
#184 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
cli, tooling

Research direction

Look for the clarify_user function and its handling of question IDs, likely in a file related to the TUI or user interaction. The bug is in a Map storing answers by ID. Find the test mentioned to understand the expected behavior. The fix involves validating IDs for uniqueness and generating defaults for omitted ones. Run the core questionnaire regression test to verify the fix.

Written by the indexing model from the issue text.

Description

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

Dominant language
TypeScript
Stars
54
Forks
20
Avg merge
4h 1m
Merged PRs (30d)
12

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stepfun-ai/Step-Code

All issues in stepfun-ai/Step-Code

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.