Skip to content

fix(auth): filter out invalid entries in auth list#23289

Open
bensantora wants to merge 3 commits intoanomalyco:devfrom
bensantora:dev
Open

fix(auth): filter out invalid entries in auth list#23289
bensantora wants to merge 3 commits intoanomalyco:devfrom
bensantora:dev

Conversation

@bensantora
Copy link
Copy Markdown

@bensantora bensantora commented Apr 18, 2026

Issue for this PR

Closes #22802

Type of change

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

What does this PR do?

If users mistakenly put config keys like $schema or provider in auth.json, then Auth.all() would include them as undefined entries, showing 'undefined' in opencode auth list output. This fix filters out entries that fail schema decoding in Auth.all(). Invalid keys should now get stripped, leaving only valid auth entries

How did you verify your code works?

Tested locally by adding $schema and provider keys to auth.json — they were correctly filtered out and didn't appear in opencode auth list output

Screenshots / recordings

If this is a UI change, please include a screenshot or recording.

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
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.

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 auth list displays 'undefined' instead of provider name for authenticated sessions

1 participant