Repository navigation
Description
Summary
When a plugin renders a thread with the SDK's ThreadChat component, relative markdown links in message bodies open in the browser as broken URLs against the bb app origin. The main thread view handles the same links correctly; only plugin-embedded chats are affected.
Versions and environment
- bb 0.44.0 (desktop app), macOS 26 / arm64
- focus-board 0.4.2 for the repro (source: https://github.com/cristoslc/bb-plugin-focus-board, installed from a local path, not on the bb-community marketplace); 0.4.3 carries a plugin-side workaround, but the gap is in bb's
PluginThreadChatand affects any plugin renderingThreadChatoutside a thread-detail panel - External
https://links are unaffected
Steps to reproduce
- Install a plugin that renders
ThreadChatin its own panel (focus-board's thread pane, for example). - Have an agent post a message containing a repo-relative link, like
[ERD](docs/erd.mmd). - Click the link in the plugin's embedded chat.
The browser navigates to something like https://<app-origin>/docs/erd.mmd and shows an error page. Nothing opens the actual file. The same link in the same thread's main view opens the file preview correctly.
Expected vs actual
Expected: the link opens as a live workspace file in the preview panel, the way it does from the main thread view.
Actual: the anchor keeps its raw relative href, the browser resolves docs/erd.mmd against the app origin, and the user gets an error page.
Evidence
PluginThreadChat takes its link handling from useThreadTimelineNavigation() (
bb/apps/app/src/components/plugin/PluginThreadChat.tsx
Lines 123 to 141 in 4354b88
| const timelineNavigation = useThreadTimelineNavigation(); | |
| const canUseHostFileNavigation = | |
| thread !== undefined && | |
| thread.environmentId === timelineNavigation?.environmentId; | |
| const onOpenLink = timelineNavigation?.onOpenLink; | |
| const onOpenLocalFileLink = canUseHostFileNavigation | |
| ? timelineNavigation.onOpenLocalFileLink | |
| : undefined; | |
| const resolveHostMentionLink = canUseHostFileNavigation | |
| ? timelineNavigation.resolveMentionLink | |
| : undefined; | |
| const workspaceRootPath = | |
| environment?.path ?? | |
| (canUseHostFileNavigation | |
| ? timelineNavigation.workspaceRootPath | |
| : undefined); | |
| const pluginId = useContext(PluginContext); | |
| const consumerMessageActions = useMemo< | |
| readonly ThreadTimelineConsumerMessageAction[] | undefined |
ThreadTimelineNavigationProvider, which is only mounted in ThreadDetailView (bb/apps/app/src/views/thread-detail/ThreadDetailView.tsx
Lines 2752 to 2765 in 4354b88
| <ThreadTimelineNavigationProvider | |
| environmentId={thread.environmentId} | |
| onOpenLink={handleOpenTimelineLink} | |
| onOpenLocalFileLink={handleOpenTimelineLocalFileLink} | |
| resolveMentionLink={resolveMentionLink} | |
| threadId={thread.id} | |
| workspaceRootPath={environment?.path ?? undefined} | |
| > | |
| <PluginPanelTabContent | |
| tab={tab} | |
| context={{ kind: "thread", threadId: thread.id }} | |
| fileOpenerOriginal={fileOpenerOriginal} | |
| /> | |
| </ThreadTimelineNavigationProvider> |
onOpenLink, onOpenLocalFileLink, and workspaceRootPath all stay undefined and buildMarkdownMessageLinkRouting (components/ui/markdown-message-link-routing.ts) returns undefined. With no routing, the anchor renders with its raw href and the browser resolves it against the app origin.
The data needed for a fallback is already fetched there: a few lines above the navigation lookup, PluginThreadChat reads thread.environmentId and runs useEnvironment(thread?.environmentId), which carries the workspace path. It just never uses those values to synthesize routing when the context is missing.
What you ruled out
- Not a duplicate of Markdown file preview: external links do nothing on click — MarkdownPreview gets no linkRouting.onOpenLink, so the target="_blank" default is swallowed #3395 because that one is about the plugin-facing
Markdownpreview component and external links, a different component and symptom. - Not Chat links starting with ~/ resolve against the project root #1182/Do not resolve home-relative chat links against the project root #1796, those covered
~/links in the main chat and are fixed. - Not PR Preserve native semantics in plugin links #2094, that changed
experimental_FileLink/UrlLinkhref construction, notThreadChatmessage routing. - Searched "relative link markdown", "ThreadChat link", "link routing", "embedded chat link", and
is:pr PluginThreadChat; no existing issue or PR covers this root cause. - Reproduced live on bb 0.44.0; the fix would land in the host, and focus-board 0.4.3's local workaround does not change that.
Suggested priority and effort
Low priority, low effort. Hits any plugin embedding ThreadChat outside a thread-detail panel. A workaround exists (plugin-side click interception). No data loss. PluginThreadChat could build the same routing from the thread's own environmentId and environment.path when the context is missing, routing local files through experimental_openFilePreview; I have a working version of that in focus-board 0.4.3 (https://github.com/cristoslc/bb-plugin-focus-board/blob/main/components/thread-pane.tsx) but it duplicates logic the host already owns and I would rather it lived in the host. Happy to attempt a PR after contributor approval.
AGENT GENERATED
Activity
SawyerHood commentedon Sep 30, 2026
Verified report: https://get-bb.github.io/reports/issues/4438.html
PARTIALLY REPRODUCED in two clean checkouts at the same main SHA by the same agent. PluginThreadChat lacks a local-file callback outside navigation context; a separate real Markdown-renderer browser fixture then opens the relative link at the local web origin and receives 404. Routed controls invoke the workspace callback. Current main already supplies workspaceRootPath and image routing. Full plugin-page/live preview behavior and broader #4466 remain untested. Four genuine screenshots and complete repeatable evidence are included.
SawyerHood commentedon Oct 19, 2026
Consolidated full-page ThreadChat routing evidence
Consolidating #4466 into this canonical tracker at the maintainer's request following the open-issue duplicate sweep.
#4466 adds a full-page plugin-route example (focus-board 0.5.3, bb 0.44.0 on macOS, SDK 0.5.29): inline workspace-relative .md paths render as inert code, whereas relative Markdown anchors in this issue navigate to broken app-origin URLs. Both local-file symptoms are consistent with missing routing context/callbacks outside the normal thread surface.
Evidence: https://get-bb.github.io/reports/issues/4466.html. Full reproduction, consumer link and plugin-side workaround are preserved in #4466. Its closure is consolidation, not confirmation that all symptoms have one cause.
Resolve and open Markdown links in one place (get-bb#6756)
Make plugin surfaces prove they use core's path and delete plugin-onl…