@@ -30,7 +30,7 @@ use openshell_core::proto::{
3030 RevokeSshSessionRequest , RevokeSshSessionResponse , SandboxLogLine , SandboxPolicyRevision ,
3131 SandboxResponse , SandboxStreamEvent , ServiceStatus , SettingScope , SettingValue , SshSession ,
3232 SubmitPolicyAnalysisRequest , SubmitPolicyAnalysisResponse , UndoDraftChunkRequest ,
33- UndoDraftChunkResponse , UpdateProviderRequest , UpdateSettingsRequest , UpdateSettingsResponse ,
33+ UndoDraftChunkResponse , UpdateConfigRequest , UpdateConfigResponse , UpdateProviderRequest ,
3434 WatchSandboxRequest , open_shell_server:: OpenShell ,
3535} ;
3636use openshell_core:: proto:: {
@@ -1086,10 +1086,10 @@ impl OpenShell for OpenShellService {
10861086 // Policy update handlers
10871087 // -------------------------------------------------------------------
10881088
1089- async fn update_settings (
1089+ async fn update_config (
10901090 & self ,
1091- request : Request < UpdateSettingsRequest > ,
1092- ) -> Result < Response < UpdateSettingsResponse > , Status > {
1091+ request : Request < UpdateConfigRequest > ,
1092+ ) -> Result < Response < UpdateConfigResponse > , Status > {
10931093 let req = request. into_inner ( ) ;
10941094 let key = req. setting_key . trim ( ) ;
10951095 let has_policy = req. policy . is_some ( ) ;
@@ -1158,7 +1158,7 @@ impl OpenShell for OpenShellService {
11581158 save_global_settings ( self . state . store . as_ref ( ) , & global_settings)
11591159 . await ?;
11601160 }
1161- return Ok ( Response :: new ( UpdateSettingsResponse {
1161+ return Ok ( Response :: new ( UpdateConfigResponse {
11621162 version : u32:: try_from ( current. version ) . unwrap_or ( 0 ) ,
11631163 policy_hash : hash,
11641164 settings_revision : global_settings. revision ,
@@ -1221,7 +1221,7 @@ impl OpenShell for OpenShellService {
12211221 save_global_settings ( self . state . store . as_ref ( ) , & global_settings) . await ?;
12221222 }
12231223
1224- return Ok ( Response :: new ( UpdateSettingsResponse {
1224+ return Ok ( Response :: new ( UpdateConfigResponse {
12251225 version : u32:: try_from ( next_version) . unwrap_or ( 0 ) ,
12261226 policy_hash : hash,
12271227 settings_revision : global_settings. revision ,
@@ -1273,7 +1273,7 @@ impl OpenShell for OpenShellService {
12731273 save_global_settings ( self . state . store . as_ref ( ) , & global_settings) . await ?;
12741274 }
12751275
1276- return Ok ( Response :: new ( UpdateSettingsResponse {
1276+ return Ok ( Response :: new ( UpdateConfigResponse {
12771277 version : 0 ,
12781278 policy_hash : String :: new ( ) ,
12791279 settings_revision : global_settings. revision ,
@@ -1334,7 +1334,7 @@ impl OpenShell for OpenShellService {
13341334 . await ?;
13351335 }
13361336
1337- return Ok ( Response :: new ( UpdateSettingsResponse {
1337+ return Ok ( Response :: new ( UpdateConfigResponse {
13381338 version : 0 ,
13391339 policy_hash : String :: new ( ) ,
13401340 settings_revision : sandbox_settings. revision ,
@@ -1368,7 +1368,7 @@ impl OpenShell for OpenShellService {
13681368 . await ?;
13691369 }
13701370
1371- return Ok ( Response :: new ( UpdateSettingsResponse {
1371+ return Ok ( Response :: new ( UpdateConfigResponse {
13721372 version : 0 ,
13731373 policy_hash : String :: new ( ) ,
13741374 settings_revision : sandbox_settings. revision ,
@@ -1424,7 +1424,7 @@ impl OpenShell for OpenShellService {
14241424 . map_err ( |e| Status :: internal ( format ! ( "backfill spec.policy failed: {e}" ) ) ) ?;
14251425 info ! (
14261426 sandbox_id = %sandbox_id,
1427- "UpdateSettings : backfilled spec.policy from sandbox-discovered policy"
1427+ "UpdateConfig : backfilled spec.policy from sandbox-discovered policy"
14281428 ) ;
14291429 }
14301430
@@ -1443,7 +1443,7 @@ impl OpenShell for OpenShellService {
14431443 if let Some ( ref current) = latest
14441444 && current. policy_hash == hash
14451445 {
1446- return Ok ( Response :: new ( UpdateSettingsResponse {
1446+ return Ok ( Response :: new ( UpdateConfigResponse {
14471447 version : u32:: try_from ( current. version ) . unwrap_or ( 0 ) ,
14481448 policy_hash : hash,
14491449 settings_revision : 0 ,
@@ -1474,10 +1474,10 @@ impl OpenShell for OpenShellService {
14741474 sandbox_id = %sandbox_id,
14751475 version = next_version,
14761476 policy_hash = %hash,
1477- "UpdateSettings : new policy version persisted"
1477+ "UpdateConfig : new policy version persisted"
14781478 ) ;
14791479
1480- Ok ( Response :: new ( UpdateSettingsResponse {
1480+ Ok ( Response :: new ( UpdateConfigResponse {
14811481 version : u32:: try_from ( next_version) . unwrap_or ( 0 ) ,
14821482 policy_hash : hash,
14831483 settings_revision : 0 ,
@@ -2474,7 +2474,7 @@ fn draft_chunk_record_to_proto(record: &DraftChunkRecord) -> Result<PolicyChunk,
24742474/// Merge a draft chunk's proposed rule into the current active sandbox policy.
24752475///
24762476/// Returns `(new_version, policy_hash)`. This reuses the same persistence
2477- /// pattern as `update_settings `: compute hash, check for no-op,
2477+ /// pattern as `update_config `: compute hash, check for no-op,
24782478/// persist a new revision, supersede older versions, and notify watchers.
24792479/// Maximum number of optimistic retry attempts for policy version conflicts.
24802480const MERGE_RETRY_LIMIT : usize = 5 ;
@@ -4908,7 +4908,7 @@ mod tests {
49084908 } ;
49094909 store. put_message ( & sandbox) . await . unwrap ( ) ;
49104910
4911- // Simulate what update_settings does when spec.policy is None:
4911+ // Simulate what update_config does when spec.policy is None:
49124912 // backfill spec.policy with the new policy.
49134913 let new_policy = ProtoSandboxPolicy {
49144914 version : 1 ,
0 commit comments