Skip to content

[User Feedback] chat: malformed asset links navigate away from the current conversation #2228

Open

Description

@yunfanye

Situation

This came from user feedback. An assistant supplied an invalid file link in a dashboard chat. Clicking it replaced the conversation instead of displaying a missing-file result. Supported chat files already have a publishing action and file-specific rendering.

Symptom

The reporter observed that clicking [document](/api/assets/report.md) in an assistant reply navigated to /message with an empty composer. Opening the same URL directly returned JSON HTTP 404. The route handler's response is {"error":"Not found"}.

The expected behavior is to download or display supported files, and show a clear error for invalid links without replacing the conversation. The reporter confirmed that publishing through core:show_file fixed the particular download.

How to reproduce

  1. Derived from code: In a fresh signed-in dashboard session on version 1.1.194, open an existing topic conversation rather than /message.
  2. Reporter-provided: Obtain an assistant reply containing [document](/api/assets/report.md). No file needs to exist for this malformed name.
  3. Reporter-provided: Click the link with an unmodified left-click. The dashboard leaves the topic conversation and lands on /message, rather than requesting the file.
  4. Reporter-provided: Open the same asset URL directly in another tab. It returns HTTP 404 instead of a conversation.

On current main, step 3 still enters SPA navigation, but the final destination follows the remembered home/chat-list mode.

Initial triage

  • The frontend owns the wrong navigation. ChatMarkdown installs ChatLink. Its file branch requires parseAssetHref to match exactly 32 lowercase hexadecimal characters plus a lowercase alphanumeric extension of 1–8 characters. report.md fails that check and falls through to MarkdownLink. MarkdownLink converts every same-origin link into a React Router Link, including /api/*. See asset recognition, ChatLink dispatch and fallback, and MarkdownLink.
  • The redirect explains /message. The catch-all route sends unknown SPA paths to /. On the reporter's commit, / unconditionally redirected to /message. That page selects the main Concierge chat, not the originating topic. The empty composer is the reported landing state, not evidence of deleted conversation history.
  • The server rejection is intentional. The asset handler rejects malformed names before filesystem access. The server does not need to accept descriptive filenames. The show_file action returns supported URLs and Markdown.
  • Existing coverage preserves the defect. The test named leaves a look-alike link to the router explicitly exercises /api/assets/x.png. It checks only that the link lacks download, not that clicking preserves the conversation. See the test.
  • History and main comparison: Closed #2071 identified API file links navigating the SPA. PR #2072, merged as f4488b14, added stored-file handling and the look-alike fallback test. This is the remaining malformed-link case, not an open duplicate. Searches of open and closed issues and PRs found no matching open issue. The recognition, fallback, server validation, and relevant tests are unchanged between 8a71a43 and main. Later PR #2214, commit 76b2394e, changes the home destination but does not prevent API-link interception.
  • Related guidance gap: The CHARTER Links paragraph describes an assets-folder mapping without stating the restricted generated-name contract. Its Pictures section already recommends core:show_file. Clarifying the Links paragraph would reduce recurrence, but would not repair existing malformed links.

Suspected root cause

Confidence: high — rich-file recognition doubles as the navigation boundary. A malformed asset URL fails parseAssetHref, then reaches the generic same-origin SPA Link. React Router handles the click without requesting the asset endpoint. Its unmatched-route fallback replaces the originating route with the home route, which resolves to /message on the reporter's build. Direct navigation bypasses this frontend chain and correctly reaches the server's JSON 404.

Possible fixes

  • In MarkdownLink, keep same-origin API URLs outside SPA navigation and open them separately so an HTTP error does not replace the chat.
  • Alternatively, handle the entire /api/assets namespace in ChatLink independently of rich-file validation. Invalid names could show a local error or open the server response separately.
  • Add click-level regression coverage for malformed relative and same-origin absolute URLs, including query strings. Preserve valid chips, players, app links, and project links. Clarify CHARTER guidance to use the Markdown returned by core:show_file.

Environment

  • Agent-filed bug report. Browser family, viewport class, route, theme, mode, and language were not supplied.
  • Build: 1.1.194, commit 8a71a43a9f27ab14f86de5cbe852d3190f06a31e, built 2026-11-13T16:31:53Z. It is 49 commits behind inspected main ec25f7c4274d08ad6bb75bde956d59ca9a782188.
  • Uptime: 104,818 seconds, about 29 hours. Upgraded since boot from 1.1.193.
  • Database healthy. All 13 apps had no failed or broken entries. Webchat was connected. Relay and deposit URL were configured.
  • Investigation was read-only. No runtime reproduction or tests were run.

Triage confidence: high — The exact malformed URL fails parseAssetHref and deterministically reaches a same-origin React Router Link, whose catch-all redirects through home. The reporter build redirects home to /message, while the separate asset handler explicitly returns the reported JSON 404. Suggested priority: P2. Estimated size: small.
Source: Rome Cloud user feedback, submitted 2026-11-15T00:19:05.469803Z, build 1.1.194. Analyzed against ec25f7c427 (main); reporter build commit 8a71a43, 49 commits behind main. Filed automatically by Feedback Triage.

Activity

  1. added
    bugSomething isn't working
    P2Fix in the normal course of work
    needs-triageAwaiting triage / needs a maintainer to categorize
    size:smallRough size: a localized fix in one place, about half a day or less
    on Nov 15, 2026
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

    P2Fix in the normal course of workbugSomething isn't workingneeds-triageAwaiting triage / needs a maintainer to categorizesize:smallRough size: a localized fix in one place, about half a day or less

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions