Repository navigation
fix: make upstream and model routing switches authoritative - #3
Merged
Merged
Conversation
Bring PR #3 (fix: make upstream and model routing switches authoritative) up to date with main and resolve the merge so main can fast-forward onto this branch. Resolution notes: - router: keep the PR guards (skip disabledModels, honour configuredModelsOnly) on top of main's supportsPath(target, rawPath, features) signature. - monitor: drop the configuration wrapper for POST /api/router/reload, which main removed as dead code along with its handler. - tests: keep main's expectations where the PR was stale (ResponsesServerConfig .Enabled, create-provider gating and help copy) while keeping the PR's new coverage: bootstrap keeps disabled/deleted channels, probe defaults to disabled, a disabled provider keeps model choices, provider toggle failure stays visible. - ui: rebuild internal/monitor/ui/dist from the merged source and drop the PR's stale bundle assets.
Follow-up hardening on top of the routing-switch work: - store: every Store view of one database now shares one state block, so a configuration transaction no longer runs with a fresh event sequence and an empty live subscriber set. - store: rebindingDB.Begin/BeginTx fail with ErrNestedTransaction instead of silently borrowing a pooled connection, and a nested ConfigurationTransaction is rejected before it can deadlock on the configuration lock. - store: add the upstream write lock. ConfigurationTransaction holds it for the whole transaction, while background/proxy refresh takes it on a best-effort basis and filters results against the live target set, so a refresh that raced a configuration change can no longer write rows for a deleted target. - router: commit the database transaction before publishing the new snapshot and outside router.mu, so request routing is not blocked for the duration of the commit. - channel: WithHTTPClient and WithReadOnly now return a derived service like WithStore, and an already initialized startup no longer rewrites the bootstrap marker. - monitor: add GET/DELETE /api/settings/channels to report and clear the channels.initialized marker through the configuration transaction. - docs: document the channels.initialized key and reset path plus the transaction/lock ordering invariants. Tests: new store, router, channel and monitor coverage for each fix.
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.
Description
Linked Issues
Type of Change
Verification Performed
Screenshots (if applicable)
Checklist