Adding show story mcp
This commit is contained in:
@@ -109,6 +109,9 @@ pub struct BotContext {
|
||||
/// configured room. Updated atomically on every `on_room_message` call so
|
||||
/// the `health` command can detect a stale or dead sync loop.
|
||||
pub last_matrix_event_ms: Arc<AtomicI64>,
|
||||
/// Optional model override from bot.toml. Passed as `--model` to the
|
||||
/// `claude` CLI when set.
|
||||
pub model: Option<String>,
|
||||
}
|
||||
|
||||
impl BotContext {
|
||||
@@ -305,6 +308,7 @@ mod tests {
|
||||
))),
|
||||
gateway_port: None,
|
||||
last_matrix_event_ms: Arc::new(AtomicI64::new(chrono::Utc::now().timestamp_millis())),
|
||||
model: None,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -101,6 +101,7 @@ pub(in crate::chat::transport::matrix::bot) async fn handle_message(
|
||||
&project_root_str,
|
||||
resume_session_id.as_deref(),
|
||||
None,
|
||||
ctx.model.as_deref(),
|
||||
&mut cancel_rx,
|
||||
move |token| {
|
||||
let mut buf = buffer_for_callback.lock().unwrap();
|
||||
|
||||
@@ -337,6 +337,7 @@ pub async fn run_bot(
|
||||
))),
|
||||
gateway_port,
|
||||
last_matrix_event_ms: Arc::new(AtomicI64::new(chrono::Utc::now().timestamp_millis())),
|
||||
model: config.model.clone(),
|
||||
};
|
||||
|
||||
slog!(
|
||||
|
||||
@@ -71,10 +71,10 @@ pub struct BotConfig {
|
||||
/// (fail-closed). Defaults to 120 seconds.
|
||||
#[serde(default = "default_permission_timeout_secs")]
|
||||
pub permission_timeout_secs: u64,
|
||||
/// Previously used to select an Anthropic model. Now ignored — the bot
|
||||
/// uses Claude Code which manages its own model selection. Kept for
|
||||
/// backwards compatibility so existing bot.toml files still parse.
|
||||
#[allow(dead_code)]
|
||||
/// Claude Code model override. When set, passed as `--model <value>` to
|
||||
/// the `claude` CLI so the bot uses a specific model instead of the CLI's
|
||||
/// configured default.
|
||||
#[serde(default)]
|
||||
pub model: Option<String>,
|
||||
/// Display name the bot uses to identify itself in conversations.
|
||||
/// If unset, the bot falls back to "Assistant".
|
||||
|
||||
@@ -694,6 +694,7 @@ mod tests {
|
||||
)),
|
||||
gateway_port: None,
|
||||
last_matrix_event_ms: Arc::new(AtomicI64::new(chrono::Utc::now().timestamp_millis())),
|
||||
model: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,6 +97,7 @@ mod tests {
|
||||
)),
|
||||
gateway_port: None,
|
||||
last_matrix_event_ms: Arc::new(AtomicI64::new(chrono::Utc::now().timestamp_millis())),
|
||||
model: None,
|
||||
};
|
||||
run_projects_list(&ctx).await
|
||||
}
|
||||
@@ -211,6 +212,7 @@ mod tests {
|
||||
)),
|
||||
gateway_port: None,
|
||||
last_matrix_event_ms: Arc::new(AtomicI64::new(chrono::Utc::now().timestamp_millis())),
|
||||
model: None,
|
||||
};
|
||||
let response = run_projects_list(&ctx).await;
|
||||
assert!(
|
||||
|
||||
Reference in New Issue
Block a user