feat(providers): BYOK-routability-aware workspace-create enforcer (cp#529) #2256

Merged
hongming merged 1 commits from feat/cp529-byok-routability-enforcer into main 2026-06-04 23:07:42 +00:00
Owner

cp#529 — Option C (CTO-approved): routability-aware enforcer

validateRegisteredModelForRuntime now allows a model if it is on the runtimes platform menu (ModelsForRuntime) OR DeriveProvider resolves a native provider. Wires confirmed-non-platform BYOK providers into claude-code/hermes/openclaw as name-only native arms (zero platform-menu change) + widens their prefix matchers to accept both slash and colon BYOK id forms.

Billing guardrail: only non-platform (BYOK) providers are wired. Platform-shared vendors (openai/gemini/minimax/anthropic, and groq which has no provider) are deliberately NOT wired, so their ids stay residual drift rather than billing a customers model through the platform key.

Result (drift checker): claude-code fully resolves (27/27); residual = only platform-shared ids — hermes anthropic/·gemini/·openai/·minimax/ (12), codex codex-minimax (1), openclaw groq:·openai:·minimax: (7). Those get trimmed from templates / restored via dedicated BYOK-vendor providers in a follow-up.

Build + providers/gen/handlers tests green.

⚠️ Coordination: overlaps the same files (providers.yaml, registry_gen.go, runtimes_test.go, sync_canonical_test.go) as open PR #2241 (cp#521) which takes the opposite trim approach on claude-code. CTO chose routability (Option C) so cp#529 supersedes that ids trim, but #2241 has other valuable changes (MiniMax-M2.7 rename, canvas-deploy-status). Co-review + rebase before merge.

Paired with molecule-controlplane feat/cp529-byok-routability-checker (byte-synced providers.yaml — must land together).

Refs cp#529.

## cp#529 — Option C (CTO-approved): routability-aware enforcer `validateRegisteredModelForRuntime` now allows a model if it is on the runtimes platform menu (`ModelsForRuntime`) **OR** `DeriveProvider` resolves a native provider. Wires confirmed-non-platform BYOK providers into claude-code/hermes/openclaw as **name-only native arms** (zero platform-menu change) + widens their prefix matchers to accept both slash and colon BYOK id forms. **Billing guardrail:** only non-platform (BYOK) providers are wired. Platform-shared vendors (openai/gemini/minimax/anthropic, and groq which has no provider) are deliberately NOT wired, so their ids stay residual drift rather than billing a customers model through the platform key. **Result (drift checker):** claude-code fully resolves (27/27); residual = only platform-shared ids — hermes `anthropic/`·`gemini/`·`openai/`·`minimax/` (12), codex `codex-minimax` (1), openclaw `groq:`·`openai:`·`minimax:` (7). Those get trimmed from templates / restored via dedicated BYOK-vendor providers in a follow-up. Build + providers/gen/handlers tests green. ⚠️ **Coordination:** overlaps the same files (providers.yaml, registry_gen.go, runtimes_test.go, sync_canonical_test.go) as open **PR #2241 (cp#521)** which takes the opposite *trim* approach on claude-code. CTO chose routability (Option C) so cp#529 supersedes that ids trim, but #2241 has other valuable changes (MiniMax-M2.7 rename, canvas-deploy-status). Co-review + rebase before merge. **Paired with** molecule-controlplane `feat/cp529-byok-routability-checker` (byte-synced providers.yaml — must land together). Refs cp#529.
hongming added 1 commit 2026-06-04 21:37:15 +00:00
feat(providers): BYOK-routability-aware workspace-create enforcer (cp#529)
ci-arm64-advisory / fast-checks (pull_request) Waiting to run
Lint shellcheck (arm64 pilot) / shellcheck-arm64 (pilot) (pull_request) Successful in 1s
CI / Detect changes (pull_request) Successful in 6s
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 7s
CI / Python Lint & Test (pull_request) Successful in 6s
E2E API Smoke Test / detect-changes (pull_request) Successful in 7s
Harness Replays / detect-changes (pull_request) Successful in 4s
E2E Chat / detect-changes (pull_request) Successful in 8s
Lint forbidden tenant-env keys / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 10s
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 10s
qa-review / approved (pull_request_target) Failing after 6s
gate-check-v3 / gate-check (pull_request_target) Successful in 7s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 13s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 9s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 16s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 4s
CI / Canvas (Next.js) (pull_request) Successful in 5s
security-review / approved (pull_request_target) Failing after 9s
Harness Replays / Harness Replays (pull_request) Successful in 1s
E2E Chat / E2E Chat (pull_request) Successful in 8s
verify-providers-gen / Regenerate providers artifact and fail on drift (pull_request) Successful in 27s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 55s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 4s
CI / Canvas Deploy Status (pull_request) Has been skipped
E2E Staging SaaS (full lifecycle) / pr-validate (pull_request) Successful in 34s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 3m28s
E2E Staging SaaS (full lifecycle) / E2E Staging SaaS (pull_request) Failing after 2m23s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 2m44s
CI / Platform (Go) (pull_request) Successful in 4m12s
CI / all-required (pull_request) Successful in 2s
E2E Staging SaaS (full lifecycle) / E2E Staging Platform Boot (pull_request) Failing after 5m10s
sop-checklist / review-refire (pull_request_target) Has been skipped
sync-providers-yaml / Compare synced providers.yaml against controlplane canonical (pull_request) Successful in 12s
sop-tier-check / tier-check (pull_request_target) Successful in 4s
sop-checklist / all-items-acked (pull_request) acked: 0/7 — missing: comprehensive-testing, local-postgres-e2e, staging-smoke, +4 — body-unfilled: comprehensive-testing, local-postgres-e2
sop-checklist / na-declarations (pull_request) N/A: (none)
sop-checklist / all-items-acked (pull_request_target) Successful in 59s
qa-review / approved (pull_request_review) Has been skipped
security-review / approved (pull_request_review) Has been skipped
sop-tier-check / tier-check (pull_request_review) Successful in 4s
audit-force-merge / audit (pull_request_target) Successful in 4s
ddc4e8190c
validateRegisteredModelForRuntime now allows a model if it is on the
runtime's platform menu (ModelsForRuntime) OR DeriveProvider resolves a
native provider — the CTO-approved Option C routability path. Wire
confirmed-non-platform BYOK providers into claude-code/hermes/openclaw as
name-only native arms (zero platform-menu change) + widen their prefix
matchers to accept both slash and colon BYOK id forms.

Billing guardrail: only non-platform (BYOK) providers are wired; the
platform-shared vendors (openai/gemini/minimax/anthropic, and groq which
has no provider) are deliberately NOT wired, so their ids stay residual
drift rather than billing a customer's model through the platform key.

claude-code now fully resolves; residual drift = only platform-shared ids
(hermes anthropic//gemini//openai//minimax/, codex codex-minimax, openclaw
groq:/openai:/minimax:) — trimmed from templates / restored via dedicated
BYOK-vendor providers in a follow-up. Build + providers/gen/handlers tests
green.

NOTE: overlaps files with open PR #2241 (cp#521, trim approach); co-review
and rebase before merge.

cp#529

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
hongming added the tier:medium label 2026-06-04 23:01:45 +00:00
core-qa approved these changes 2026-06-04 23:06:52 +00:00
core-qa left a comment
Member

QA (cp#529 routability-aware enforcer). Reviewed: validateRegisteredModelForRuntime now allows model ∈ ModelsForRuntime OR DeriveProvider resolves; BYOK passthrough providers wired as name-only arms (no platform-menu change); fail-open branches preserved; tests cover BYOK-pass + unroutable-422 + platform-unaffected. Required CI green, sync-gate green. Approve.

QA (cp#529 routability-aware enforcer). Reviewed: validateRegisteredModelForRuntime now allows model ∈ ModelsForRuntime OR DeriveProvider resolves; BYOK passthrough providers wired as name-only arms (no platform-menu change); fail-open branches preserved; tests cover BYOK-pass + unroutable-422 + platform-unaffected. Required CI green, sync-gate green. Approve.
core-security approved these changes 2026-06-04 23:06:53 +00:00
core-security left a comment
Member

Security (cp#529). BILLING GUARDRAIL verified: only confirmed-non-platform providers (own auth_env) wired into BYOK runtime arms; platform-shared providers (anthropic-api/openai-*/moonshot/minimax/google/vertex/platform) deliberately NOT wired, so a BYOK menu id can never route through a platform key. IsPlatform unchanged (name=='platform'), so BYOK derives to byok billing. No new secret/authz surface. Approve.

Security (cp#529). BILLING GUARDRAIL verified: only confirmed-non-platform providers (own auth_env) wired into BYOK runtime arms; platform-shared providers (anthropic-api/openai-*/moonshot/minimax/google/vertex/platform) deliberately NOT wired, so a BYOK menu id can never route through a platform key. IsPlatform unchanged (name=='platform'), so BYOK derives to byok billing. No new secret/authz surface. Approve.
hongming merged commit 9b19759ceb into main 2026-06-04 23:07:42 +00:00
Sign in to join this conversation.
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#2256