Skip to content

Public link copy button copies a relative /chat/<token> path when FRONTEND_URL is unset #3170

Closed

Description

@obasilakis

Bug

The copy button on Agent → Sharing → Public links copies only the path (/chat/<token>), not a full link, when FRONTEND_URL is not set. The link shown in the panel is the same relative path. Pasting it anywhere outside the browser tab gives a broken link.

Cause

src/backend/routers/public_links.py::_build_public_url returns f"{FRONTEND_URL}/chat/{token}". FRONTEND_URL defaults to "" (src/backend/config.py, .env.example), so the url field is relative. PublicLinksPanel.vue copies link.external_url || link.url as-is; external_url is also unset unless PUBLIC_CHAT_URL is configured.

Repro

  1. Run Trinity with FRONTEND_URL and PUBLIC_CHAT_URL unset (the .env.example default).
  2. Agent → Sharing → Public links → create a link → Copy.
  3. Clipboard holds /chat/<token>.

Expected

Clipboard and panel show a full URL, e.g. http://localhost/chat/<token>. When FRONTEND_URL is empty the UI should resolve the path against the page's own origin.

Acceptance criteria

  • With FRONTEND_URL unset, Copy puts an absolute URL (page origin + /chat/<token>) on the clipboard.
  • The URL displayed in the panel is the same absolute URL.
  • When FRONTEND_URL or PUBLIC_CHAT_URL is set, the copied URL is unchanged.
  • Unit test covers the relative and absolute cases.

Activity

  1. self-assigned this
    on Oct 1, 2026
  2. added
    priority-p2
    type-bug
    theme-ui-ux
    on Oct 1, 2026
  3. added
    status-in-dev
    on Oct 2, 2026
  4. removed
    status-in-dev
    on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority-p2theme-ui-uxtype-bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions