Skip to content

Comments

refactor(feedback): extract app builder Slack notifications into modules with thread support#433

Open
kiloconnect[bot] wants to merge 1 commit intomainfrom
session/agent_65312df6-235a-4168-ac13-5b1ad7ed32ae
Open

refactor(feedback): extract app builder Slack notifications into modules with thread support#433
kiloconnect[bot] wants to merge 1 commit intomainfrom
session/agent_65312df6-235a-4168-ac13-5b1ad7ed32ae

Conversation

@kiloconnect
Copy link
Contributor

@kiloconnect kiloconnect bot commented Feb 22, 2026

Summary

  • Extracts the inline Slack notification code from app-builder-feedback-router.ts into two dedicated modules:
    • src/lib/slack/internal-notifications.ts — low-level WebClient primitives (postInternalSlackMessage, postInternalSlackThreadReply)
    • src/lib/feedback/app-builder-feedback-slack.ts — app-builder-specific formatting and orchestration (notifyAppBuilderFeedback)
  • Switches from an incoming webhook (fetch + SLACK_USER_FEEDBACK_WEBHOOK_URL) to chat.postMessage (SLACK_FEEDBACK_BOT_TOKEN + SLACK_FEEDBACK_CHANNEL_ID), which returns the message ts
  • When feedback exceeds the 500-char preview, the full text is now posted as a Slack thread reply on the initial message

New env vars required

SLACK_FEEDBACK_BOT_TOKEN=xoxb-...   # needs chat:write scope
SLACK_FEEDBACK_CHANNEL_ID=C...      # target channel ID

The existing SLACK_USER_FEEDBACK_WEBHOOK_URL is unchanged and still used by user-feedback-router.ts.

…es with thread support

Moves the inline Slack notification logic out of the router into dedicated
modules: internal-notifications.ts (low-level WebClient primitives) and
app-builder-feedback-slack.ts (app-builder-specific formatting). Switches
from an incoming webhook to chat.postMessage so we can obtain the message ts
and post the full feedback text as a thread reply when it exceeds the 500-char
preview limit.
}
notifyAppBuilderFeedback(input.project_id, input.feedback_text).catch(error => {
console.error('[AppBuilderFeedback] Failed to post to Slack', error);
});
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[SUGGESTION]: Dead .catch() handler — notifyAppBuilderFeedback already catches and logs all errors internally (see its try/catch on lines 25–52 of app-builder-feedback-slack.ts), so this promise will never reject.

You can simplify to a bare call:

Suggested change
});
notifyAppBuilderFeedback(input.project_id, input.feedback_text);

Alternatively, if you'd prefer the router to own error logging, remove the try/catch inside notifyAppBuilderFeedback and keep this .catch() instead.

@kiloconnect
Copy link
Contributor Author

kiloconnect bot commented Feb 22, 2026

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
src/routers/app-builder-feedback-router.ts 60-62 Dead .catch() handler — notifyAppBuilderFeedback already catches all errors internally, so the promise never rejects. Either remove the .catch() or move error handling to one place.
Files Reviewed (4 files)
  • src/lib/config.server.ts - 0 issues
  • src/lib/slack/internal-notifications.ts - 0 issues
  • src/lib/feedback/app-builder-feedback-slack.ts - 0 issues
  • src/routers/app-builder-feedback-router.ts - 1 issue

Fix these issues in Kilo Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant