File tree Expand file tree Collapse file tree
crates/openshell-sandbox/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -208,7 +208,8 @@ pub async fn run_sandbox(
208208 }
209209 } ;
210210
211- let has_anthropic = provider_result. has_provider_type ( "anthropic" ) ;
211+ let has_anthropic = provider_result. has_provider_type ( "anthropic" )
212+ || provider_result. has_provider_type ( "claude" ) ;
212213 let ( provider_env, secret_resolver) =
213214 SecretResolver :: from_provider_env ( provider_result. flatten ( ) ) ;
214215 let secret_resolver = secret_resolver. map ( Arc :: new) ;
@@ -1221,9 +1222,19 @@ fn write_provider_configs(has_anthropic: bool, policy: &SandboxPolicy) -> Result
12211222
12221223 let claude_json_path = std:: path:: Path :: new ( & home) . join ( ".claude.json" ) ;
12231224
1224- let config = serde_json:: json!( {
1225- "hasCompletedOnboarding" : true
1226- } ) ;
1225+ // Merge into existing .claude.json if present, so we don't clobber
1226+ // user-supplied or BYOC-baked configuration.
1227+ let mut config: serde_json:: Value = if claude_json_path. exists ( ) {
1228+ let existing = std:: fs:: read_to_string ( & claude_json_path) . into_diagnostic ( ) ?;
1229+ serde_json:: from_str ( & existing) . unwrap_or_else ( |_| serde_json:: json!( { } ) )
1230+ } else {
1231+ serde_json:: json!( { } )
1232+ } ;
1233+
1234+ if let Some ( obj) = config. as_object_mut ( ) {
1235+ obj. entry ( "hasCompletedOnboarding" )
1236+ . or_insert ( serde_json:: Value :: Bool ( true ) ) ;
1237+ }
12271238
12281239 if let Some ( parent) = claude_json_path. parent ( ) {
12291240 std:: fs:: create_dir_all ( parent) . into_diagnostic ( ) ?;
You can’t perform that action at this time.
0 commit comments