← Back to PRs

#9181: feat(slack): add per-channel thread config override

by halbotley open 2026-02-05 00:06 View on GitHub →
channel: slack stale
## Summary Allow per-channel thread configuration overrides for Slack channels: ```json { "channels": { "slack": { "channels": { "C0ACCNGH6DV": { "thread": { "inheritParent": true, "historyScope": "thread" } } } } } } ``` ## Problem Currently, `thread.inheritParent` and `thread.historyScope` are global settings that apply to all Slack threads. Some channels (like Sentry alert channels) benefit from threads inheriting parent context, while other busy channels would have bloated context if enabled globally. ## Solution Add optional `thread` config to `SlackChannelConfig`, allowing per-channel overrides for: - `inheritParent`: Whether thread sessions inherit the parent channel transcript - `historyScope`: Whether thread history is isolated per-thread or shared Per-channel settings take precedence over global settings. ## Changes - `src/config/types.slack.ts`: Added `thread?: SlackThreadConfig` to `SlackChannelConfig` - `src/config/zod-schema.providers-core.ts`: Added thread schema to channel config validation - `src/slack/monitor/channel-config.ts`: Added thread to resolved channel config - `src/slack/monitor/message-handler/prepare.ts`: Check per-channel thread config before falling back to global <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> Adds per-channel Slack thread behavior overrides by extending `SlackChannelConfig` with an optional `thread` block, validating it in the providers-core Zod schema, carrying it through Slack channel config resolution, and using the resolved overrides in message preparation when computing session/history keys. This fits into the existing Slack monitor flow where `resolveSlackChannelConfig` produces a per-channel effective config (with wildcard fallback), and `prepareSlackMessage` uses that to decide routing/mentions/history/session scoping; the PR makes thread inheritance/history-scope configurable at the same per-channel layer as other channel settings. <h3>Confidence Score: 3/5</h3> - This PR is close to mergeable but has a couple concrete issues to address first. - Core logic for per-channel thread overrides is consistent end-to-end (types → schema → resolution → usage), but the Slack monitor context typing wasn’t updated to include the new `thread` field, and a new root `package-lock.json` was added despite the repo using pnpm lockfiles, which will create lockfile/tooling drift. - src/slack/monitor/context.ts, package-lock.json <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> <!-- /greptile_comment -->

Most Similar PRs