Skip to content

Conversation

@iam-brain
Copy link

@iam-brain iam-brain commented Jan 29, 2026

Summary

  • align CLI auth plugin selection with ProviderAuth last-wins behavior
  • cover selection logic with focused unit tests
  • guard non-string provider values to mirror prior CLI behavior

Test Plan

  • bun test --cwd packages/opencode test/cli/auth-plugin-selection.test.ts
  • bun test --cwd packages/opencode
  • bun run --cwd packages/opencode script/build.ts
  • manual: CLI auth login now correctly selects the custom plugin for openai installed from https://github.com/iam-brain/opencode, following the same logic that the TUI does.

Fixes #10898

@github-actions
Copy link
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
Copy link
Contributor

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

Based on my search, I found one potentially related PR:

PR #11058: fix: allow user plugins to override built-in auth plugins
#11058

This PR appears related because it also deals with auth plugin behavior and user plugins overriding built-in plugins, which aligns with the "last-wins behavior" mentioned in PR #11076.

All other results are the current PR (#11076) itself or unrelated auth/plugin features from earlier dates.

@iam-brain iam-brain force-pushed the fix-cli-provider-selection branch from d05e83d to 8d69fe1 Compare January 29, 2026 02:10
@iam-brain iam-brain marked this pull request as draft January 29, 2026 02:11
@iam-brain iam-brain marked this pull request as ready for review January 29, 2026 02:13
@iam-brain
Copy link
Author

Didn't realize #11058 was PR'ed for the same issue. Their implementation is much simpler, whereas this implementation looks to recreate the logic used in the TUI fromEntries() approach.

@iam-brain
Copy link
Author

#11058 has been merged, woohoo! Closed as this is no longer necessary.

@iam-brain iam-brain deleted the fix-cli-provider-selection branch February 3, 2026 16:14
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.

bug: Inconsistent Provider/Plugin Selection Between CLI and TUI (.find() vs fromEntries())

1 participant