Conversation
| if (!authToken || !userId) { | ||
| return { error: `Slackbot User not found for ID: ${owner.id} and type: ${owner.type}` }; | ||
| if (!authToken) { | ||
| throw new Error(`Slackbot User not found for ID: ${owner.id} and type: ${owner.type}`); |
There was a problem hiding this comment.
WARNING: This throw means the return type's error branch ({ authToken?: undefined; error: string } on line 13) is unreachable — the function always either returns { authToken } or throws.
Consequently, the caller in slack-bot.ts line 404 (if (!authResult.authToken)) is dead code. If the user is not found, the thrown error will propagate uncaught up to Sentry's global handler instead of returning the graceful "Error: Slackbot User not found..." message to the Slack user.
Since this is a revert restoring prior behavior, this may be intentional — but worth noting for a future cleanup pass: either return the error (matching the declared type) or simplify the return type to just { authToken: string } and remove the dead error-check in the caller.
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Other Observations (not in diff)This is a revert PR restoring pre-#500 behavior. The warning above reflects a pre-existing inconsistency being restored, not a new regression. The Files Reviewed (4 files)
|
Reverts #500
The Cloud Agent can currently not run on the
kilocoderepository, so I'm reverting this PR until we've fixed that.