Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Add plugin with tokens to `~/.config/opencode/opencode.json`:
| `SLACK_BOT_TOKEN` | — | Required. Bot token (`xoxb-...`) |
| `SLACK_APP_TOKEN` | — | Required. App-level token (`xapp-...`) |
| `DEFAULT_DIRECTORY` | serve directory | Default workspace for new sessions |
| `DEFAULT_AGENT` | — | Agent name to use for prompts in Slack threads. Reads plugin option first, then `SLACK_DEFAULT_AGENT` env var. Can be overridden per-message with `@<agent>` or per-thread with `!agent`; cleared by `!agent reset`. Useful when the global opencode default agent has an identity you don't want exposed in Slack (e.g., a chat-facing persona) |
| `ALLOWED_USERS` | — | Comma-separated Slack user IDs or emails. If unset, everyone can use the bot |
| `ATTACH_TIMEOUT_SEC` | 600 | Timeout (seconds) for `!attach bg_xxx` polling. Reads plugin option first, then env var fallback. Invalid/non-positive values fall back to 600 |

Expand Down
2 changes: 2 additions & 0 deletions dist/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -13566,6 +13566,8 @@ var pluginModule = {
}
pluginClient = input.client;
defaultDirectory = expandTilde(options?.DEFAULT_DIRECTORY || process.env.SLACK_DEFAULT_DIRECTORY || input.directory);
agentOverride = options?.DEFAULT_AGENT || process.env.SLACK_DEFAULT_AGENT || null;
if (agentOverride) log(`default agent: ${agentOverride}`);
attachBgTimeoutMs = resolveAttachTimeoutMs(options?.ATTACH_TIMEOUT_SEC);
log(`attach timeout set to ${attachBgTimeoutMs}ms`);
sessionsPath = join(input.directory, "slack-sessions.json");
Expand Down
2 changes: 2 additions & 0 deletions src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1302,6 +1302,8 @@ const pluginModule: PluginModule = {

pluginClient = input.client;
defaultDirectory = expandTilde((options?.DEFAULT_DIRECTORY as string) || process.env.SLACK_DEFAULT_DIRECTORY || input.directory);
agentOverride = (options?.DEFAULT_AGENT as string) || process.env.SLACK_DEFAULT_AGENT || null;
if (agentOverride) log(`default agent: ${agentOverride}`);
attachBgTimeoutMs = resolveAttachTimeoutMs(options?.ATTACH_TIMEOUT_SEC);
log(`attach timeout set to ${attachBgTimeoutMs}ms`);
sessionsPath = join(input.directory, "slack-sessions.json");
Expand Down