Skip to content

feat(chat-platform): one Hazel bot for every Maple region - #2244

Merged
Makisuo merged 6 commits into
mainfrom
feat/hazel-single-bot
Nov 4, 2026
Merged

Makisuo merged 6 commits into
mainfrom
feat/hazel-single-bot

fix(chat-platform): name the Hazel callback's region hazel_region

c52178c
Select commit
Loading
Failed to load commit list.
Maple Review Bot / Maple / review succeeded Nov 4, 2026 in 1m 38s

Confidence 10/10 · No issues found

🟢 Confidence 10/10 · safe to merge. One helper derives the region for both the install link and the redemption, and new tests pin both plus the gateway handshake.
no findings · tests covered · risk medium

Adds an optional per-deployment gateway region so several Maple instances can share one Hazel bot, threading it through the install link, the callback URI and the token exchange, with optional connector config keys so a missing region still counts as configured. The three files changed since the last review are consistent with each other and with the callers; safe to merge once the rollout steps land.

  • hazelRedirectUri puts ?hazel_region= on the install link and the redemption
  • MAPLE_HAZEL_REGION declared as an optional key on the install and gateway halves
  • isConnectorConfigured and chat-bot's resolveConnectorConfig ignore optional keys

Before merge

  • Env var · Set MAPLE_HAZEL_REGION=eu in the EU api and chat-bot env; Hazel's regional install support must be deployed first · packages/chat-platform/src/connectors/hazel/api.ts:42
  • Manual · Register EU's callback on the bot as …/oauth/chat/hazel/callback?hazel_region=eu — the PR description still says ?region=eu, which Hazel will not match
What was checked
  • Redemption URI is rebuilt from config in complete, and ChatWorkspaceService replays the region-less state row, so the two still agree (install.ts:143, ChatWorkspaceService.ts:406)
  • MAPLE_HAZEL_REGION reaches both hosts as an optional env read (apps/api/src/resources/env.ts:79, apps/chat-bot/src/config.ts:63)
  • The callback's hazel_region rides the forwarded query into OAuthCompleteRequest.query and is unused by complete (oauth-return.ts:31)

c52178c · Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.