clarify_user duplicate question ids can overwrite answers
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 75/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
clarify_user 関数とその質問IDの処理を探してください。おそらくTUIまたはユーザーインタラクションに関連するファイルにあります。バグは、IDごとに回答を格納するMapにあります。言及されているテストを見つけて、期待される動作を理解してください。修正には、IDの一意性の検証と、省略されたIDに対するデフォルト値の生成が含まれます。コアアンケートの回帰テストを実行して修正を確認してください。
索引モデルが issue の本文から書いたものです。
説明
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
- Call
clarify_userwith 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" }] } ] } - Answer the first question.
- Switch to the submit tab.
- 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
- 主要言語
- TypeScript
- スター
- 54
- フォーク
- 20
- 平均マージ
- 4時間 1分
- マージ済み PR(30日)
- 12
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
stepfun-ai/Step-Code のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
stepfun-ai/Step-Code#190 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
stepfun-ai/Step-Code#186 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
stepfun-ai/Step-Code#185 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
stepfun-ai/Step-Code#179 · コメント 1 件 ·
-
untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
stepfun-ai/Step-Code#153 · コメント 2 件 ·
stepfun-ai/Step-Code の issue をすべて見る
似ている issue
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
Crush オープン
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md オープン
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
ElementsProject/cln-application#167 · コメント 1 件 · リアクション 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Quantco/pnpm-licenses#17 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100