Skip to content

Commit 60f9264

Browse files
authored
Merge pull request #53 from 100monkeys-ai/copilot/update-session-ttl-configurability
Extract session TTL into named constant
2 parents fcfd4d2 + 24849d3 commit 60f9264

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

orchestrator/core/src/domain/smcp_session.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ use crate::domain::execution::ExecutionId;
4141
use crate::domain::mcp::PolicyViolation;
4242
use crate::domain::security_context::SecurityContext;
4343

44+
/// Default session time-to-live in hours.
45+
///
46+
/// Operators can adjust this constant to change how long SMCP sessions remain valid
47+
/// after creation, without modifying the rest of the session lifecycle logic.
48+
const SESSION_TTL_HOURS: i64 = 1;
49+
4450
/// Opaque identifier for a single SMCP session (one per agent execution).
4551
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
4652
pub struct SessionId(pub Uuid);
@@ -200,7 +206,7 @@ impl SmcpSession {
200206
security_context,
201207
status: SessionStatus::Active,
202208
created_at: now,
203-
expires_at: now + chrono::Duration::hours(1),
209+
expires_at: now + chrono::Duration::hours(SESSION_TTL_HOURS),
204210
}
205211
}
206212

0 commit comments

Comments
 (0)