Skip to content

feat(chat): Add configurable GitHub mention ingress#361

Open
yezz123 wants to merge 11 commits into
getsentry:mainfrom
yezz123:issues-311/github-mentions
Open

feat(chat): Add configurable GitHub mention ingress#361
yezz123 wants to merge 11 commits into
getsentry:mainfrom
yezz123:issues-311/github-mentions

Conversation

@yezz123
Copy link
Copy Markdown

@yezz123 yezz123 commented May 15, 2026

Add GitHub comment mention ingress and make platform ingress explicitly configurable through createApp and juniorNitro. Apps can now enable Slack, GitHub, or both without Slack-only routes or production bot wiring being initialized for disabled platforms.

GitHub Mention Handling

GitHub issue comments that mention the configured bot handle are routed through a GitHub adapter and reply executor, then posted back as final GFM comments. Mention target normalization keeps bot-handle config consistent across runtime prompts and webhook validation.

Platform Enablement

Slack remains the default platform, but disabled webhooks now return 404 before adapter initialization and Slack-only callback/resume routes are only registered when Slack is enabled. GitHub turns also avoid Slack resume queue parking.

Slack Tool Organization

Slack tool implementations now live under chat/slack/tools, with only platform-neutral tool contracts kept under chat/tools.

Fixes #311

yezz123 added 5 commits May 16, 2026 00:40
Introduce the canonical delivery spec for GitHub mentions in Junior V1, detailing entry surfaces, one-turn delivery semantics, and markdown output expectations. This spec outlines the behavior for handling GitHub comments, including mention-only triggers and retry mechanisms, while clarifying non-goals and future extension points.

Also, update the index to include the new GitHub agent delivery spec.
Add the GitHub agent delivery specification to the AGENTS.md index, detailing the contract for handling GitHub mentions and comment delivery. This update ensures comprehensive documentation of all agent specifications.
Enhance documentation for GitHub integration by introducing a section on the optional GitHub mention webhook (V1). Include required environment variables, expected behavior, and configuration steps for setting up the webhook. Clarify that the V1 behavior is mention-only, requiring explicit `@<bot>` mentions in comments to trigger responses. Update related sections to reflect these changes.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 15, 2026

@yezz123 is attempting to deploy a commit to the Sentry Team on Vercel.

A member of the Team first needs to authorize it.

yezz123 and others added 2 commits May 16, 2026 12:07
Make Slack and GitHub ingress opt-in through createApp and juniorNitro instead of env-based or partial production-bot wiring. Disabled webhook platforms now return 404 before adapter initialization, and Slack-only callback routes are only registered when Slack ingress is enabled.

Move Slack tool implementations under the Slack feature folder and keep the shared tool runtime contract platform-neutral. GitHub mention handling now normalizes configured bot handles and avoids parking GitHub turns into the Slack resume queue.

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Comment thread packages/junior/src/chat/github/reply-executor.ts Outdated
Comment thread packages/junior/src/chat/app/production.ts Outdated
@dcramer dcramer changed the title Add GitHub @mention entry point for Junior feat(chat): Add configurable GitHub mention ingress May 16, 2026
@dcramer
Copy link
Copy Markdown
Member

dcramer commented May 16, 2026

thanks for the push! i had been fighting some technical hurdles w/ the credentialing and serverless timeouts, but this was def next up on the list

i will go ahead and take over the PR and get it to a point that feels safe/stable

@yezz123
Copy link
Copy Markdown
Author

yezz123 commented May 16, 2026

thanks for the push! i had been fighting some technical hurdles w/ the credentialing and serverless timeouts, but this was def next up on the list

i will go ahead and take over the PR and get it to a point that feels safe/stable

Great! Let me know if you need any help or further assistance with the PR.

@dcramer
Copy link
Copy Markdown
Member

dcramer commented May 16, 2026

One thing of note, we'll not be able to pull off auth right now with GitHub. Not totally sure the answer for that one, but there's still a lot of power in GitHub even w/o auth.

@yezz123
Copy link
Copy Markdown
Author

yezz123 commented May 17, 2026

One thing of note, we'll not be able to pull off auth right now with GitHub. Not totally sure the answer for that one, but there's still a lot of power in GitHub even w/o auth.

from my understanding is we’re not shipping user-auth flows on the GitHub entrypoint in V1 is that right? also even without that, this path is still useful: explicit-mention turns, repo-aware analysis, patch suggestions, CI/debug help, and final comment replies.

Enable Slack and GitHub to receive separate plugin, skill, and default config allowlists from the app initializer and Nitro config. Filter turn prompts, sandbox egress, auth prompts, and App Home against the active platform.

Move Slack webhook preprocessing out of the generic webhook handler and add GitHub mention coverage, including failure replies when Sentry does not return an event ID.

Refs getsentryGH-311

Co-Authored-By: GPT-5 Codex <codex@openai.com>
Comment thread packages/junior/src/chat/platform-config.ts Outdated
Comment thread packages/junior/src/chat/github/adapter.ts Outdated
Use the original platform config key for runtime map lookups after normalization. Keep GitHub mention target normalization owned by production config wiring instead of the adapter wrapper.

Refs getsentryGH-311

Co-Authored-By: GPT-5 Codex <codex@openai.com>
Comment thread packages/junior/src/chat/prompt.ts
Comment thread packages/junior/src/chat/respond.ts
Log startup discovery once per platform/plugin/skill configuration and cache static system prompts per assistant surface.

Refs getsentryGH-311

Co-Authored-By: GPT-5 Codex <codex@openai.com>
Comment thread packages/junior/src/chat/github/reply-executor.ts
Post a GitHub reply when an auth-pause retry reaches the GitHub executor so mention turns do not disappear without user-facing output.

Refs getsentryGH-311

Co-Authored-By: GPT-5 Codex <codex@openai.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

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 2 potential issues.

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 8f2954f. Configure here.

import { describeEval } from "vitest-evals";
import { githubMention, rubric, slackEvals } from "../helpers";

describeEval("GitHub Surface Contract", slackEvals, (it) => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

GitHub eval test uses Slack-specific test configuration

Medium Severity

The GitHub surface contract eval uses slackEvals as its describeEval configuration fixture. This means the GitHub mention eval runs under a Slack-configured harness rather than a GitHub-appropriate one. The test is specifically validating that "a GitHub mention produces a normal GitHub comment reply without Slack-only side effects," yet the eval infrastructure itself is Slack-flavored, which could mask or misattribute surface-contract violations.

Fix in Cursor Fix in Web

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

rehydrateAttachmentFetchers(message);
return runtimes.slack.handleNewMention(thread, message);
}
return;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Silent mention drop when adapter name is missing

Low Severity

The onNewMention handler in registerProductionHandlers silently returns without processing if getAdapterName(thread) is undefined or doesn't match "github" or "slack". If a thread arrives with an unexpected or missing adapter name, the mention is silently dropped with no logging, making debugging difficult.

Fix in Cursor Fix in Web

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

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.

Add GitHub @mention entry point for Junior

2 participants