Repository navigation
feat(inference): bounded native BYOK key rotation (Wave 1, validation pending) - #8486
Draft
AmirrezaFarnamTaheri wants to merge 35 commits into
Draft
AmirrezaFarnamTaheri wants to merge 35 commits into
AmirrezaFarnamTaheri wants to merge 35 commits into
Conversation
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Comment |
…eams and deferred routes
…and stream lifecycle
…s without enabling live traffic
…nd custom CA support
…CA and proxy settings
…g credentialed clients
…l per HTTP request
…el per rotation credential
…ey cloud requests
…er native cloud calls
Author
|
Wave 1 security/compatibility review of the current native rotator implementation:
Keep this PR draft until these issues and the full Rust coverage, runtime integration, endpoint safety and manual smoke gates are satisfied. |
This branch has not been deployed
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
CredentialFleetModelinference adapter (11 targeted tests) covering safe pre-output failover, bounded retries, partial-stream replay prevention, capability routing, and deferred-handle identity.Problem
The fork has a native API key rotator, but upstream has no corresponding
key_pool.rs/credential_fleet.rsand none of the current upstream PRs contains per-request credential rotation. Simply pasting the full fork changes would conflate provider registration, OAuth, tool codecs and unrelated migrations.Solution
The branch contains the credential scheduler, native inference adapter, and BYOK cloud-factory wiring. Remaining work covers configuration/RPC and UX management, cross-profile safety, and hosted CI validation. The contained pool tracks secret-derived process-salted identities, not plaintext keys in registry state. It handles credential order changes and bounded retries/lease reservations.
Submission Checklist
key_pool_tests.rscases plus 11credential_fleet_tests.rscases, committed before the adapter implementation.Impact
Related
AI Authored PR Metadata (required for Codex/Linear PRs)
Linear Issue
N/A — fork-to-upstream contribution, no Linear issue supplied.
Commit & Branch
AmirrezaFarnamTaheri/openhuman:main(upstream-derived isolated port), original pool sources at fork5253566816d6.AmirrezaFarnamTaheri:upstream/feat-api-key-rotation-wave1-20261028main3e0c980be877at branch creation.Validation Run
pnpm --filter openhuman-app format:check(Rust fmt included)Validation Blocked
No repository toolchain checkout is available in this execution environment. GitHub Actions validation after opening this draft is required; the test-first commit has not been independently executed to establish RED/GREEN in this environment.
Behavior Changes
Single-user multi-key BYOK routing now uses the adapter, backed by test-first HTTP 429 failover coverage. No UI/RPC is exposed. The new paths still require full hosted CI and cross-provider smoke before review-ready status.
Parity Contract
Preserve managed-provider budgets, standard single-key BYOK, provider/workspace isolation, Codex OAuth routing, encrypted credential storage, and no secret echo. Streaming output must never be retried after any chunk is delivered.
Duplicate / Superseded PR Handling
Canonical Wave-1 rotator implementation draft. Does not duplicate #8468 or #8461. If the underlying key selection belongs in a vendor library, transfer that implementation with tests to its owner and retain only the host adapter here.
Wave 1 CI gate findings (2026-10-28)
cloud_slug.rsover its 750-line Rust layout cap (759 lines). All other architecture/ownership scans within that job passed, including ambient context, module boundaries, process statics, and storage-bypass.6e53c97..b941b1frelocates the existing credential rotation-scope helper into the dedicated nativecloud_fleetadapter and applies the CI-reported Rustfmt transformations without changing the credential pool algorithm, policies, or test expectations.cloud_slug.rsis 746 lines after extraction; the 750-line cap was not raised.b941b1f46363c2b496740eed26518fb5350a1afd. The rotation branch remains draft and the account/profile isolation and deferred-handle linking risks below remain open: neither is waived by green formatting or coverage.Pending Acceptance
Wave 1 implementation update (2026-10-28)
credential_fleet_tests.rsfirst, thencredential_fleet.rs, then enabled its compilation underfactory.rswithout altering live inference routes.POOLS/SALTownership records; changing the CI rule is intentionally avoided.Wave 1 native runtime integration (2026-10-28)
CredentialFleetModelwhen multiple keys are configured. The default strategy is round-robin;CredentialFleetModelenforces a maximum of four attempts and does not replay a stream after output.factory_credential_fleet_tests.rsHTTP integration test exercises first-key 429 and second-key success.cloud_http.rs, ensuring authenticated requests cannot forward custom API-key headers through redirects. Regression tests cover redirect prevention, optional private CAs, and compatibility with unauthenticated routes.Security and routing acceptance (required before review-ready)