Skip to content

fix: gracefully handle well-known provider being down - #14522

Closed
optix2000 wants to merge 1 commit into
anomalyco:devfrom
optix2000:dev
Closed

optix2000 wants to merge 1 commit into
anomalyco:devfrom
optix2000:dev

Conversation

@optix2000

@optix2000 optix2000 commented Feb 21, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #10930

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Fixes issue where opencode crashes if a previously authed .well-known/opencode endpoint becomes unavailable.

Actually adds error handling and caching so transient errors, or downtime doesn't brick your opencode.

How did you verify your code works?

  1. Run a localhost/.well-known/opencode stub server,
  2. Run opencode auth login http://localhost
  3. Stop stub server
  4. opencode no longer crashes

Screenshots / recordings

# Server running
% opencode auth login http://localhost:3456

┌  Add credential
│
●  Running `echo stub-token`
│
◆  Logged into http://localhost:3456
│
└  Done

# Server stopped (old behavior)
% opencode
{
  "name": "UnknownError",
  "data": {
    "message": "Error: Unable to connect. Is the computer able to access the url?"
  }
}

% opencode run 'immediately return'
Error: Unexpected error, check log file at /Users/./.local/share/opencode/log/2026-02-21T052204.log for more details

Unable to connect. Is the computer able to access the url?

% bun run --cwd packages/opencode dev run 'immediately return'
$ bun run --conditions=browser ./src/index.ts run "immediately return"

> build · Claude Opus 4.6

Could you clarify what you mean? Are you referring to something in the codebase, a code pattern, or something else?

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Feb 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions github-actions Bot removed needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Feb 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Comment thread packages/opencode/src/config/config.ts Resolved
@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR.

@github-actions github-actions Bot closed this May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants