@@ -51,6 +51,7 @@ pub async fn add_env_message<'a>(
51
51
memory_index : Arc <
52
52
tokio:: sync:: RwLock < InMemoryVectorIndex < rig_fastembed:: EmbeddingModel , memory:: Entity > > ,
53
53
> ,
54
+ data_dir : & ' a Path ,
54
55
workspace : & ' a Path ,
55
56
process_registry : Arc < RwLock < ProcessRegistry > > ,
56
57
) {
@@ -116,19 +117,19 @@ pub async fn add_env_message<'a>(
116
117
)
117
118
} )
118
119
. join ( "\n " ) ;
119
- content . push ( UserContent :: text (
120
- subst :: substitute (
121
- ENV_DETAILS ,
122
- & HashMap :: from ( [
123
- ( "TIME ", chrono :: Local :: now ( ) . to_rfc2822 ( ) . as_str ( ) ) ,
124
- ( "WORKING_DIR ", & workspace ) ,
125
- ( "MEMORY_ENTRIES ", & memory_entries ) ,
126
- ( "COMMANDS ", & commands ) ,
127
- ( "FILES" , files ) ,
128
- ] ) ,
129
- )
130
- . unwrap ( ) ,
131
- ) ) ;
120
+ let env_content = subst :: substitute (
121
+ ENV_DETAILS ,
122
+ & HashMap :: from ( [
123
+ ( "TIME" , chrono :: Local :: now ( ) . to_rfc2822 ( ) . as_str ( ) ) ,
124
+ ( "WORKING_DIR ", & workspace ) ,
125
+ ( "MEMORY_ENTRIES ", & memory_entries ) ,
126
+ ( "COMMANDS ", & commands ) ,
127
+ ( "FILES ", files ) ,
128
+ ] ) ,
129
+ )
130
+ . unwrap ( ) ;
131
+ fs :: write ( data_dir . join ( "env.txt" ) , & env_content ) . unwrap ( ) ;
132
+ content . push ( UserContent :: text ( env_content ) ) ;
132
133
}
133
134
}
134
135
0 commit comments