fix(providers): sync registry to controlplane SSOT — codex→openai-subscription byok #2025
Reference in New Issue
Block a user
Delete Branch "fix/providers-ssot-sync-codex-subscription"
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?
Sync provider registry to controlplane SSOT — codex → openai-subscription (byok)
Root-cause not symptom
The codex agents showed NOT CONFIGURED (
codex adapter: MOLECULE_LLM_BILLING_MODE=platform_managed but no platform provider). Root cause: molecule-core's syncedproviders.yaml+ derive logic were stale — cp#423/#426 splitopenai→openai-subscription(oauth, CODEX_AUTH_JSON)/openai-api(OPENAI_API_KEY) in the controlplane but it was never synced here. So codex derived the staleopenai(requires OPENAI_API_KEY), billing fell back / got band-aided to platform_managed, which contradicts theopenai-subscriptionprovider the CP generates → adapter error. This syncs core to the CP SSOT so codex derivesopenai-subscription→IsPlatform()false → byok, using CODEX_AUTH_JSON.Comprehensive testing performed
go build ./... && go vet ./... && go test ./... && go test -tags=integration ./...all green, inclinternal/providers/...(derive_provider_test, sync_canonical_test, verify-gen) +internal/handlers/...(billing/secrets). The synced CP derive_provider_test already coverscodex + CODEX_AUTH_JSON → openai-subscription.Local-postgres E2E run
N/A — registry/derive change; no schema/migration.
Staging-smoke verified or pending
Pending post-merge: fleet-rollout to agents-team tenant, clear the platform_managed override, recreate, verify the canvas shows openai-subscription + CONFIGURED + a real codex turn.
Five-Axis review walked
Correctness: providers.yaml + derive_provider.go + providers.go copied BYTE-EXACT from controlplane HEAD fa44dc8 (cmp-verified); registry_gen.go regenerated via
go generate; sha pin bumped to dedbb8cc (matches live CP → sync-providers-yaml gate passes). Readability/Arch: derive logic is now identical to CP (adds canonical authEnvMatches/disambiguateByAuthEnv helpers); no invented functions (no DerivePlatformAxis); llm_billing_mode.go untouched. Security: secrets.go adds CODEX_AUTH_JSON to platformManagedDirectLLMBypassKeys so the byok credential check counts the shared subscription token + it's included in the platform-managed strip-list. Performance: registry load unchanged.No backwards-compat shim / dead code added
No shim — this REMOVES drift by syncing to SSOT. The platform_managed band-aid is retired at the data layer (override cleared post-deploy).
Memory/saved-feedback consulted
project_codex_shared_oauth_burn_central_refresher, project_codex_provider_ssot_split, project_codex_billing_mode_byok_default_wedge, feedback_no_single_source_of_truth, feedback_verify_real_artifact_not_proxy_metric (this PR fixes the NOT-CONFIGURED state the canvas showed after a premature token-only verification).
Also closes the red
sync-providers-yamlgate (core was behind CP)./sop-ack comprehensive-testing
/sop-ack local-postgres-e2e
/sop-ack staging-smoke
/sop-ack root-cause
/sop-ack five-axis-review
/sop-ack no-backwards-compat
/sop-ack memory-consulted
qa: providers.yaml+derive byte-exact from CP SSOT (cmp-verified), registry_gen regenerated, sync_canonical sha pinned to live CP. go test ./... + integration green incl derive_provider_test (codex+CODEX_AUTH_JSON→openai-subscription). Approving.
security: secrets.go adds CODEX_AUTH_JSON to the byok bypass + platform-managed strip-list (the shared subscription token is name-only counted; never logged). Derive logic is CP-verbatim, no invented bypass. Approving.
/qa-recheck
/security-recheck