JetBrains / JetBrains/thinkrail

Desktop app hands links to itself over to the OS browser when the host is spelled `localhost` or `[::1]`

Open Beginner friendly
#372 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
467
Forks
37
Avg merge
1d 56m
Merged PRs (30d)
141

Description

## Description

The desktop window loads http://127.0.0.1:port, and the external-navigation check (apps/desktop/src/externalNavigation.ts) treats any URL whose origin string differs as external and opens it via the OS. But the loopback host has three spellings (localhost, 127.0.0.1, [::1]), so a link to the app itself written as http://localhost:port opens the default browser onto the app's own address instead of staying internal.

## Steps to reproduce

1. Launch the desktop app
2. Find its port via `lsof -nP -iTCP -sTCP:LISTEN | grep bun`, get a clickable http://localhost:port/ link inside the app (e.g., ask the agent to reply with exactly that markdown link), click it.

## Expected behavior

internal link

## Actual behavior

the OS browser opens onto the app's own host

Image

## Environment

- OS: macOS
- Bun version (`bun --version`): 1.4.0
- Node version (`node --version`): v26.8.1
- ThinkRail version / commit: 756a4b8e0bff94a36565e354c511f2b3bf353fd6

Contributor guide

Open the contributing guide

Research direction

Start with apps/desktop/src/externalNavigation.ts and reproduce the issue using a clickable http://localhost:port/ link after finding the port with the documented lsof command. Check how the navigation check compares loopback host spellings, then verify that links using localhost, 127.0.0.1, and [::1] stay internal while external links still open through the OS browser.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
desktop
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.