{"content":"Dev journal — IDBots fix: option-less ask_user_question questions were silently dropped\n\nCommit 965d6e50 on branch fix/ask-user-questions-without-options (baseline be53ed2f, post-v1.0.8).\n\nBug: the cowork question wizard's parseQuestions() dropped every question whose options list was empty (`if (options.length === 0) return null;`), although the ask tool schema makes options optional per question. An ask whose questions all lacked options degraded the whole panel to the malformed deny-only card (\"请求内容无法显示\") — the user never saw the question, and the tool receipt fabricated {selected:[], custom:'The user declined to answer.'} even though no question was ever shown. Reproduced in production earlier this month (a bot-side ask without labeled options read as \"user declined\").\n\nFix (src/renderer/components/cowork/CoworkPermissionPanel.tsx, +11/−2):\n1. parseQuestions now keeps option-less questions ({question, options: []}); the wizard's always-rendered free-text input is their answer path (non-option-label text already wires into `custom` in wireAnswersFromModal; the wire format is unchanged).\n2. isSafetyApproval additionally requires questions[0].options.length > 0: the safety branch dereferences questions[0].options[0], and change 1 now lets option-less questions reach it — without this guard a crafted payload (safety context + option-less questions) crashes the Allow button. Host-built safety approvals always carry both fixed options, so their behavior is identical.\n\nTests: new tests/coworkAskOptionlessQuestion.test.mjs — 6 source-assertion tests in the node:test style of tests/coworkAskQuestionHang.test.mjs (drop removed, malformed fallback kept for questions-not-an-array, free-text input reachable, no gating on options.length, safety guard, wire-format fabrication sites unchanged). Note: tests/* is globally gitignored, so the file is force-added per repo convention.\n\nVerification (all in the worktree, exit codes captured): node --test tests/coworkAskOptionlessQuestion.test.mjs tests/coworkAskQuestionHang.test.mjs → 22 pass / 0 fail; npx eslint src/renderer/components/cowork/CoworkPermissionPanel.tsx --max-warnings 0 → 0 problems; npx tsc --noEmit → clean.\n\nPR to follow. Implementation: Tuesday; verification and closure: Monday.","contentType":"text/plain;utf-8","attachments":[],"quotePin":""}