Skip to content

Let the support chat set up connectors and tell customers about handoffs - #1623

Merged
helpcodeai merged 3 commits into
mainfrom
feat/support-desk-connector-setup
Nov 10, 2026
Merged

helpcodeai merged 3 commits into
mainfrom
feat/support-desk-connector-setup

Conversation

@helpcodeai

Copy link
Copy Markdown
Contributor

What

Two additions to the support desk integration (Cloud only, ee/support):

  1. Set up connectors from the support chat. New endpoint POST /api/support/desk-tools/connector, called by a custom AI tool in Libredesk (ai_tools, header X-Desk-Tool-Key = HMAC of LIBREDESK_WEBHOOK_SECRET, no new variable).
    • Who: the contact Libredesk puts in its own headers (X-Libredesk-Contact-External-Id = <host>:<userId> from the widget JWT we sign), checked again against the conversation, then email verified, exactly one workspace, ADMIN/EDITOR. Same trust anchor as the Telegram auto-setup (Set up Telegram from a bot token posted in the support chat #1583).
    • What: catalog adapters only (shared-endpoint exclusions apply, File Search goes to its wizard).
    • Without values: installs the connector and returns a one-time setup link (ConnectorSetupService.createLink).
    • With values the customer pasted in the chat: each secret is used only if the customer's own messages in that conversation contain it word for word; the setup page's check (verifyCredentials) runs first and a refused key is not stored. Answers never echo values (provider messages are scrubbed).
    • Never a second connector of an app the workspace has working; when none works yet, the oldest gets the values (saved through the connector page's own updateEnvVars path). A pasted Telegram token stays with the message webhook.
    • Security event CONNECTOR_INSTALLED_VIA_SUPPORT_CHAT (via: desk_assistant), product event, and with pasted values the email to the user and workspace admins. At most 5 a day per workspace.
  2. Handoff notice. Libredesk v2.8.0 drops the assistant's text when it hands off (only a private note + reassignment), so a customer waited 4.5 h with no answer on 2026-11-10. When the AI assistant user (LIBREDESK_AI_ASSISTANT_USER_ID) posts its private note in a live chat, the customer gets a short notice in the triage language (8 languages, English fallback) that a person replies here, once per conversation in 6 hours.

Small AGPL change: AdaptersModule exports ConnectorSetupService, which gains a public connectorStatus().

Deployment modes

Self-hosted: the support module is not loaded (no SUPPORT_CHAT_* / LIBREDESK_*), nothing changes. Cloud: the endpoint answers 404 until LIBREDESK_* is set (it is), and does nothing until the tool is created in Libredesk.

Tests

In packages/backend:

  • npx jest --maxWorkers=4 src/ee/support src/adapters/connector-setup: 137 passed
  • npx tsc --noEmit -p tsconfig.json: clean
  • npx eslint src/ee/support src/adapters/connector-setup.service.ts src/adapters/adapters.module.ts: clean

The desk's AI assistant can call a custom Libredesk tool that installs a
catalog connector for the signed-in customer, or fills their empty one, and
returns a one-time link for what is still missing. Keys the customer pasted
in the chat are used, as for Telegram, only when their own messages contain
them, after the setup check passes. Libredesk drops the assistant's text on
a handoff, so the customer now gets a notice that a person replies here.
@helpcodeai
helpcodeai requested a review from D3nisty as a code owner November 10, 2026 14:51
@helpcodeai
helpcodeai enabled auto-merge (squash) November 10, 2026 14:52
@helpcodeai
helpcodeai merged commit 72acfb9 into main Nov 10, 2026
16 checks passed
@helpcodeai
helpcodeai deleted the feat/support-desk-connector-setup branch November 10, 2026 15:20
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants