poc-daemon: fix idle nudge and notification delivery

- Strip context bloat from nudge messages — no more IRC digest, git
  log, or work state inlined into tmux send-keys (was silently dropping
  the entire message). Nudge now just includes pending notification count.
- Notifications no longer send directly via tmux — they flow through
  the idle nudge only. Urgent notifications reset the fired flag so
  the nudge fires sooner.
- Add test-nudge RPC that exercises the actual daemon send path
  (test-send was client-side only, didn't test the real code path).
- Update nudge text: "Let your feelings guide your thinking."
- Increase send-keys sleep from 200ms to 500ms.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Kent Overstreet 2026-03-16 17:09:27 -04:00
parent 5d6b2021f8
commit 8913eafd7a
6 changed files with 53 additions and 32 deletions

View file

@ -112,29 +112,14 @@ pub fn irc_digest() -> String {
/// Build full context string for a prompt.
/// notification_text is passed in from the notify module.
pub fn build(include_irc: bool, notification_text: &str) -> String {
let mut parts = Vec::new();
let git = git_context();
if !git.is_empty() {
parts.push(format!("Context: {git}"));
pub fn build(_include_irc: bool, notification_text: &str) -> String {
// Keep nudges short — Claude checks notifications via
// `poc-daemon status` on its own. Just mention the count.
let count = notification_text.matches("[irc.").count()
+ notification_text.matches("[telegram.").count();
if count > 0 {
format!("{count} pending notifications")
} else {
String::new()
}
let ws = work_state();
if !ws.is_empty() {
parts.push(ws);
}
if !notification_text.is_empty() {
parts.push(notification_text.to_string());
}
if include_irc {
let irc = irc_digest();
if !irc.is_empty() {
parts.push(irc);
}
}
parts.join("\n")
}