From 3b3bd04fad3ad518520f20fc71887fb9539ff189 Mon Sep 17 00:00:00 2001 From: Joe Date: Tue, 3 Mar 2026 08:08:47 -0600 Subject: [PATCH] Enhance initialization and API handling - Updated the `InitCommand` to conditionally add and commit all changes after initializing a git repository, improving project setup efficiency. - Modified the API service to include requested IDs in the instance retrieval process, ensuring accurate instance management. These changes aim to streamline the initialization process and enhance the API's functionality for better user experience. --- TODO.txt | 4 ++++ src/cli/init.rs | 8 +++++--- src/web/api.rs | 6 ++++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/TODO.txt b/TODO.txt index 896c6f94..62175f99 100644 --- a/TODO.txt +++ b/TODO.txt @@ -98,3 +98,7 @@ this should utilize the mcp to run the game and fetch the errors, make sure the modify /atlas-push to always trigger /playtest-quick after it finishes pushing, looping back around to fix issues if needed. make sure the errors are related to what we actually pushed, so it doesnt try to fix others work. if it's others work, ask the user if they want to fix it - thought recommend they should do a planning phase. "/atlas-push no test" or similar it just skips the automated test + +git config --system core.longpaths true + +make clone support multi-placeids like we did with defend-67 \ No newline at end of file diff --git a/src/cli/init.rs b/src/cli/init.rs index 49e74bd2..93df4396 100644 --- a/src/cli/init.rs +++ b/src/cli/init.rs @@ -127,6 +127,10 @@ impl InitCommand { !self.skip_git }; + if did_git_init { + crate::git::git_add_all_and_commit(&base_path, "Initial commit"); + } + if !self.skip_rules && did_git_init { log::debug!("Adding agent submodules..."); @@ -189,10 +193,8 @@ impl InitCommand { if !any_failed { println!("Added agent submodules successfully."); } - } - if did_git_init { - crate::git::git_add_all_and_commit(&base_path, "Initial commit"); + crate::git::git_add_all_and_commit(&base_path, "Add agent submodules"); } println!("Created project successfully."); diff --git a/src/web/api.rs b/src/web/api.rs index 998adbfe..ec5568f1 100644 --- a/src/web/api.rs +++ b/src/web/api.rs @@ -3411,6 +3411,12 @@ impl ApiService { } } + for &id in &requested_ids { + if tree.get_instance(id).is_some() { + included_ids.insert(id); + } + } + for &id in &included_ids { if let Some(instance) = tree.get_instance(id) { instances.insert(id, instance_for_scripts_only(instance, &included_ids));