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

Function resolve_active_session

atomic-cli/src/commands/vault/intent.rs:68–77  ·  view source on GitHub ↗

Resolve the active agent session for the current view. Scans `.atomic/sessions/` for a session whose `view_name` matches the repository's current view. Returns `(session_id, turn_count)` if found.

(repo: &Repository)

Source from the content-addressed store, hash-verified

66/// the repository's current view. Returns `(session_id, turn_count)`
67/// if found.
68fn resolve_active_session(repo: &Repository) -> Option<(String, u32)> {
69 let sessions_dir = repo.dot_dir().join("sessions");
70 let store = SessionStore::new(&sessions_dir).ok()?;
71 let current_view = repo.current_view();
72 let active = store.find_active().ok()?;
73 active
74 .into_iter()
75 .find(|s| s.view_name == current_view)
76 .map(|s| (s.session_id.clone(), s.turn_count))
77}
78
79// Intent Subcommands
80

Callers 1

runMethod · 0.85

Calls 5

dot_dirMethod · 0.80
current_viewMethod · 0.80
find_activeMethod · 0.80
into_iterMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected