ctx-mgmt: ctx session management (dev mode only) (#2415)

This commit is contained in:
Lily Delalande
2025-05-02 16:12:56 -04:00
committed by GitHub
parent 2366a3ad01
commit 8ba40bdccc
19 changed files with 710 additions and 118 deletions
+1 -2
View File
@@ -77,9 +77,8 @@ pub struct RedactedThinkingContent {
pub data: String,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ToSchema)]
#[serde(rename_all = "camelCase")]
#[derive(ToSchema)]
pub struct FrontendToolRequest {
pub id: String,
#[serde(with = "tool_result_serde")]
+3 -3
View File
@@ -1,10 +1,10 @@
use crate::session::{self, SessionMetadata};
use anyhow::Result;
use serde::Serialize;
use std::cmp::Ordering;
use utoipa::ToSchema;
use crate::session::{self, SessionMetadata};
#[derive(Clone, Serialize)]
#[derive(Clone, Serialize, ToSchema)]
pub struct SessionInfo {
pub id: String,
pub path: String,
+3 -1
View File
@@ -8,6 +8,7 @@ use std::fs::{self, File};
use std::io::{self, BufRead, Write};
use std::path::{Path, PathBuf};
use std::sync::Arc;
use utoipa::ToSchema;
fn get_home_dir() -> PathBuf {
choose_app_strategy(crate::config::APP_STRATEGY.clone())
@@ -17,9 +18,10 @@ fn get_home_dir() -> PathBuf {
}
/// Metadata for a session, stored as the first line in the session file
#[derive(Debug, Clone, Serialize)]
#[derive(Debug, Clone, Serialize, ToSchema)]
pub struct SessionMetadata {
/// Working directory for the session
#[schema(value_type = String, example = "/home/user/sessions/session1")]
pub working_dir: PathBuf,
/// A short description of the session, typically 3 words or less
pub description: String,