chenhg5/cc-connect · error

slack: send: %w

Error message

slack: send: %w

What it means

Wrapped error from slack-go PostMessageContext when posting the reply text (converted to Slack mrkdwn) to the reply channel, optionally threaded; the Slack Web API rejected or failed the post.

Source

Thrown at platform/slack/slack.go:466

	return ""
}

func (p *Platform) Reply(ctx context.Context, rctx any, content string) error {
	rc, ok := rctx.(replyContext)
	if !ok {
		return fmt.Errorf("slack: invalid reply context type %T", rctx)
	}

	opts := []slack.MsgOption{
		slack.MsgOptionText(core.MarkdownToSlackMrkdwn(content), false),
	}
	if rc.timestamp != "" {
		opts = append(opts, slack.MsgOptionPostMessageParameters(slack.PostMessageParameters{ThreadTimestamp: rc.timestamp}))
	}

	_, _, err := p.client.PostMessageContext(ctx, rc.channel, opts...)
	if err != nil {
		return fmt.Errorf("slack: send: %w", err)
	}
	return nil
}

// Send sends a new message (or threaded reply if rctx has timestamp).
// Patched 2026-05-03: use thread_ts when present so replies in Slack Assistant
// Chat tab land in the right thread (not the History tab feed).
func (p *Platform) Send(ctx context.Context, rctx any, content string) error {
	rc, ok := rctx.(replyContext)
	if !ok {
		return fmt.Errorf("slack: invalid reply context type %T", rctx)
	}

	opts := []slack.MsgOption{
		slack.MsgOptionText(core.MarkdownToSlackMrkdwn(content), false),
	}
	if rc.timestamp != "" {
		opts = append(opts, slack.MsgOptionPostMessageParameters(slack.PostMessageParameters{ThreadTimestamp: rc.timestamp}))

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Invite the bot to the channel (/invite @bot)
  2. Check chat:write scope; retry transient network errors
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at platform/slack/slack.go:466 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06). Data as JSON: /api/errors/4d6f3a1fcded23b7. Report an issue: GitHub.