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_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" }] }
]
}
- 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
What happened?
clarify_useraccepts duplicate question IDs, but the native TUI stores answers in aMap<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 cleanmain @ adcf37bin 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
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" }] } ] }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