File tree Expand file tree Collapse file tree 3 files changed +11
-13
lines changed
Expand file tree Collapse file tree 3 files changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -52,10 +52,9 @@ pub fn create_cowork_pipeline(config: &ModelConfig) -> Result<Arc<dyn Agent>> {
5252/// This function intelligently determines which stage to resume from
5353/// by checking what data files already exist.
5454pub fn create_resume_pipeline ( config : & ModelConfig ) -> Result < Arc < dyn Agent > > {
55- use crate :: storage:: * ;
5655 use std:: path:: Path ;
5756
58- let llm = create_llm_client ( & config. llm ) ?;
57+ let _llm = create_llm_client ( & config. llm ) ?;
5958
6059 // Determine which stage to start from based on existing data
6160 let start_stage = if Path :: new ( ".cowork/artifacts/delivery_report.md" ) . exists ( ) {
Original file line number Diff line number Diff line change @@ -12,16 +12,16 @@ const COWORK_DIR: &str = ".cowork";
1212/// Get the .cowork directory path, create if not exists
1313pub fn get_cowork_dir ( ) -> Result < PathBuf > {
1414 let path = PathBuf :: from ( COWORK_DIR ) ;
15- if !path . exists ( ) {
16- fs :: create_dir_all ( & path )
17- . with_context ( || format ! ( "Failed to create .cowork directory at {:?}" , path ) ) ? ;
18-
19- // Create subdirectories
20- fs:: create_dir_all ( path. join ( "data" ) ) ?;
21- fs:: create_dir_all ( path. join ( "artifacts" ) ) ?;
22- fs:: create_dir_all ( path. join ( "session" ) ) ?;
23- fs:: create_dir_all ( path. join ( "logs" ) ) ?;
24- }
15+
16+ // Create main directory and subdirectories (create_dir_all is idempotent and safe for concurrent calls )
17+ // We don't need to check if it exists first - create_dir_all handles that
18+ fs :: create_dir_all ( & path )
19+ . with_context ( || format ! ( "Failed to create .cowork directory at {:?}" , path ) ) ? ;
20+ fs:: create_dir_all ( path. join ( "data" ) ) ?;
21+ fs:: create_dir_all ( path. join ( "artifacts" ) ) ?;
22+ fs:: create_dir_all ( path. join ( "session" ) ) ?;
23+ fs:: create_dir_all ( path. join ( "logs" ) ) ?;
24+
2525 Ok ( path)
2626}
2727
Original file line number Diff line number Diff line change 11#[ cfg( test) ]
22mod tests {
33 use crate :: storage:: * ;
4- use crate :: data:: * ;
54 use tempfile:: TempDir ;
65 use std:: env;
76
You can’t perform that action at this time.
0 commit comments