huskies: merge 1190 bug Startup version announcement only fires on the trampoline path — normal restarts still say just "Timmy is online."

This commit is contained in:
Huskies Agent
2026-07-17 17:42:23 +00:00
parent c91ebb810c
commit ba1617934a
2 changed files with 70 additions and 12 deletions
+8 -2
View File
@@ -400,9 +400,11 @@ pub async fn run_bot(
// reconnects internally so this code is never reached again on a network
// blip or sync resumption.
//
// When started by the trampoline the message is specialised:
// A normal start and a trampoline-triggered restart both announce version,
// git hash, and configured model; the trampoline path is specialised further:
// - HUSKIES_TRAMPOLINE_STARTED=1 → "gateway X.Y.Z (git_hash) ready — model: ..."
// - HUSKIES_TRAMPOLINE_FAILURE=<reason> → rollback failure notice
// - otherwise (normal start) → "{bot_name} is online — gateway X.Y.Z (git_hash) — model: ..."
let announce_msg = if let Ok(reason) = std::env::var("HUSKIES_TRAMPOLINE_FAILURE") {
super::format::format_gateway_rollback_announcement(&reason)
} else if std::env::var("HUSKIES_TRAMPOLINE_STARTED").is_ok() {
@@ -411,7 +413,11 @@ pub async fn run_bot(
config.model.as_deref(),
)
} else {
format_startup_announcement(&announce_bot_name)
format_startup_announcement(
&announce_bot_name,
option_env!("BUILD_GIT_HASH").unwrap_or("unknown"),
config.model.as_deref(),
)
};
let announce_html = markdown_to_html(&announce_msg);
slog!("[matrix-bot] Sending startup announcement: {announce_msg}");