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 — Auth logout does not remove remote .well-known integration · Issue #59320 · anomalyco/opencode

Auth logout does not remove remote .well-known integration #59320

New issue
Copy link
New issue
Copy link
Closed
#62760
Closed
Auth logout does not remove remote .well-known integration#59320
#62760
Copy link
Labels
reproduced

Description

@nimrodmoshe05-glitch
nimrodmoshe05-glitch
opened on Oct 26, 2026
Issue body actions

Description

opencode auth logout removes the saved credential, but remote .well-known/opencode integrations are reintroduced by the discovery layer and remain available afterward. This makes logout incomplete for remote integrations and leaves users effectively still logged in.

Relevant code paths:

  • packages/cli/src/commands/handlers/auth/logout.ts
  • packages/core/src/wellknown/plugin.ts
  • packages/core/src/wellknown.ts

The logout flow deletes the credential record only; it does not remove the runtime-discovered integration entry created from the remote well-known manifest.

Plugins

No response

OpenCode version

No response

Steps to reproduce

  1. Configure a remote provider/integration that exposes a .well-known/opencode manifest.
  2. Authenticate so the remote integration is discovered and added.
  3. Run opencode auth logout <target>.
  4. Observe that the integration remains available or is re-added even though the credential was removed.

Screenshot

No response

Operating System

No response

Terminal

No response

Reacted by Benjamin Etheredge

Activity

  1. opencode-agent commented on Oct 26, 2026

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

    Thanks for the report! Before we can look into this, could you add a few details?

    • OpenCode version (opencode --version), OS, and how you installed it.

    • What you actually see after opencode auth logout <target>, in your own words. For example:

      • Is the integration only still listed (e.g. in opencode auth list or the integrations dialog) with a "Log in" option?
      • Do the remote provider's models, or the policies from its remote config, still work or still apply?
      • Do requests fail (e.g. 401 / invalid API key)?

      Please include any error output.

    • What you expected instead. For example: should logout make the integration disappear completely, or only stop its config and credentials from applying?

    Some context: after logout, the integration is meant to stay listed so you can log in again. Its last remote config is also kept on purpose until the well-known source itself is removed. So we need to know exactly what is left behind for you.

    You can reply here with the details or edit the issue. If you edit it, please also leave a comment saying you've updated it, so we know you're done.

    These existing issues look related, ordered by likelihood. Please check whether one already covers your problem:

    • providers: stale wellknown API-key wiring in the shared service sends an empty key after auth login/logout #54645: after auth logout, the stale cached well-known remote config stays in effect and sends an empty API key (401s), even after a restart
    • fix(core): drop logged-out wellknown endpoints instead of wiring empty api keys #54687: open PR that would drop the cached config of logged-out well-known sources instead of keeping it
    • One unreachable well-known origin hides every other integration #46187: another issue about how well-known sources are handled (an unreachable origin hides other integrations)
  2. opencode-agent
    added
    triaging
    on Oct 26, 2026
  3. nimrodmoshe05-glitch commented on Oct 26, 2026

    @nimrodmoshe05-glitch
    nimrodmoshe05-glitch
    on Oct 26, 2026
    Author
    More actions
    • version latest - 2.1.4
    • not listed, gone. but the remote config (models, policies, etc) are still loaded and applied, a CRITICAL bug that has to be patched ASAP
    • requests do not fail, but are send through a integration and account that was logged out and supposed to be removed!
  4. nimrodmoshe05-glitch commented on Oct 26, 2026

    @nimrodmoshe05-glitch
    nimrodmoshe05-glitch
    on Oct 26, 2026
    Author
    More actions

    @opencode-agent updated

  5. opencodejr commented on Oct 28, 2026

    @opencodejr
    opencodejrBot
    on Oct 28, 2026
    Contributor
    More actions

    Thanks for the report. I could reproduce this on v2.2.0 (the latest release, since no version was given), and it still happens on the latest dev (9adc42b55).

    What I did, using a local mock server for /.well-known/opencode whose manifest has an auth command and a config that adds a provider:

    1. opencode auth login http://127.0.0.1:PORT --method login: connects, and opencode models lists the provider's model.
    2. opencode auth logout http://127.0.0.1:PORT <credential>: prints "Removed account", and opencode auth list says there are no authenticated integrations.
    3. The well-known integration is still returned by the integration list, and opencode models still lists the provider from the manifest's config.

    The credential is deleted, but the well-known source stays registered and its last config keeps loading from cache. Nothing currently calls the code path that would remove the source. The script below reproduces it end to end.

    Reproduction script (repro.sh)
    #!/usr/bin/env bash
    # Reproduces anomalyco/opencode#59320: `opencode auth logout` leaves a .well-known/opencode integration
    # (and its remote config) in place.
    # Usage: bash repro.sh            (uses `opencode` from PATH)
    #   From source: PROJECT=<repo>/packages/cli OC="bun --conditions=browser <repo>/packages/cli/src/index.ts" bash repro.sh
    # Expected after logout: wkprov/wk-model and the well-known integration are gone. Actual: both remain.
    set -u
    OC="${OC:-opencode} --standalone"
    WORK=$(mktemp -d /tmp/opencode/wk.XXXX)
    export HOME=$WORK/home XDG_CONFIG_HOME=$WORK/home/.config XDG_DATA_HOME=$WORK/home/.local/share \
      XDG_STATE_HOME=$WORK/home/.local/state XDG_CACHE_HOME=$WORK/home/.cache
    mkdir -p "$HOME" "$WORK/project"
    PORT=47${RANDOM:0:3}
    # Mock well-known server: auth command prints a token; config adds a provider "wkprov"
    cat > $WORK/server.ts <<TS
    Bun.serve({ port: $PORT, fetch(req) {
      const u = new URL(req.url)
      if (u.pathname === "/.well-known/opencode") return Response.json({
        auth: { command: ["echo", "secret-token"], env: "WK_TOKEN" },
        config: { provider: { wkprov: { name: "WellKnown Provider", npm: "@ai-sdk/openai-compatible",
          options: { baseURL: "http://127.0.0.1:$PORT/v1", apiKey: "{env:WK_TOKEN}" },
          models: { "wk-model": { name: "WK Model" } } } } } })
      return new Response("nf", { status: 404 })
    }})
    TS
    bun $WORK/server.ts & SRV=$!
    sleep 1
    cd "${PROJECT:-$WORK/project}"
    echo "== opencode version"; $OC --version
    echo "== login"; $OC auth login http://127.0.0.1:$PORT --method login 2>&1 | tail -5
    echo "== auth list after login"; $OC auth list 2>&1 | tail -15
    echo "== models after login (wkprov)"; $OC models 2>&1 | grep -i wk
    echo "== logout"; $OC auth logout http://127.0.0.1:$PORT 127.0.0.1 2>&1 | tail -5
    echo "== auth list after logout"; $OC auth list 2>&1 | tail -15
    echo "== integration after logout (integration.list, filtered)"; $OC api integration.list 2>&1 | grep -o '"id":"http://127.0.0.1[^"]*","name":"[^"]*"' || echo "(gone)"
    echo "== models after logout (wkprov)"; $OC models 2>&1 | grep -i wk || echo "(none)"
    kill $SRV

    Run it: bash repro.sh

  6. opencodejr
    added
    reproduced
    and removed
    triaging
    on Oct 28, 2026
  7. sergiobank commented on Nov 2, 2026

    @sergiobank
    sergiobank
    on Nov 2, 2026
    More actions

    @rekram1-node @thdxr can we address this? As of now auth logout is broken

  8. sergiobank commented on Nov 5, 2026

    @sergiobank
    sergiobank
    on Nov 5, 2026
    More actions

    @rekram1-node @thdxr can we merge this? As of now auth logout is totally broken

  9. rekram1-node
    closed this as completedin #62760on Nov 9, 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.