Skip to content

Support disabling well-known remote config entries and graceful fetch failure #23116

Closed as duplicate

Description

@MichaelRuhwedel

Summary

When a .well-known/opencode remote config URL is unreachable (e.g. VPN off, offline, GitHub Pages down), OpenCode crashes on startup with:

{
  "name": "UnknownError",
  "data": {
    "message": "Error: Unable to connect. Is the computer able to access the url?"
  }
}

There is no way to temporarily disable a well-known entry or recover without manually editing ~/.local/share/opencode/auth.json.

Problem

  1. No disable mechanism — The WellKnown schema only has type, key, token. Adding "enabled": false to auth.json is silently ignored.
  2. Hard failure on unreachable URL — The fetch in config/config.ts throws on failure with no try/catch, blocking all of OpenCode from starting.
  3. No env var or CLI flag to skip remote config fetching (there is OPENCODE_DISABLE_PROJECT_CONFIG but nothing equivalent for remote/well-known).

Proposed Solution

1. Respect an enabled field on well-known auth entries

Add an optional enabled field to the WellKnown schema (default true). When false, skip fetching.

export class WellKnown extends Schema.Class<WellKnown>("WellKnownAuth")({
  type: Schema.Literal("wellknown"),
  key: Schema.String,
  token: Schema.String,
  enabled: Schema.optionalWith(Schema.Boolean, { default: () => true }),
}) {}

2. Graceful fetch failure

Wrap the well-known fetch in a try/catch. On failure, log a warning and continue startup without the remote config rather than crashing.

3. (Optional) Add OPENCODE_DISABLE_REMOTE_CONFIG env var

Similar to OPENCODE_DISABLE_PROJECT_CONFIG, allow skipping all remote config fetches via an environment variable.

Relevant Source

  • packages/opencode/src/auth/index.ts — WellKnown schema
  • packages/opencode/src/config/config.ts — loadInstanceState function, wellknown fetch loop

Activity

  1. MichaelRuhwedel commented on Apr 17, 2026

    @MichaelRuhwedel
    Author

    Duplicate of #22163. Apologies for the noise.

  2. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 17, 2026
  3. github-actions commented on Apr 17, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions