Skip to content

feat: add DEFAULT_AGENT option to set agent for Slack sessions#7

Open
madejejej wants to merge 1 commit into
leecoder:mainfrom
slab-stone:feat/default-agent-option
Open

feat: add DEFAULT_AGENT option to set agent for Slack sessions#7
madejejej wants to merge 1 commit into
leecoder:mainfrom
slab-stone:feat/default-agent-option

Conversation

@madejejej

@madejejej madejejej commented Jul 18, 2026

Copy link
Copy Markdown

Adds a new plugin option DEFAULT_AGENT (with SLACK_DEFAULT_AGENT env var fallback) that sets the initial value of agentOverride when the plugin initializes. This makes new Slack prompts use the configured agent instead of opencode's global default.

Motivation: when opencode's default agent carries an identity you don't want exposed in Slack (e.g. a chat-facing persona like 'Claudia' that should not introduce itself as 'Sisyphus'), there's currently no way to pick a different agent for Slack without manually running !agent in every thread or prefixing every message with @.

Behavior:

  • Honored at plugin init only (no per-prompt re-read)
  • Still overridden by !agent and @ per-message
  • Still cleared by !agent reset (which sets agentOverride = null)
  • Parallel to existing DEFAULT_DIRECTORY / SLACK_DEFAULT_DIRECTORY pattern

Builds cleanly with npm run build (dist/plugin.js regenerated).


Summary by cubic

Adds a DEFAULT_AGENT plugin option with a SLACK_DEFAULT_AGENT env fallback to set the default agent for Slack threads. New Slack prompts now start with the configured agent instead of opencode’s global default.

  • New Features
    • Applied at plugin init only (no per-prompt re-read).
    • Overridden by !agent <name> and @<agent>; cleared by !agent reset.
    • Mirrors DEFAULT_DIRECTORY / SLACK_DEFAULT_DIRECTORY behavior.
    • README updated with config details.

Written for commit 05cdcf1. Summary will update on new commits.

Review in cubic

Adds a new plugin option DEFAULT_AGENT (with SLACK_DEFAULT_AGENT env var
fallback) that sets the initial value of agentOverride when the plugin
initializes. This makes new Slack prompts use the configured agent
instead of opencode's global default.

Motivation: when opencode's default agent carries an identity you don't
want exposed in Slack (e.g. a chat-facing persona like 'Claudia' that
should not introduce itself as 'Sisyphus'), there's currently no way to
pick a different agent for Slack without manually running !agent in
every thread or prefixing every message with @<agent>.

Behavior:
- Honored at plugin init only (no per-prompt re-read)
- Still overridden by !agent <name> and @<name> per-message
- Still cleared by !agent reset (which sets agentOverride = null)
- Parallel to existing DEFAULT_DIRECTORY / SLACK_DEFAULT_DIRECTORY
  pattern

Builds cleanly with `npm run build` (dist/plugin.js regenerated).

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 3 files

Shadow auto-approve: would auto-approve. Adds a new plugin option to set the default agent for Slack sessions. Follows the existing DEFAULT_DIRECTORY pattern; change is bounded and clearly beneficial.

Re-trigger cubic

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