feat(admin): assign existing upstreams to pools#167
Open
erwill2 wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
cleaning this up to resolve conflicts |
erwill2
force-pushed
the
feat/admin-assign-upstream-pool
branch
from
July 14, 2026 18:02
e670518 to
911ce31
Compare
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.
Summary
Adds a complete admin workflow for attaching an existing upstream identity to a Pool, and fixes account reactivation so a newly attached
pendingPool assignment can become operational.These changes are combined because they share the same assignment lifecycle invariant: an existing Pool/identity slot must be safely promoted to an active, eligible assignment rather than duplicated or left pending.
Operator workflow
pool.operatecapability and current identity visibility at execution time.Assignment lifecycle and race handling
active/activehealth /eligible.pendingrow instead of leaving the new attachment non-operational.FOR UPDATE, preventing concurrent admin clicks or delete/reactivate overlap from producing duplicate/stale outcomes.Coordinated side effects
The scoped workflow also:
upstream_account.assign_poolin the audit log;upstream_assignment_assignedinvalidation event;Reactivation fix
Account reactivation now treats a
pendingPool assignment as reactivatable. This covers the attach-after-detach sequence where the preserved/source assignment was removed and the newly attached target assignment is still pending. Deleted assignments remain deleted.Validation
mix compile --warnings-as-errors- passedmix test test/codex_pooler/audit_test.exs- 4 passed, 0 failuresgit diff --check- passedScope boundaries
refreshingrecovery are separate PRs.side_effects.exOban-state change is intentionally excluded; duplicate gateway reconciliation is tracked separately in issue Bug: investigate duplicate gateway reconciliation and token-refresh runs #166.