{"record":{"id":"6bc54955b50ce55a","repo":"gitbutlerapp/gitbutler","slug":"textfromtoolresult-result-reviewapp","errorCode":null,"errorMessage":"${textFromToolResult(result)}","messagePattern":"\\$\\{textFromToolResult\\(result\\)\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/but-mcp-app/src/ReviewApp.tsx","lineNumber":346,"sourceCode":"\t\t\treturn;\n\t\t}\n\n\t\tconst reviewNumbers = view.reviews.filter(shouldPollReview).map((review) => review.number);\n\t\tif (reviewNumbers.length === 0) return;\n\n\t\tlet cancelled = false;\n\n\t\tasync function refreshReviews() {\n\t\t\ttry {\n\t\t\t\tconst result = await app?.callServerTool({\n\t\t\t\t\tname: \"gitbutler_refresh_reviews\",\n\t\t\t\t\targuments: {\n\t\t\t\t\t\trepository: view?.repository.path,\n\t\t\t\t\t\treviewNumbers,\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t\tif (cancelled || result === undefined) return;\n\t\t\t\tif (result.isError) throw new Error(textFromToolResult(result));\n\t\t\t\tconst refreshed = reviewViewFromToolResult(result);\n\t\t\t\tif (refreshed === null) {\n\t\t\t\t\tthrow new Error(\"The refreshed reviews were missing from the response.\");\n\t\t\t\t}\n\t\t\t\tsetView((current) => (current === null ? current : mergeReviewViews(current, refreshed)));\n\t\t\t} catch (pollCause) {\n\t\t\t\tif (cancelled) return;\n\t\t\t\tsetPollingError(\n\t\t\t\t\tpollCause instanceof Error ? pollCause.message : \"Could not refresh CI status.\",\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tconst timeout = window.setTimeout(() => void refreshReviews(), REVIEW_POLL_INTERVAL_MS);\n\t\treturn () => {\n\t\t\tcancelled = true;\n\t\t\twindow.clearTimeout(timeout);\n\t\t};","sourceCodeStart":328,"sourceCodeEnd":364,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/packages/but-mcp-app/src/ReviewApp.tsx#L328-L364","documentation":"The polling refresh in the MCP review app rethrows the server tool's own error: the gitbutler_refresh_reviews tool returned a result flagged isError, and textFromToolResult extracts the embedded message. It means the backend refresh of the polled review numbers failed (e.g. GitHub API or auth problem), with the precise cause carried in the tool-result text.","triggerScenarios":"Thrown at packages/but-mcp-app/src/ReviewApp.tsx:346 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the embedded tool-result text - it carries the backend's reason for the failed refresh","Verify GitHub authentication and repository permissions for the review's repo","Let the next polling tick retry the refresh; restart the app if errors persist"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"58e5313667b857ef39a730e380af31816a7b1768","analyzedAt":"2026-09-18T06:50:32.052Z","contentChangedAt":"2026-09-18T06:50:32.052Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}