MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / new

Method new

atomic-agent/src/turn/session.rs:356–395  ·  view source on GitHub ↗

Create a new session in the `Idle` phase. # Arguments `session_id` — Unique session identifier from the agent `agent_name` — Agent registry key (e.g., "claude-code") `agent_display_name` — Human-readable name (e.g., "Claude Code")

(
        session_id: impl Into<String>,
        agent_name: impl Into<String>,
        agent_display_name: impl Into<String>,
    )

Source from the content-addressed store, hash-verified

354 /// * `agent_name` — Agent registry key (e.g., "claude-code")
355 /// * `agent_display_name` — Human-readable name (e.g., "Claude Code")
356 pub fn new(
357 session_id: impl Into<String>,
358 agent_name: impl Into<String>,
359 agent_display_name: impl Into<String>,
360 ) -> Self {
361 let session_id = session_id.into();
362 let view_name = Self::make_view_name(&session_id);
363 let now = Utc::now();
364
365 Self {
366 session_id,
367 view_name,
368 explicit_record_files: false,
369 phase: Phase::Idle,
370 status: SessionStatus::Active,
371 turn_count: 0,
372 agent_name: agent_name.into(),
373 agent_display_name: agent_display_name.into(),
374 agent_vendor: String::new(),
375 model: String::new(),
376 started_at: now,
377 last_interaction: Some(now),
378 ended_at: None,
379 parent_view: None,
380 transcript_path: None,
381 first_prompt: None,
382 current_prompt: None,
383 files_touched: Vec::new(),
384 current_turn_started_at: None,
385 recorded_change_hashes: Vec::new(),
386 managed_run: None,
387 boundary_start: None,
388 turn_outcomes: Vec::new(),
389 mac_key: None,
390 attested_operations: Vec::new(),
391 last_attestation: None,
392 repair_history: Vec::new(),
393 evidence_retained: false,
394 }
395 }
396
397 /// Derive the Atomic view name for an agent session.
398 ///

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected