feat(terra): pass-broker prompts say who asked

Prompts and the journal now show "darman via Claude Code" (a `claude`
ancestor) or the terminal holding the tty, plus the caller's command with
store/profile paths cut to program names, and the process chain. It is
a hint, not identity: anything running as darman can fake it.

A client that has already hung up now always loses the race against the
prompt lock and Telegram polling, so it can no longer get a prompt, and
gone clients get no reply (no more EPIPE noise). The ghost-request test
freezes the broker to reproduce the queued-while-restarting case exactly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-16 02:12:04 +02:00
co-authored by Claude Opus 5.5
parent 3dccafe2b8
commit 8c0c2822c6
3 changed files with 128 additions and 38 deletions
+2 -1
View File
@@ -100,8 +100,9 @@ impl Telegram {
}),
);
let polled = tokio::select! {
r = poll => r,
biased;
_ = gone.as_mut() => break 'poll Verdict::Cancelled,
r = poll => r,
};
let updates = match polled {
Ok(u) => u,