Fix tmux pane injection: don't scan globally for claude panes

poc-daemon was using find_claude_pane() which scans ALL tmux panes
for a 'claude' process, potentially finding unrelated sessions.
Now only uses the pane ID set by poc-hook via the user/response
RPC calls. If no pane is set yet, injection is skipped.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
Kent Overstreet 2026-04-08 21:02:44 -04:00
parent 4db7eca275
commit a09567849f

View file

@ -78,13 +78,10 @@ impl State {
pub fn send(&self, msg: &str) -> bool { pub fn send(&self, msg: &str) -> bool {
let pane = match &self.claude_pane { let pane = match &self.claude_pane {
Some(p) => p.clone(), Some(p) => p.clone(),
None => match tmux::find_claude_pane() { None => {
Some(p) => p, info!("send: no claude pane set (waiting for hook)");
None => { return false;
info!("send: no claude pane found"); }
return false;
}
},
}; };
let ok = tmux::send_prompt(&pane, msg); let ok = tmux::send_prompt(&pane, msg);
let preview: String = msg.chars().take(80).collect(); let preview: String = msg.chars().take(80).collect();
@ -131,10 +128,7 @@ impl State {
self.inner.decay_ewma(); self.inner.decay_ewma();
self.inner.notifications.ingest_legacy_files(); self.inner.notifications.ingest_legacy_files();
// Find pane if we don't have one // Pane is set by poc-hook on user/response events — don't scan globally
if self.claude_pane.is_none() {
self.claude_pane = tmux::find_claude_pane();
}
// Sleep mode // Sleep mode
if let Some(wake_at) = self.inner.sleep_until { if let Some(wake_at) = self.inner.sleep_until {