GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Loopback server URLs are misclassified as remote · Issue #54722 · anomalyco/opencode

Loopback server URLs are misclassified as remote #54722

New issue
Copy link
New issue
Copy link
Closed
Closed
Loopback server URLs are misclassified as remote#54722
Copy link
Labels
reproduced

Description

@kpdagrt22
kpdagrt22
opened on Oct 12, 2026
Issue body actions

Description

Loopback detection in packages/app/src/runtime/server/registry.tsx and runtime.tsx classifies servers by string-slicing the URL, so uppercase LOCALHOST, userinfo, and IPv6 loopback URLs are misclassified as remote.

Version

2.0.27

Reproduction

Check ServerConnection.local for http://LOCALHOST:4096, http://user@localhost:4096, and http://[::1]:4096 on current dev. All return false instead of true.

Activity

  1. opencode-agent commented on Oct 12, 2026

    @opencode-agent
    opencode-agentBot
    on Oct 12, 2026 – with OpenCode Agent
    Contributor
    More actions

    Thanks for the report. I reproduced this on the latest dev (773d862).

    The script below runs a small bun unit test against ServerConnection.local() in packages/app:

    • http://localhost:4096 and http://127.0.0.1:4096 return true.
    • http://LOCALHOST:4096, http://user@localhost:4096 and http://[::1]:4096 all return false.

    I didn't run the 2.0.27 release itself, but isLocalHost is the same at the v2.0.27 tag as on dev. It is defined twice, in runtime/server/registry.tsx and runtime/server/runtime.tsx. Both copies strip the scheme, keep everything before the first :, and only accept exactly localhost or 127.0.0.1.

    Until this is fixed, using http://localhost:<port> (lowercase, no userinfo) keeps the server classified as local.

    Related: #49923 reported the same thing against v1 and was closed in the v1 cleanup. The earlier fix PRs #53330 and #49924 were closed without merging when dev was switched to v2.

    Reproduction script (loopback.sh)
    #!/usr/bin/env bash
    # Reproduces #54722: ServerConnection.local() misclassifies loopback URLs.
    # Usage: REPO=/path/to/opencode/checkout bash loopback.sh   (after `bun install` in REPO)
    set -euo pipefail
    REPO="${REPO:-/workspace/repo}"
    cat > "$REPO/packages/app/src/runtime/server/loopback-repro.test.ts" <<'TS'
    import { expect, test } from "bun:test"
    import { ServerConnection } from "./registry"
    
    const http = (url: string) => ({ type: "http" as const, http: { url } }) as ServerConnection.Any
    
    test.each([
      "http://localhost:4096",
      "http://127.0.0.1:4096",
      "http://LOCALHOST:4096",
      "http://user@localhost:4096",
      "http://[::1]:4096",
    ])("ServerConnection.local(%s) is true", (url) => {
      const result = ServerConnection.local(http(url))
      console.log(url, "->", result)
      expect(result).toBe(true)
    })
    TS
    cd "$REPO/packages/app"
    bun test --conditions=solid --preload ./happydom.ts ./src/runtime/server/loopback-repro.test.ts || true
    rm -f "$REPO/packages/app/src/runtime/server/loopback-repro.test.ts"

    Run it: bash loopback.sh

  2. opencode-agent
    added
    reproduced
    on Oct 12, 2026
  3. Tarquinen commented on Nov 5, 2026

    @Tarquinen
    Tarquinen
    on Nov 5, 2026
    Member
    More actions

    This was fixed by #60460: loopback addresses such as LOCALHOST, user@localhost and [::1] are now recognized when they point at the app's own server. It shipped in v2.2.3. Closing this issue.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

  4. Tarquinen
    closed this as completedon Nov 5, 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

    reproduced

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.