Rename Session -> HookSession

The hook's Session is not the same as poc-agent's session concept.
Rename to avoid confusion now that poc-agent will create HookSessions
to call into the agent cycle.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
Kent Overstreet 2026-04-02 00:42:25 -04:00
parent a0245c1279
commit 55a037f4c7
5 changed files with 19 additions and 19 deletions

View file

@ -36,14 +36,14 @@ enum Cmd {
Reflect,
}
fn resolve_session(session_arg: &Option<String>) -> Option<poc_memory::memory_search::Session> {
use poc_memory::memory_search::Session;
fn resolve_session(session_arg: &Option<String>) -> Option<poc_memory::memory_search::HookSession> {
use poc_memory::memory_search::HookSession;
if let Some(id) = session_arg {
return Session::from_id(id.clone());
return HookSession::from_id(id.clone());
}
let input = fs::read_to_string(stash_path()).ok()?;
Session::from_json(&input)
HookSession::from_json(&input)
}
fn show_seen(session_arg: &Option<String>) {
@ -92,7 +92,7 @@ fn run_agent_and_parse(agent: &str, session_arg: &Option<String>) {
.or_else(|| std::env::var("CLAUDE_SESSION_ID").ok())
.or_else(|| {
fs::read_to_string(stash_path()).ok()
.and_then(|s| poc_memory::memory_search::Session::from_json(&s))
.and_then(|s| poc_memory::memory_search::HookSession::from_json(&s))
.map(|s| s.session_id)
})
.unwrap_or_default();