Skip to content

[Bug]: Issue URLs on a self-hosted Forgejo hostname are not recognised #40270

Closed

Description

@turnercore

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Self-host Forgejo on a hostname that contains neither a forgejo nor a gitea label, such as git.example.com.
  2. Add a project from a repository on that server. Its issue binding resolves to Forgejo (link_issue with projectId + key works).
  3. In a thread in that project, have the agent call link_issue or read_issue with the issue's full URL, https://git.example.com/acme/web/issues/4.

Expected behavior

The URL resolves through the project on that host, the same way #38251 made it work for GitHub Enterprise hostnames.

Actual behavior

Issue operation resolveUrl failed: This is not a recognised issue URL.

IssueService.resolveUrl falls back to parseOnProjectHost, which calls the provider's parseIssueUrl(url, known = true). GitHub's parser honours known; Forgejo's ignores it and still requires isForgejoHost(url.hostname):

// packages/source-control-forgejo/src/shared/definition.ts
parseIssueUrl: (url) => (isForgejoHost(url.hostname) ? parseIssuePath(url, ISSUE_PATH) : null),

Impact

Minor bug or occasional failure

Version or commit

0.1.12-nightly.20261120.4994; the code is unchanged on main at 714997c.

Environment

Self-hosted Forgejo on a custom domain, T3 server on Windows and Linux.

Logs or stack traces

From one day of agent sessions on one machine: 6 of 9 link_issue/read_issue calls by URL failed this way. Agents recovered by retrying with projectId + key, which costs a turn each time; one guessed key: "owner/repo#38" and failed again.

Workaround

Pass projectId and key instead of url.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions