ask: multi-select answers with "Other" text drop the checked options #216
Labels
No labels
Agent
Ignore
Agent
In Progress
Agent
Planned
Agent
Planning
Agent
Ready
Agent
Triage
Compat
Breaking
Kind
Bug
Kind
Documentation
Kind
Enhancement
Kind
Feature
Kind
Security
Kind
Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lucas/omp-deck#216
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
In an
askquestion withmulti: true, if the user checks several options and also types custom text into "Other (type your own)", the agent receives only the custom text and acts as if nothing else was selected.Root cause (verified): the web dialog sends everything correctly.
apps/web/src/components/chat/AskDialog.tsxsubmitAllsendsvalues = [...checked, otherText].createDeckAskToolinapps/server/src/bridge/deck-tools.tsalso splits that correctly intoselectedOptions+customInput. But the LLM-facingresponseTextusescustomInput ? \Custom: ${customInput}` : selectedOptions.join(", ")in both the multi-question branch (~L287) and the single-question branch (~L292–294). That ternary discardsselectedOptionswhenever custom text exists.detailskeeps both, so the tool card (apps/web/src/components/tools/Ask.tsx`) displays correctly and hides the bug.Plan
Context
Make the agent-facing ask result include both the checked options and the custom text. The format is
selected: A, B; custom: <text>. An empty part is left out.Approach
apps/server/src/bridge/deck-tools.ts, add an exported pure function abovecreateDeckAskTool:selectedOptions.length > 0push`selected: ${selectedOptions.join(", ")}`; ifcustomInput(non-empty after trim) push`custom: ${customInput}`; returnparts.join("; ")."". This cannot happen for answered dialogs, because the dialog refuses to submit an empty answer, so no special handling is needed.createDeckAskTool.execute, replace both ternaries:`${r.question}: ${formatAskAnswer(r.selectedOptions, r.customInput)}``${details.question}: ${formatAskAnswer(details.selectedOptions ?? [], details.customInput)}`Leave
buildResult,details, and the web UI unchanged.Critical files & anchors
apps/server/src/bridge/deck-tools.ts:createDeckAskTool, response-text block (~L282–296).Verification
apps/server/src/bridge/deck-tools.test.ts(bun:test, same style as other*.test.tsinapps/server/src/bridge/) with cases forformatAskAnswer:(["A","B"], "foo")→"selected: A, B; custom: foo"(["A"], undefined)→"selected: A"([], "foo")→"custom: foo"bun test apps/server/src/bridge/deck-tools.test.tsfrom the repo root, then the typecheck the repo already uses.askwithmulti: true, check two options, and type text in Other. The tool result text should read<question>: selected: X, Y; custom: <text>.