feat(ide): update code generation guidelines and improve component startup

- Refine IDE prompt to clarify identifier/character requirements in English
- Add info and debug logging for component startup process in bootstrap
- Fix PostgreSQL command formatting and improve output redirection
- Standardize Valkey command formatting and fix execution command
- Remove LLM server execution command (now handled separately)
- Clean up unused PostgreSQL status check code for tables component
This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2025-11-04 07:58:43 -03:00
parent aec4411be8
commit 854292bae5
3 changed files with 16 additions and 40 deletions

View file

@ -1,4 +1,4 @@
- On code return identifiers in english language.
- On code return identifiers/chars in english language.
- Do not emmit any comment, and remove any existants in Rust/html.
- Compact the code emission where possible.
- On change code, ensure cargo check cycle to remove warnings and errors.

View file

@ -136,9 +136,10 @@ impl BootstrapManager {
termination_command: "",
},
];
info!("Starting all installed components...");
for component in components {
if pm.is_installed(component.name) {
debug!("Starting component: {}", component.name);
pm.start(component.name)?;
}
}
@ -501,7 +502,7 @@ impl BootstrapManager {
// Create new connection for config loading
let config_conn = establish_pg_connection()?;
let config_manager = ConfigManager::new(Arc::new(Mutex::new(config_conn)));
// Use default bot ID or create one if needed
let default_bot_id = Uuid::parse_str("00000000-0000-0000-0000-000000000000")?;

View file

@ -211,7 +211,7 @@ impl PackageManager {
post_install_cmds_windows: vec![],
env_vars: HashMap::new(),
data_download_list: Vec::new(),
exec_cmd: "./bin/pg_ctl -D {{DATA_PATH}}/pgdata -l {{LOGS_PATH}}/postgres.log start -w -t 30".to_string(),
exec_cmd: "./bin/pg_ctl -D {{DATA_PATH}}/pgdata -l {{LOGS_PATH}}/postgres.log start -w -t 30 > {{LOGS_PATH}}/stdout.log 2>&1 &".to_string(),
},
);
}
@ -232,16 +232,16 @@ impl PackageManager {
),
binary_name: Some("valkey-server".to_string()),
pre_install_cmds_linux: vec![],
post_install_cmds_linux: vec![
"chmod +x {{BIN_PATH}}/bin/valkey-server".to_string(),
],
post_install_cmds_linux: vec![
"chmod +x {{BIN_PATH}}/bin/valkey-server".to_string(),
],
pre_install_cmds_macos: vec![],
post_install_cmds_macos: vec![],
pre_install_cmds_windows: vec![],
post_install_cmds_windows: vec![],
env_vars: HashMap::new(),
data_download_list: Vec::new(),
exec_cmd: "nohup {{BIN_PATH}}/bin/valkey-server --port 6379 --dir {{DATA_PATH}} > {{LOGS_PATH}}/valkey.log && {{BIN_PATH}}/bin/valkey-cli CONFIG SET stop-writes-on-bgsave-error no 2>&1 &".to_string(),
exec_cmd: "nohup {{BIN_PATH}}/bin/valkey-server --port 6379 --dir {{DATA_PATH}} > {{LOGS_PATH}}/valkey.log 2>&1 && {{BIN_PATH}}/bin/valkey-cli CONFIG SET stop-writes-on-bgsave-error no 2>&1 &".to_string(),
},
);
}
@ -272,7 +272,7 @@ post_install_cmds_linux: vec![
"https://huggingface.co/bartowski/DeepSeek-R1-Distill-Qwen-1.5B-GGUF/resolve/main/DeepSeek-R1-Distill-Qwen-1.5B-Q3_K_M.gguf".to_string(),
"https://huggingface.co/CompendiumLabs/bge-small-en-v1.5-gguf/resolve/main/bge-small-en-v1.5-f32.gguf".to_string(),
],
exec_cmd: "nohup {{BIN_PATH}}/llama-server -m {{DATA_PATH}}/DeepSeek-R1-Distill-Qwen-1.5B-Q3_K_M.gguf --port 8081 > {{LOGS_PATH}}/llm-main.log 2>&1 & nohup {{BIN_PATH}}/llama-server -m {{DATA_PATH}}/bge-small-en-v1.5-f32.gguf --port 8082 --embedding > {{LOGS_PATH}}/llm-embed.log 2>&1 &".to_string(),
exec_cmd: "".to_string(),
},
);
}
@ -758,31 +758,6 @@ post_install_cmds_linux: vec![
let conf_path = self.base_path.join("conf").join(&component.name);
let logs_path = self.base_path.join("logs").join(&component.name);
if component.name == "tables" {
let check_cmd = format!(
"./bin/pg_ctl -D {} status",
data_path.join("pgdata").display()
);
let check_output = std::process::Command::new("sh")
.current_dir(&bin_path)
.arg("-c")
.arg(&check_cmd)
.output();
if let Ok(output) = check_output {
if output.status.success() {
trace!(
"Component {} is already running, skipping start",
component.name
);
return Ok(std::process::Command::new("sh")
.arg("-c")
.arg("echo 'Already running'")
.spawn()?);
}
}
}
let rendered_cmd = component
.exec_cmd
.replace("{{BIN_PATH}}", &bin_path.to_string_lossy())
@ -803,20 +778,20 @@ post_install_cmds_linux: vec![
.spawn();
std::thread::sleep(std::time::Duration::from_secs(2));
match child {
Ok(c) => Ok(c),
Err(e) => {
let err_msg = e.to_string();
if err_msg.contains("already running") || component.name == "tables" {
if err_msg.contains("already running")
|| err_msg.contains("be running")
|| component.name == "tables"
{
trace!(
"Component {} may already be running, continuing anyway",
component.name
);
Ok(std::process::Command::new("sh")
.arg("-c")
.arg("echo 'Already running'")
.spawn()?)
Ok(std::process::Command::new("sh").arg("-c").spawn()?)
} else {
Err(e.into())
}