@@ -22,22 +22,14 @@ use tracing::instrument::WithSubscriber as _;
2222use crate :: domain:: error:: { HarnessError , Result } ;
2323use crate :: domain:: model:: {
2424 AgentKind , AnnounceOrigin , AnnouncePrompt , DeliverAction , HarnessCommand , HarnessDefaults ,
25- OpenSession , SessionAnnouncement , SpawnContainer , is_macro_staff ,
25+ OpenSession , SessionAnnouncement , SpawnContainer ,
2626} ;
2727use crate :: domain:: ports:: {
2828 AgentPromptComposer , ChannelPromptContext , ContainerManager , RuntimeConnections ,
2929 SandboxEgressProvisioner , SessionAnnouncer ,
3030} ;
3131use crate :: domain:: sandbox:: SandboxResizeEffect ;
3232
33- fn apply_agent_instructions ( system_prompt : & str , prompt : String ) -> String {
34- let instructions = system_prompt. trim ( ) ;
35- if instructions. is_empty ( ) {
36- return prompt;
37- }
38- format ! ( "<agent_instructions>\n {instructions}\n </agent_instructions>\n \n {prompt}" )
39- }
40-
4133type SessionWorkers = DashMap < AgentSessionId , mpsc:: UnboundedSender < QueuedCommand > > ;
4234
4335struct QueuedCommand {
@@ -550,26 +542,6 @@ where
550542 Egress : SandboxEgressProvisioner ,
551543{
552544 async fn execute ( & self , session_id : AgentSessionId , command : HarnessCommand ) -> Result < ( ) > {
553- match & command {
554- HarnessCommand :: Open ( open)
555- if open. runtime . kind == AgentKind :: Cursor
556- && !is_macro_staff ( & open. origin . sender ) =>
557- {
558- return Err ( AgentSessionError :: Forbidden . into ( ) ) ;
559- }
560- HarnessCommand :: Deliver ( deliver) => {
561- let session = self . sessions . get_session ( session_id) . await ?;
562- if AgentKind :: for_session ( session. bot_id , & session. harness ) == AgentKind :: Cursor
563- && !deliver. actor . as_ref ( ) . is_some_and ( is_macro_staff)
564- {
565- return Err ( AgentSessionError :: Forbidden . into ( ) ) ;
566- }
567- }
568- HarnessCommand :: Open ( _)
569- | HarnessCommand :: SetSandboxSize ( _)
570- | HarnessCommand :: Delete => { }
571- }
572-
573545 match command {
574546 HarnessCommand :: Open ( command) => self . open ( session_id, command) . await ,
575547 HarnessCommand :: Deliver ( command) => self . deliver ( session_id, command) . await ,
@@ -682,12 +654,10 @@ where
682654 let prior_messages = self
683655 . load_prompt_context ( origin. channel_id , origin. message_id , Some ( & origin. sender ) )
684656 . await ;
685- let composed_prompt = apply_agent_instructions (
686- & runtime. system_prompt ,
687- self . prompt_composer
688- . compose ( & origin. content , Some ( & prior_messages) )
689- . await ?,
690- ) ;
657+ let composed_prompt = self
658+ . prompt_composer
659+ . compose ( & origin. content , Some ( & prior_messages) )
660+ . await ?;
691661
692662 // Provisioned before the session exists, because the row is what makes
693663 // the token mean anything: it carries the hash the proxy recognises.
0 commit comments