Honor configured providers during login and model discovery - #362
Conversation
Coordinated review result: no blocker found in this PRReviewed commit The earlier CLI/provider integration problems are resolved:
Verification: 227 targeted CLI tests passed in the combined isolated Python 3.13 / Core 2.0.1 environment. Provider defaults remain The remaining coordinated-review requests are provider local metadata handling (#18) and Unified abandoned candidate cleanup / capped test-message UI (#281), not regressions introduced by this generic loader change. Real OAuth and paid inference were not tested, so this is not a live-service acceptance claim or a merge action. |
Provider setup collected settings but discarded them before constructing the provider for login or model discovery. A user-selected authentication mode or credential file could therefore silently use the provider's default account instead. The shared loader now binds the constructor once, passes an independent copy of the selected configuration and declared connection arguments, and preserves validation errors instead of retrying with defaults.
provider loginalso resolves an exact configured instance before its module and rejects ambiguous module-only matches rather than choosing an account by priority. Authentication choices, credential paths, and consent remain provider-owned metadata and behavior; this change adds no provider-specific authentication code.Validation: 76 focused loader, wizard, login, model-discovery, and optional-field tests passed, including an independent review rerun. Regression cases cover nested configuration isolation, constructor error preservation, optional server arguments, metadata-only discovery, configured login/catalog parity, and named-account ambiguity. The new tests reproduced 13 failures on the previous loader before the fix. No real authentication, paid inference, or installed-host changes were used.
Cross-repository acceptance also passed six hermetic cases against the current ChatGPT provider candidate's real metadata, constructor, login dispatch, and catalog dispatch. Both connection modes, default/custom credential paths, plan host identity/application name, settings persistence and reconfiguration, exact named-instance login alongside a second same-module account, legacy alias normalization, and invalid-mode rejection were exercised. Only remote authentication/catalog boundaries were replaced; network access was blocked. These external compatibility tests do not add a provider dependency to the CLI test suite.