story-kit: merge 183_story_refactor_matrix_bot_to_use_claude_code_provider_instead_of_direct_anthropic_api

This commit is contained in:
Dave
2026-02-25 12:42:11 +00:00
parent 7c48022230
commit a1d25d756b
7 changed files with 1823 additions and 14 deletions

View File

@@ -5,6 +5,7 @@ mod http;
mod io;
mod llm;
pub mod log_buffer;
mod matrix;
mod state;
mod store;
mod workflow;
@@ -113,7 +114,6 @@ async fn main() -> Result<(), std::io::Error> {
let startup_reconciliation_tx = reconciliation_tx.clone();
// Clone for shutdown cleanup — kill orphaned PTY children before exiting.
let agents_for_shutdown = Arc::clone(&agents);
let ctx = AppContext {
state: app_state,
store,
@@ -142,6 +142,12 @@ async fn main() -> Result<(), std::io::Error> {
});
}
// Optional Matrix bot: connect to the homeserver and start listening for
// messages if `.story_kit/bot.toml` is present and enabled.
if let Some(ref root) = startup_root {
matrix::spawn_bot(root);
}
// On startup:
// 1. Reconcile any stories whose agent work was committed while the server was
// offline (worktree has commits ahead of master but pipeline didn't advance).