feat(#1990): surface pending recv() message count in get_loose_ends
This commit is contained in:
parent
678f50f3fb
commit
49db9d6e1c
5 changed files with 44 additions and 0 deletions
|
|
@ -35,6 +35,17 @@ use crate::coordinator::Coordinator;
|
|||
pub fn for_agent(coord: &Coordinator, agent: &str) -> Result<Vec<LooseEnd>> {
|
||||
let now = now_unix();
|
||||
let mut out = Vec::new();
|
||||
// Undelivered inbox messages this agent still owes itself a `recv`
|
||||
// for. Surfaced first (most actionable) and only when non-zero so a
|
||||
// clean inbox doesn't add noise. The wake-message that drove the
|
||||
// current turn is already delivered, so this counts only what's
|
||||
// genuinely still queued.
|
||||
let pending_messages = coord.broker.count_pending(agent)?;
|
||||
if pending_messages > 0 {
|
||||
out.push(LooseEnd::PendingMessages {
|
||||
count: pending_messages,
|
||||
});
|
||||
}
|
||||
// Show each pending approval to the agent that submitted it. The
|
||||
// submitter column is NULL for rows predating it; those count as
|
||||
// the root agent's.
|
||||
|
|
|
|||
Loading…
Reference in a new issue