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:
@@ -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}");
|
||||
|
||||
Reference in New Issue
Block a user