D. Multi-account: multiple source instances on one worker #120
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
P1
P2
P3
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Creatidy/scarcity-router#120
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Child D of #116 (Dynamic Execution Sources program).
MUST support multiple independent Codex sources on ONE worker host (e.g. "Personal Pro" + "Second account") without exposing
worker process #1/#2,CODEX_HOME path #1/#2,codex-1/codex-2adapter ids to the user — those are implementation details.Current collision (recon)
LocalAdapterRegistry(worker_local_adapters.py:113) keys on adapter id and raises on duplicate"codex";build_registry(worker_client.py:1020) constructs at most oneCodexLocalAdapterwith one resource/model.ControlledCodexHomederives fromstate_dironly; default state dir means all worker processes share ONEcodex/codex-home.ResourceConfig.local_adapter_idis a free safe id, butserver_composition.py:316emits codex compatibility cells only forlocal_adapter_id == "codex".Design
Prefer ONE native worker process per host. Distinguish adapter KIND (
codex) from adapter INSTANCE / execution source (source_id):Minimal explicit solution; do not overload physical model names as source identities; do not break the server's exact ownership discipline (resource→worker binding stays administrator configuration; state reports never confer ownership).
Isolation requirements
Each source has an isolated
source_id, controlled CODEX_HOME, auth state, inventory, execution identity, quota/capacity observations. No credential shared between sources; no source can accidentally execute using another source's controlled home.Quota-pool semantics
Two independent OpenAI accounts must NOT automatically share one quota pool:
source A → pool A / unknown sharing,source B → pool B / unknown sharing; only explicit evidence establishes sharing. Same physical model via two accounts = two targets with different source/resource/entitlement capacity; routing may choose between them. D-042 quota rules unchanged.Source-local authentication UX (child E implements the surfaces): "Add Codex source → creates controlled home → one clear login command → official codex login → authenticated → inventory appears". No manual path derivation, no
auth.jsoncopying, no token extraction, no use of unrelated~/.codex.Closeout — implemented in merged PR #124 (merge commit
a4370f0intodevelop, head9789c67; program #116 / D-053).Child D delivered: adapter KIND vs INSTANCE separation (
codex:<source_id>), one worker process serving any number of independent Codex sources, each with its own isolated controlled home (codex-sources/<source_id>/,0o700), auth state, inventory and execution identity — verified live with two sources on one worker (distinct homes on disk, two exact targets for the same physical model, distinct quota pools). Worker protocol v2 adds the bounded inventory section (negotiated; v1 peers unaffected);--codex-sourceand the officialcodex-logincommand (SSH-safe device auth — no browser/localhost fallback, no legacy-home or~/.codexfallback, no credential copying) ship worker-side. Default per-source quota pools; sharing only via explicit pool id (D-042 rules unchanged).