Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(config): add context-aware cloud provider registration

Steven Enamakel5c359acb6d93
diff --git a/crates/openhuman-core/src/config/schema/cloud_providers.rs b/crates/openhuman-core/src/config/schema/cloud_providers.rs
index b184b2df84..b15fd9403c 100644
--- a/crates/openhuman-core/src/config/schema/cloud_providers.rs
+++ b/crates/openhuman-core/src/config/schema/cloud_providers.rs
@@ -38,12 +38,29 @@ pub fn register_hosted_cloud_preset(id: impl Into<String>, preset: BuiltinCloudP
HOSTED_PRESETS.register(id, preset);
}
+/// Register a host preset for one runtime context.
+pub fn register_hosted_cloud_preset_in(
+ extensions: &crate::core::slots::Extensions,
+ id: impl Into<String>,
+ preset: BuiltinCloudProvider,
+) {
+ HOSTED_PRESETS.register_in(extensions, id, preset);
+}
+
/// Register host-owned auth-style classification without making it core
/// inference policy.
pub fn register_hosted_cloud_provider_policy(classifier: HostedCloudProviderClassifier) {
HOSTED_CLOUD_PROVIDER.register("default", classifier);
}
+/// Register hosted-provider classification for one runtime context.
+pub fn register_hosted_cloud_provider_policy_in(
+ extensions: &crate::core::slots::Extensions,
+ classifier: HostedCloudProviderClassifier,
+) {
+ HOSTED_CLOUD_PROVIDER.register_in(extensions, "default", classifier);
+}
+
/// Whether the installed host treats this compatibility auth style as hosted.
pub fn is_hosted_cloud_provider(slug: &str, style: AuthStyle) -> bool {
HOSTED_CLOUD_PROVIDER