refactor(settings): extract backend resolution - #593
Merged
Conversation
Codex ReviewVerdict: mergeable No actionable findings. Summary: Static inspection of the requested diff, callers, tests, configuration, and repository standards found no concrete merge-blocking defects. Branch and pull-request title prechecks are valid. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
SettingsServicestill owned backend selection, provider/model projection, framework preparation, and live Responses bridge/proxy generations. That mixed persistent settings orchestration with ephemeral runtime state and made the façade continue growing after runtime installation management was extracted.Proposed change
AgentBackendResolveras the owner of one backend resolution flow and its live bridge/proxy generations.SettingsServiceas the existing façade; all public method signatures and type exports remain stable.ProviderAccountsModuleproject pure runtime targets and a separate secret-free reasoning capability profile.{ frameworkId }, with provider/model/reasoning late-bound at resolution time.Scope and non-goals
docs/internal/remain ignored and are not part of this PR.Acceptance criteria and validation
All checks below ran after the final material edit and independent Standards, Spec, and cross-surface reviews reported no remaining P0-P2 findings.
npm test -- --run src/main/settings/backend-resolver.test.ts src/main/settings/provider-accounts.test.ts-> 27/27 passed.npm run typecheck-> passed.npm run lint-> 0 errors; 23 pre-existing warnings.npm run check:web-api-map-> passed, no generated API change.npm run test:cli-> 29/29 passed.npm test-> 636 files passed, 15 skipped; 9,407 tests passed, 184 skipped.Uncovered risk: real provider processes and external APIs are not launched by the unit suite. The resolver keeps the existing framework adapters and provider preparation code paths, while fakes and loopback integration tests cover their ownership and cleanup contracts.
Review focus
AgentBackendResolverconstructor remains side-effect free; resources start only during resolution.Relates to #458.