Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix-web-question-other-option.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Fix the web question prompt missing the free-text Other option.
10 changes: 2 additions & 8 deletions packages/agent-core/src/services/question/question.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,8 @@ function buildItem(
if (item.header !== undefined) out.header = item.header;
if (item.body !== undefined) out.body = item.body;
if (item.multiSelect !== undefined) out.multi_select = item.multiSelect;
// SDK has no `allowOther` field — `otherLabel` / `otherDescription` exist
// and we expose them on the wire alongside an inferred `allow_other: true`
// when either tag is set. (SDK semantics: presence of `otherLabel` enables
// the "Other" affordance; we surface that explicitly on the wire so client
// renderers don't have to infer.)
const hasOtherAffordance =
item.otherLabel !== undefined || item.otherDescription !== undefined;
if (hasOtherAffordance) out.allow_other = true;
// SDK has no allowOther field; always advertise the free-text Other option on the wire.
out.allow_other = true;
if (item.otherLabel !== undefined) out.other_label = item.otherLabel;
if (item.otherDescription !== undefined) out.other_description = item.otherDescription;
return out;
Expand Down
3 changes: 3 additions & 0 deletions packages/agent-core/test/services/question-adapter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ describe('question-adapter · toBrokerRequest (in-process → protocol)', () =>
expect(protoReq.questions[0]?.header).toBe('Pets');
expect(protoReq.questions[0]?.body).toBe('pick one');
expect(protoReq.questions[0]?.multi_select).toBe(false);
// Other affordance is always on, even when the SDK item has no otherLabel.
expect(protoReq.questions[0]?.allow_other).toBe(true);
expect(protoReq.questions[0]?.other_label).toBeUndefined();

expect(protoReq.questions[1]?.id).toBe('q_1');
expect(protoReq.questions[1]?.options.map((o) => o.id)).toEqual([
Expand Down
Loading