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 #59320DescriptionDescription
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
- Configure a remote provider/integration that exposes a
.well-known/opencode manifest.
- Authenticate so the remote integration is discovered and added.
- Run
opencode auth logout <target>.
- 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 Activityopencode-agent commented on Oct 26, 2026 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:
nimrodmoshe05-glitch commented on Oct 26, 2026
- 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!
nimrodmoshe05-glitch commented on Oct 26, 2026 opencodejr commented on Oct 28, 2026 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:
opencode auth login http://127.0.0.1:PORT --method login: connects, and opencode models lists the provider's model.
opencode auth logout http://127.0.0.1:PORT <credential>: prints "Removed account", and opencode auth list says there are no authenticated integrations.
- 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
sergiobank commented on Nov 2, 2026 sergiobank commented on Nov 5, 2026
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|