Repository navigation
Let the Slack assistant answer off-topic questions (opt-in checkbox) - #297
Merged
Merged
Conversation
The Slack bot only helps with the event today, so teams that want a
general assistant in their channel have to install a second bot. A new
"Answer any question" checkbox on the Slack settings page stores
slackAnswerAnyQuestion on the event; the Slack handler maps it to an
explicit answerScope in the system prompt ('any' or 'event'). The
in-app chat passes no scope, so its prompt is byte-for-byte unchanged.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
HugoGresse
had a problem deploying
to
GitHub Action PR
October 27, 2026 22:48 — with
GitHub Actions
Failure
HugoGresse
had a problem deploying
to
GitHub Action PR
October 27, 2026 22:52 — with
GitHub Actions
Failure
firebase-tools 15.34.1 (2026-10-21) now checks that the Hosting API is enabled before deploying, which calls serviceusage.services.get. The github-action service account only holds firebasehosting.admin and serviceusage.apiKeysViewer, so both the PR preview and the merge deploy fail with a 403 on @latest. Pinning restores the last behaviour that worked; granting roles/serviceusage.serviceUsageViewer to the account would let the pin go away. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Visit the preview URL for this PR (updated for commit cf6a332):
(expires Wed, 04 Nov 2026 08:20:08 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 0c15c45ea5a4c54095387eacf30c3755c9260f22 |
…ice usage The github-action service account was granted roles/serviceusage.serviceUsageViewer on 2026-10-28, so the Hosting API check added in firebase-tools 15.34.1 passes and the workflows can track @latest again. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The unchecked state no longer injects a "decline unrelated topics" note: that would have tightened every existing Slack install on upgrade. The flag is now a plain boolean on runChatAgent that only adds a paragraph when set, and the no-flag prompt is byte-for-byte the historical one (the extra blank line is gone, with an exact assertion in the test). Long replies in "any question" mode were silently cut at Slack's text cap. markdownToMrkdwn no longer truncates; splitForSlack cuts at paragraph / line / word boundaries and the handler posts the overflow as continuation messages in the thread. The streaming updater still truncates since chat.update carries a single message. slack.test.ts now asserts the flag reaches the system prompt and that the default leaves it untouched. Helper text states the cost exposure (any workspace member uses the event OpenRouter key) and that the scope is a model instruction, not a hard block. The Slack page has a single form-level Save button instead of one per section. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This branch was successfully deployed
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
The Slack bot only helps with the event today. This adds an opt-in "Answer any question, even unrelated to OpenPlanner or this event" checkbox on the Slack settings page. When enabled, the assistant also acts as a general assistant in Slack (same model and OpenRouter key). When disabled, nothing changes: the system prompt is byte-for-byte the one shipped today, so existing Slack installs and the in-app chat behave exactly as before.
Changes
src/types.ts— newEvent.slackAnswerAnyQuestion?: boolean | null(shared with functions via the existing import).src/events/page/api/components/SlackAssistantOptions.tsx— new "Assistant behaviour" block with the checkbox, rendered insideSlackChatSectionfor both official and self-managed apps. The helper text names the cost exposure (any workspace member who can message the bot uses the event OpenRouter key) and that the scope is a model instruction, not a hard block.src/events/page/slack/EventSlack.tsx/SlackManualSetup.tsx/mapEventSettingsFormToMutateObject.ts— form schema, default value, persistence, and a single form-level Save button (the per-section one in the manual setup is gone).functions/src/api/routes/chat/chatAgent.ts— optionalanswerAnyQuestionboolean onrunChatAgent; when true a scope paragraph is added to the system prompt, otherwise the prompt is unchanged.functions/src/api/routes/slack/slackChatHandler.ts— passes the event flag; long replies are no longer cut at Slack's text cap but continued in the thread (splitForSlackcuts at paragraph / line / word boundaries).functions/src/api/routes/chat/chatAgent.test.ts,slack.test.ts,slackFormat.test.ts— exact prompt assertions, flag → system prompt wiring through the Slack handler, splitting.Screenshot
New "Assistant behaviour" block on the Slack settings page, checkbox ticked and saved (local emulator, throwaway event). Taken before the Save button moved to the bottom of the page; the block itself is unchanged apart from the helper text.
Test plan
tsc --noEmitclean on both front and functionsvitest(Node 24, as in.nvmrc):chat/andslack/suites green, 46 tests🤖 Generated with Claude Code
Note
Low Risk
Prompt and UI configuration only; no auth or data-model breaking changes, and in-app chat behaviour is unchanged when
answerScopeis omitted.Overview
Adds an opt-in per-event setting so the Slack assistant can answer off-topic questions, while tightening the default Slack behaviour to event-only topics.
Organizers get a new Assistant behaviour checkbox on the Slack settings page (
slackAnswerAnyQuestion), persisted on the event and wired through the Slack form. The shared chat agent gains optionalanswerScope(event|any) that injects scope instructions into the system prompt: Slack always passes a scope (event-only unless the flag is on); in-app chat omits it, so its prompt stays unchanged. When scope isevent, the model is told to decline unrelated questions; whenany, it may act as a general assistant while still using event tools only for event questions.Unit tests cover the three
buildSystemPromptvariants (no scope,event,any).Reviewed by Cursor Bugbot for commit 0694f8a. Configure here.