fix: tighten up some logic around session timestamps and ids (#922)

* update `SessionConfigured` event to include the UUID for the session
* show the UUID in the Rust TUI
* use local timestamps in log files instead of UTC
* include timestamps in log file names for easier discovery
This commit is contained in:
Michael Bolin
2025-05-13 19:22:16 -07:00
committed by GitHub
parent 3c03c25e56
commit e6c206d19d
9 changed files with 101 additions and 77 deletions

View File

@@ -10,6 +10,7 @@ use std::path::PathBuf;
use mcp_types::CallToolResult;
use serde::Deserialize;
use serde::Serialize;
use uuid::Uuid;
use crate::model_provider_info::ModelProviderInfo;
@@ -323,10 +324,7 @@ pub enum EventMsg {
},
/// Ack the client's configure message.
SessionConfigured {
/// Tell the client what model is being queried.
model: String,
},
SessionConfigured(SessionConfiguredEvent),
McpToolCallBegin {
/// Identifier so this can be paired with the McpToolCallEnd event.
@@ -429,6 +427,15 @@ pub enum EventMsg {
},
}
#[derive(Debug, Default, Clone, Deserialize, Serialize)]
pub struct SessionConfiguredEvent {
/// Unique id for this session.
pub session_id: Uuid,
/// Tell the client what model is being queried.
pub model: String,
}
/// User's decision in response to an ExecApprovalRequest.
#[derive(Debug, Default, Clone, Copy, Deserialize, Serialize)]
#[serde(rename_all = "snake_case")]