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:
parent
5d6b2021f8
commit
8913eafd7a
6 changed files with 53 additions and 32 deletions
|
|
@ -121,6 +121,8 @@ enum Command {
|
|||
/// Message to send
|
||||
message: Vec<String>,
|
||||
},
|
||||
/// Fire a test nudge through the daemon (tests the actual idle send path)
|
||||
TestNudge,
|
||||
/// Dump full internal state as JSON
|
||||
Debug,
|
||||
/// Shut down daemon
|
||||
|
|
@ -272,6 +274,12 @@ async fn client_main(cmd: Command) -> Result<(), Box<dyn std::error::Error>> {
|
|||
println!("send_prompt(pane={}, ok={}): {}", pane, ok, msg);
|
||||
return Ok(());
|
||||
}
|
||||
Command::TestNudge => {
|
||||
let reply = daemon.test_nudge_request().send().promise.await?;
|
||||
let r = reply.get()?;
|
||||
println!("sent={} message={}", r.get_sent(), r.get_message()?.to_str()?);
|
||||
return Ok(());
|
||||
}
|
||||
Command::Afk => {
|
||||
daemon.afk_request().send().promise.await?;
|
||||
println!("marked AFK");
|
||||
|
|
@ -526,7 +534,7 @@ async fn server_main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
|
||||
// Drain module notifications into state
|
||||
Some(notif) = notify_rx.recv() => {
|
||||
state.borrow().maybe_prompt_notification(
|
||||
state.borrow_mut().maybe_prompt_notification(
|
||||
¬if.ntype, notif.urgency, ¬if.message,
|
||||
);
|
||||
state.borrow_mut().notifications.submit(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue