Skip to content

Opencode should fall back to cached well-known config when endpoint is temporarily unavailable #10930

Closed

Description

@MaxMiksa

Description

If a user has a wellknown credential configured, Config.get() fetches <url>/.well-known/opencode during startup. If that endpoint is temporarily unavailable (e.g. 500, network hiccup, timeout), Opencode fails to start because config loading hard-throws.

This makes org/enterprise setups brittle: a transient config outage bricks the CLI/agent even if local/project config could still be used.

Suggested fix

  • Cache the last successful well-known config payload locally (e.g. XDG cache).
  • On fetch failure, fall back to the cached config (with a warning) instead of hard-failing.
  • Add a configurable fetch timeout (e.g. OPENCODE_WELLKNOWN_TIMEOUT_MS).

Steps to reproduce

  1. Configure a well-known credential (e.g. via opencode auth login <url>).
  2. Ensure <url>/.well-known/opencode becomes unavailable (500 / offline) after a successful run.
  3. Start Opencode again.

Expected

Opencode starts and uses the cached well-known config (and logs a warning).

Actual

Opencode throws failed to fetch remote config from <url>: <status> during config load and exits.

Environment

  • OS: Windows 11 (also affects any OS on transient network failures)
  • Terminal: Windows Terminal

Activity

  1. github-actions commented on Mar 30, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

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