Skip to content

feat: notify users when access request is approved/denied across all channels #889

Open

Description

@vybe

Summary

When a user tries to access an agent via a public link or a channel (Telegram, Slack, WhatsApp) without permission, the system creates an access request and tells them: "You'll be notified once the agent owner responds." That notification is never sent. Users must proactively retry the conversation to discover their status has changed — they get no feedback on approval or denial.

Context

Research into the access control flow reveals three related gaps:

  1. Broken notification promise — routers/public.py:457 and adapters/message_router.py:420 both tell users they'll be notified when the owner responds. The sharing.py:decide() handler only updates the DB row; it fires no outbound message.

  2. Silent denial — Denied users receive zero feedback. Their request silently disappears from the pending list. The user who was told "I'll let you know" never hears back.

  3. No status inquiry — There is no /status or /request command for channel users to check whether their pending request is still open.

Affected surfaces:

  • Public link chat (routers/public.py)
  • Telegram (adapters/telegram_adapter.py — /login flow)
  • Slack (adapters/slack_adapter.py — DM verification flow)
  • WhatsApp (adapters/whatsapp_adapter.py — /login flow)

Key files:

  • src/backend/routers/sharing.py lines 208–274 — decide() endpoint that processes approval/denial (no notification sent)
  • src/backend/adapters/message_router.py lines 410–425 — creates access request, sends pending message with unfulfilled promise
  • src/backend/routers/public.py lines 457–460 — same unfulfilled promise on web

Acceptance Criteria

  • When an owner approves an access request, the user receives a notification on the channel they used to request access (Telegram DM, Slack DM, WhatsApp message, or email for public links)
  • When an owner denies an access request, the user receives a clear message explaining their request was not approved
  • The pending-state message no longer makes a promise that can't be kept (or the promise is now fulfilled)
  • Telegram and WhatsApp users can send /status to check whether their access request is pending, approved, or denied
  • Notifications are sent via the same adapter that handled the original request (channel routing preserved)

Technical Notes

The sharing.py:decide() handler at line 208 knows: agent_name, approved/denied decision, the request row (with channel field and requester email). The notification dispatch should look up the user's channel identity from telegram_chat_links / slack_channel_agents / whatsapp_chat_links by email and dispatch via the appropriate adapter.

For public link users (no persistent channel identity), send an email notification instead.

Consider adding a notified_at column to access_requests to prevent double-sends on retries.

Activity

  1. added
    priority-p2
    type-feature
    on May 18, 2026
  2. added
    theme-channels
    on Jun 3, 2026
  3. added
    complexity-low
    status-incubating
    on Jun 12, 2026
  4. vybe commented on Jul 3, 2026

    @vybe
    ContributorAuthor

    Groom note (2026-07-03): partially superseded by #951, which shipped fire-and-forget approval notifications on the requester's originating channel (telegram/slack/whatsapp). Remaining scope if this graduates from incubation:

    • Denial feedback — rejected requesters still get no notification.
    • Web/public-link channel — Notify requester on approval of channel access request #951 covers the three chat channels only; the public-link promise (routers/public.py) is still unmet.
    • Status inquiry — no /status-style command for a channel user to check a pending request.
  5. added
    complexity-medium
    and removed
    complexity-low
    on Sep 2, 2026
  6. vybe commented on Sep 24, 2026

    @vybe
    ContributorAuthor

    Ruling 2026-09-24 (trinity-enterprise#564): the denial-feedback / public-link residual becomes an event on the daily personal report rail (trinity-enterprise#702), not a fourth one-off path. Stays incubating until that rail exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    complexity-mediumpriority-p2status-incubatingtheme-channelstype-feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions