{"record":{"id":"fa157168b3c09e38","repo":"paperclipai/paperclip","slug":"review-unavailable-taskchatcomposer","errorCode":null,"errorMessage":"Review unavailable","messagePattern":"Review unavailable","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ui/src/components/task-chat/TaskChatComposer.tsx","lineNumber":1072,"sourceCode":"  useEffect(() => {\n    if (!uncertainSubmission || !confirmedSubmissionIds?.has(uncertainSubmission.attemptId)) return;\n    const nextDraft = uncertainSubmission.nextDraftOffset === undefined\n      ? \"\" : bodyRef.current.slice(uncertainSubmission.nextDraftOffset);\n    if (draftKey) settleDraftSubmission(draftKey, uncertainSubmission.attemptId, nextDraft);\n    setUncertainSubmission(null);\n    bodyRef.current = nextDraft;\n    setBody(nextDraft);\n    const submittedIds = uncertainSubmission.submittedAttachmentIds;\n    setAttachments(current => submittedIds\n      ? current.filter(item => !item.attachmentId || !submittedIds.includes(item.attachmentId))\n      : []);\n  }, [confirmedSubmissionIds, draftKey, uncertainSubmission]);\n\n  async function reviewUncertainSubmission() {\n    if (!uncertainSubmission) return;\n    setReviewError(false);\n    try {\n      if (!onReviewConversation) throw new Error(\"Review unavailable\");\n      await onReviewConversation();\n      if (mountedTaskKey.current !== draftKey) return;\n      const reviewed = { ...uncertainSubmission, reviewed: true };\n      setUncertainSubmission(reviewed);\n      if (\n        draftKey &&\n        loadDraftSubmission(draftKey)?.attemptId === reviewed.attemptId\n      )\n        saveDraftSubmission(draftKey, reviewed);\n    } catch {\n      setReviewError(true);\n    }\n  }\n\n  function discardUncertainDraft() {\n    if (!uncertainSubmission?.reviewed) return;\n    if (draftKey) clearDraft(draftKey, uncertainSubmission.attemptId);\n    bodyRef.current = \"\";","sourceCodeStart":1054,"sourceCodeEnd":1090,"githubUrl":"https://github.com/paperclipai/paperclip/blob/3f1d897a7c018d76563a21c6e39c3c9b03933622/ui/src/components/task-chat/TaskChatComposer.tsx#L1054-L1090","documentation":"TaskChatComposer's `reviewUncertainSubmission` throws this when invoked but the `onReviewConversation` prop is undefined. Like IssueChatThread's equivalent, the composer cannot trigger the review conversation itself; the catch sets `reviewError` to show an inline error near the uncertain submission card.","triggerScenarios":"An uncertain submission is displayed and the user clicks review, while the parent rendered TaskChatComposer without `onReviewConversation` (or passed it conditionally and the condition was false).","commonSituations":"Parent pages that wire submission but not the review callback; feature-flagged review flow where the flag off leaves the prop undefined while the card still renders.","solutions":["Provide `onReviewConversation` whenever uncertain submissions can render in TaskChatComposer.","Hide the review affordance (or the uncertain card) when the prop is absent.","Trace the parent component to confirm the conditional passing of the callback is correct."],"exampleFix":"// before\n<TaskChatComposer onSubmit={submit} uncertainSubmission={u} />\n// after\n<TaskChatComposer onSubmit={submit} uncertainSubmission={u} onReviewConversation={review} />","handlingStrategy":"try-catch","validationCode":"if (typeof onReviewConversation !== 'function') return; // hide review affordance","typeGuard":"const isReviewable = (p: unknown): p is () => Promise<void> => typeof p === 'function';","tryCatchPattern":"try { await onReviewConversation(); } catch { setReviewError(true); }","preventionTips":["Make the review callback required wherever uncertainSubmission can be set.","Hide review UI when the prop is missing.","Add a unit test for the missing-prop render path."],"tags":["react","missing-prop","ui"],"backgroundTag":"missing-required-argument","analyzedSha":"3f1d897a7c018d76563a21c6e39c3c9b03933622","analyzedAt":"2026-09-18T08:03:59.046Z","contentChangedAt":"2026-09-18T08:03:59.046Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}