{"record":{"id":"d2d1f1209ff5b5cf","repo":"chenhg5/cc-connect","slug":"slack-bot-token-and-app-token-are-required","errorCode":null,"errorMessage":"slack: bot_token and app_token are required","messagePattern":"slack: bot_token and app_token are required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"platform/slack/slack.go","lineNumber":53,"sourceCode":"\tallowFrom        string\n\tsessionScope     string // \"user\" (default) | \"channel\" | \"thread\"\n\tclient           *slack.Client\n\tsocket           *socketmode.Client\n\thandler          core.MessageHandler\n\tcancel           context.CancelFunc\n\tchannelNameCache map[string]string\n\tchannelCacheMu   sync.RWMutex\n\tuserNameCache    sync.Map // userID -> display name\n}\n\nfunc New(opts map[string]any) (core.Platform, error) {\n\tbotToken, _ := opts[\"bot_token\"].(string)\n\tappToken, _ := opts[\"app_token\"].(string)\n\tallowFrom, _ := opts[\"allow_from\"].(string)\n\tcore.CheckAllowFrom(\"slack\", allowFrom)\n\tshareSessionInChannel, _ := opts[\"share_session_in_channel\"].(bool)\n\tif botToken == \"\" || appToken == \"\" {\n\t\treturn nil, fmt.Errorf(\"slack: bot_token and app_token are required\")\n\t}\n\tscope := normalizeSessionScope(opts[\"session_scope\"], shareSessionInChannel)\n\tif scope == \"thread\" {\n\t\tslog.Warn(\"slack: session_scope=thread gives each Slack thread its own session; \" +\n\t\t\t\"if your agent runtime is tmux, also set window_per_session=true — \" +\n\t\t\t\"without it, concurrent threads share a single pane and their output will interleave\")\n\t}\n\treturn &Platform{\n\t\tbotToken:         botToken,\n\t\tappToken:         appToken,\n\t\tallowFrom:        allowFrom,\n\t\tsessionScope:     scope,\n\t\tchannelNameCache: make(map[string]string),\n\t}, nil\n}\n\n// normalizeSessionScope resolves the configured session_scope option to one of\n// \"user\" | \"channel\" | \"thread\". For backward compatibility, when session_scope","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/platform/slack/slack.go#L35-L71","documentation":"slack.New required-option guard: bot_token or app_token was not provided (or is empty). Socket Mode needs both (xoxb- bot token and xapp- app token), so construction fails before any connection attempt.","triggerScenarios":"Thrown at platform/slack/slack.go:53 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set bot_token and app_token in [platforms.slack]","Create a Slack app with Socket Mode enabled to obtain both tokens"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}