fix: mark surfaced keys as returned so --seen classifies them correctly

The surface agent result consumer in poc-hook was writing to the seen
file but not the returned file, so surfaced keys showed up as
"context-loaded" in memory-search --seen.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Kent Overstreet 2026-03-22 23:06:46 -04:00
parent c0e6d5cfb3
commit 966219720a
2 changed files with 10 additions and 2 deletions

View file

@ -247,6 +247,13 @@ fn surface_agent_cycle(hook: &Value) {
let ts = chrono::Local::now().format("%Y-%m-%dT%H:%M:%S");
let _ = writeln!(f, "{}\t{}", ts, key);
}
let returned_path = state_dir.join(format!("returned-{}", session_id));
if let Ok(mut f) = fs::OpenOptions::new()
.create(true).append(true).open(&returned_path)
{
use std::io::Write;
let _ = writeln!(f, "{}", key);
}
}
}
}