anomalyco / anomalyco/opencode

Autolinked URLs include trailing parentheses/text in the clickable link

Open Beginner friendly
#49,748 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

When a plain URL is returned in a message, the automatic link detection (linkification) greedily swallows trailing text, so punctuation that follows the URL becomes part of the clickable link.

For example, the following output:

本地测试版已启动: http://127.0.0.1:4173/ (构建产物已生成, HTTP 200)。

renders with the entire http://127.0.0.1:4173/ (构建产物已生成, HTTP 200) — including the trailing bracket and the sentence after it — as a single clickable link. Only the bare URL should be marked as a link:

本地测试版已启动: http://127.0.0.1:4173/ (构建产物已生成, HTTP 200)。
                            ^^^^^^^^^^^^^^^^^^^^^^ only this part
Steps to reproduce
  1. Have the assistant (or a build/tool output) return a URL immediately followed by text in parentheses, e.g. http://127.0.0.1:4173/ (some note).
  2. Observe the rendered message.
Expected behavior

Linkification should stop at the end of the URL and exclude trailing punctuation/whitespace, i.e. only http://127.0.0.1:4173/ becomes a link. This matches common autolink behavior (e.g. GitHub, GFM), where trailing ), ., ,, , etc. are excluded from the link.

Actual behavior

The trailing ( ... ) text, and everything up to the closing bracket, is included inside the clickable link.

Environment
  • opencode version: txds/deepseek-v4.1-flash build shown in the screenshot
  • OS: macOS (darwin)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is identified in the issue. Locate the message linkification implementation and its URL-parsing tests, then reproduce the parenthesized-text example; done means only the bare URL is clickable while trailing punctuation and text remain outside the link.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.