feat(story-93): expose server logs to agents via get_server_logs MCP tool
- Add log_buffer module: bounded 1000-line ring buffer with push/get_recent API - Add slog! macro: drop-in for eprintln! that also captures to ring buffer - Replace all eprintln! calls across agents, watcher, search, chat, worktree, claude_code with slog! - Add get_server_logs MCP tool: accepts count (1-500) and optional filter params - 5 unit tests for log_buffer covering push/retrieve, eviction, filtering, count limits, empty buffer - 262 tests passing, clippy clean Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@ mod config;
|
||||
mod http;
|
||||
mod io;
|
||||
mod llm;
|
||||
pub mod log_buffer;
|
||||
mod state;
|
||||
mod store;
|
||||
mod workflow;
|
||||
@@ -39,7 +40,7 @@ async fn main() -> Result<(), std::io::Error> {
|
||||
)
|
||||
.await
|
||||
.unwrap_or_else(|e| {
|
||||
eprintln!("Warning: failed to auto-open project at {project_root:?}: {e}");
|
||||
slog!("Warning: failed to auto-open project at {project_root:?}: {e}");
|
||||
project_root.to_string_lossy().to_string()
|
||||
});
|
||||
|
||||
@@ -82,7 +83,7 @@ async fn main() -> Result<(), std::io::Error> {
|
||||
// active pipeline stages (2_current/, 3_qa/, 4_merge/).
|
||||
if let Some(root) = startup_root {
|
||||
tokio::spawn(async move {
|
||||
eprintln!("[auto-assign] Server startup: scanning pipeline stages for unassigned work.");
|
||||
slog!("[auto-assign] Server startup: scanning pipeline stages for unassigned work.");
|
||||
startup_agents.auto_assign_available_work(&root).await;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user