Skip to content

Conversation

@elithrar
Copy link
Contributor

@elithrar elithrar commented Jan 5, 2026

Adds debug logging and error handling for .well-known/opencode config fetches in enterprise installs.

problem:

  • No visibility into when enterprise wellknown config is fetched or changed - makes debugging enterprise config issues difficult
  • No way to detect if the wellknown endpoint returned different config between runs
  • Missing error handling causes crashes when wellknown servers are unreachable or return invalid responses
  • URL normalization issues (trailing slashes) can cause double-slash URLs like https://example.com//.well-known/opencode

solution:

  • Added log.debug() before/after wellknown fetch with URL and SHA-256 hash of response body
  • Hash allows detecting config changes between runs (compare hashes in logs)
  • Normalized URLs using new URL().origin to strip trailing slashes and paths
  • Added error handling in auth login flow (invalid URLs, fetch failures, non-200 responses)

Example log output with --print-logs:

DEBUG service=config url=https://opencode.example.com/.well-known/opencode fetching wellknown config
DEBUG service=config url=https://opencode.example.com/ hash=4142764bad628c8c8883665f9b17b4b32af24cb7ca9d4d4da57f85cc5ca21c18 loaded wellknown config

@github-actions
Copy link
Contributor

github-actions bot commented Jan 5, 2026

The following comment was made by an LLM, it may be inaccurate:

Duplicate PR Search Results

No duplicate PRs found. The PR you're checking (feat: add logging and error handling for wellknown config) appears to be unique.

Related PR (Not a duplicate):

Conclusion: This PR appears to be a new feature addressing visibility, error resilience, and debugging capabilities for enterprise wellknown config fetches. No conflicting or duplicate work was found in open PRs.

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.

1 participant