@@ -422,14 +422,9 @@ pub struct CliArgs {
422422 #[ arg( long, env = "BUZZ_ACP_ALLOWED_RESPOND_TO" , value_delimiter = ',' ) ]
423423 pub allowed_respond_to : Option < Vec < String > > ,
424424
425- /// Path to a persona pack directory. Used with --persona-name to configure
426- /// the agent from a .persona.md pack instead of CLI flags.
427- #[ arg( long, env = "BUZZ_ACP_PERSONA_PACK" ) ]
428- pub persona_pack : Option < PathBuf > ,
429-
430- /// Name of the persona within the pack to use. Required when --persona-pack is set.
431- #[ arg( long, env = "BUZZ_ACP_PERSONA_NAME" ) ]
432- pub persona_name : Option < String > ,
425+ /// Team-owned instructions layered after `[System]` and before agent memory.
426+ #[ arg( long, env = "BUZZ_ACP_TEAM_INSTRUCTIONS" ) ]
427+ pub team_instructions : Option < String > ,
433428
434429 /// Publish encrypted ACP observer frames over the relay.
435430 #[ arg( long, env = "BUZZ_ACP_RELAY_OBSERVER" , default_value_t = false ) ]
@@ -462,6 +457,8 @@ pub struct Config {
462457 pub turn_liveness_secs : u64 ,
463458 pub heartbeat_prompt : Option < String > ,
464459 pub system_prompt : Option < String > ,
460+ /// Team-owned instructions layered separately from the agent system prompt.
461+ pub team_instructions : Option < String > ,
465462 pub initial_message : Option < String > ,
466463 pub subscribe_mode : SubscribeMode ,
467464 pub dedup_mode : DedupMode ,
@@ -705,7 +702,7 @@ impl Config {
705702 . replace_range ( .., & "0" . repeat ( args. private_key . len ( ) ) ) ;
706703 args. private_key . clear ( ) ;
707704
708- let mut system_prompt = if let Some ( text) = args. system_prompt {
705+ let system_prompt = if let Some ( text) = args. system_prompt {
709706 Some ( text)
710707 } else if let Some ( ref path) = args. system_prompt_file {
711708 Some ( std:: fs:: read_to_string ( path) ?)
@@ -902,52 +899,10 @@ impl Config {
902899 Vec :: new ( )
903900 } ;
904901
905- //
906- // Precedence: CLI/env args > persona values > built-in defaults.
907- // Persona fills in what's missing. Explicit flags always win.
908- let ( persona_system_prompt, persona_model, mut persona_env_vars) =
909- match ( & args. persona_pack , & args. persona_name ) {
910- ( Some ( pack_dir) , Some ( name) ) => {
911- let pack = buzz_persona:: resolve:: resolve_pack ( pack_dir) . map_err ( |e| {
912- ConfigError :: ConfigFile ( format ! (
913- "failed to resolve pack {}: {e}" ,
914- pack_dir. display( )
915- ) )
916- } ) ?;
917- let persona = pack
918- . personas
919- . into_iter ( )
920- . find ( |p| p. name == * name)
921- . ok_or_else ( || {
922- ConfigError :: ConfigFile ( format ! (
923- "persona '{name}' not found in pack {}" ,
924- pack_dir. display( )
925- ) )
926- } ) ?;
927- (
928- Some ( persona. system_prompt ) ,
929- persona. model ,
930- persona. runtime_env_vars ,
931- )
932- }
933- ( Some ( _) , None ) => {
934- return Err ( ConfigError :: ConfigFile (
935- "--persona-pack requires --persona-name" . into ( ) ,
936- ) ) ;
937- }
938- ( None , Some ( _) ) => {
939- return Err ( ConfigError :: ConfigFile (
940- "--persona-name requires --persona-pack" . into ( ) ,
941- ) ) ;
942- }
943- ( None , None ) => ( None , None , vec ! [ ] ) ,
944- } ;
945-
946- // Apply persona defaults: CLI/env wins, persona fills gaps.
947- if system_prompt. is_none ( ) {
948- system_prompt = persona_system_prompt;
949- }
950- let model = args. model . or ( persona_model) ;
902+ // Spawned desktop agents now carry a complete instance snapshot. Team
903+ // instructions arrive independently so they can be layered at runtime.
904+ let mut persona_env_vars = Vec :: new ( ) ;
905+ let model = args. model ;
951906
952907 // Inject CODEX_CONFIG so the @agentclientprotocol/codex-acp adapter (1.x)
953908 // opens the Seatbelt network sandbox for buzz-cli (an MCP subprocess). No-op
@@ -975,6 +930,12 @@ impl Config {
975930 turn_liveness_secs,
976931 heartbeat_prompt,
977932 system_prompt,
933+ team_instructions : args
934+ . team_instructions
935+ . as_deref ( )
936+ . map ( str:: trim)
937+ . filter ( |value| !value. is_empty ( ) )
938+ . map ( str:: to_string) ,
978939 initial_message : args. initial_message ,
979940 subscribe_mode : args. subscribe ,
980941 dedup_mode : args. dedup ,
@@ -1346,6 +1307,7 @@ mod tests {
13461307 turn_liveness_secs : 10 ,
13471308 heartbeat_prompt : None ,
13481309 system_prompt : None ,
1310+ team_instructions : None ,
13491311 initial_message : None ,
13501312 subscribe_mode : mode,
13511313 dedup_mode : DedupMode :: Queue ,
0 commit comments