fix(channels): respect Slack permission defaults#2285
Open
just-cameron wants to merge 1 commit into
Open
Conversation
Letta Code (agent-c2adbf5c-8419-4211-8cd8-3740db164974) Align Slack channel permission defaults with the current unrestricted product default and enforce account defaults on reused Slack routes so stale conversation state cannot leak approval prompts into Slack. 👾 Generated with [Letta Code](https://letta.com) Co-Authored-By: Letta Code <noreply@letta.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This fixes Slack/channel permission defaults so channel-originated runs do not ask for tool approval when the account is configured for the current no-permission-prompt behavior.
The immediate problem was that Slack still had several hardcoded
standardfallbacks even though the product default permission mode is nowunrestricted. In addition, Slack only seeded a conversation permission mode when a route was first created and only for non-standard modes, so reused Slack routes could keep stale per-conversation permission state and leak generic tool approval prompts into Slack.What changed
unrestricted.standard.defaultstring maps to the current product default instead of permanently mapping tostandard.standard, so intentional stricter account configs still work.Before / after
Before: a Slack account configured or expected to run without permission prompts could still ask for approval if the route already existed or if fallback config had silently become
standard.After: Slack conversations follow the account default consistently for new and reused routes. By default that means no generic tool approval prompt is sent to Slack. If an account is explicitly set to
standard, that choice is still honored.Risk and tradeoffs
The main behavior change is that legacy Slack accounts without an explicit permission mode now inherit the current product default,
unrestricted, instead of the older ask-flow behavior. That matches the current default permission model and the observed Slack expectation, but it is still a meaningful default change for old channel configs.This does not remove
standard; it only stops treating it as the implicit fallback/default.Validation
bun test src/tests/channels/registry.test.ts src/tests/channels/service.test.ts src/tests/channels/interactive.test.ts src/tests/permissions-mode.test.ts src/tests/websocket/listen-client-protocol.test.tsbunx --bun @biomejs/biome@2.2.5 check src/permissions/mode.ts src/channels/types.ts src/channels/accounts.ts src/channels/slack/accountConfig.ts src/channels/slack/setup.ts src/channels/service.ts src/channels/registry.ts src/websocket/listener/lifecycle.ts src/websocket/listener/permissionMode.ts src/tests/channels/registry.test.ts src/tests/channels/service.test.ts src/tests/permissions-mode.test.tsbun run typecheck👾 Generated with Letta Code