Skip to content

fix(slack): Prefer ids and known destinations for channel refs - #1596

Open
sentry-junior[bot] wants to merge 3 commits into
mainfrom
fix/slack-channel-ref-no-workspace-scan
Open

fix(slack): Prefer ids and known destinations for channel refs#1596
sentry-junior[bot] wants to merge 3 commits into
mainfrom
fix/slack-channel-ref-no-workspace-scan

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Plain channel names used to resolve through a conversations.list workspace scan with an arbitrary 1,000-channel cap. That path is slow, incomplete, and the wrong product shape.

Channel tool params now resolve in this order:

  1. id-bearing forms: C123, <#C123>, <#C123|name>, slack:C123
  2. exact local match against known destinations already stored for this workspace (junior_destinations.display_name)
  3. otherwise a repairable error that steers toward a mention, id, link, or public search

No conversations.list crawl. Ambiguous local names fail closed.

Policy

  • policies/tool-design.md: prefer provider ids/native mentions; plain names may use local known state only
  • Slack adapter README documents the id-first + known-destination rule

Verification

  • pnpm --filter @sentry/junior exec vitest run tests/unit/slack/slack-ids.test.ts tests/integration/slack-channel-tools.test.ts tests/component/conversation-sql-store.test.ts tests/unit/services/turn-session-routing.test.ts — 53 passed
  • pnpm --filter @sentry/junior typecheck
  • git diff --check

Requested by David Cramer.

--

View Junior Session [Sentry]

Channel tool params now accept only id-bearing forms. Remove the
conversations.list workspace scan and document the id-first rule.

Co-Authored-By: David Cramer <david@sentry.io>
@vercel

vercel Bot commented Aug 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
junior-docs Ready Ready Preview Aug 16, 2026 2:10am

Request Review

Plain channel names may match one stored junior_destinations display
name in the current workspace. Keep id-first resolution and never scan
Slack conversations.list.

Co-Authored-By: David Cramer <david@sentry.io>
@sentry-junior sentry-junior Bot changed the title fix(slack): Stop resolving channels by plain name fix(slack): Prefer ids and known destinations for channel refs Aug 16, 2026
@dcramer
dcramer marked this pull request as ready for review August 16, 2026 02:06
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Aug 16, 2026

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8a6f518. Configure here.

Comment thread packages/junior/src/chat/slack/tool-support/channel-target.ts
Raise the channel ref max length so <#C…|name> forms with full-length
channel names are not rejected before id parsing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants