drop the hyperhive send/recv/ack_until tools: agents message over matrix
This commit is contained in:
parent
ccac95fcf4
commit
bffb2c07a8
1 changed files with 52 additions and 397 deletions
|
|
@ -9,23 +9,13 @@ use crate::turn::{TurnError, TurnOutcome};
|
|||
use crate::turn_stats::TurnStatRow;
|
||||
|
||||
/// Assemble the per-turn wake prompt string. The role/tools/etc. live in the
|
||||
/// system prompt; this is just the wake signal body. `id` is the broker row
|
||||
/// id, rendered as a `[msg #<id>]` marker so the agent can reference it in
|
||||
/// `ack_until`. `unread` is the inbox depth after this message was popped.
|
||||
/// `redelivered` prepends a "may already be handled" banner; `interrupted`
|
||||
/// system prompt; this is just the wake signal body. `redelivered` prepends a "may already be handled" banner; `interrupted`
|
||||
/// prepends a "previous turn was /cancel'd" banner instead (the two are
|
||||
/// mutually exclusive in practice — a redelivered message means the harness
|
||||
/// itself restarted, which also clears the in-memory interrupted flag — so
|
||||
/// `redelivered` takes priority if both were somehow set).
|
||||
#[must_use]
|
||||
pub fn format_wake_prompt(
|
||||
id: i64,
|
||||
from: &str,
|
||||
body: &str,
|
||||
unread: u64,
|
||||
redelivered: bool,
|
||||
interrupted: bool,
|
||||
) -> String {
|
||||
pub fn format_wake_prompt(from: &str, body: &str, redelivered: bool, interrupted: bool) -> String {
|
||||
let banner = if redelivered {
|
||||
hive_sh4re::inbox::REDELIVERY_HINT
|
||||
} else if interrupted {
|
||||
|
|
@ -33,13 +23,7 @@ pub fn format_wake_prompt(
|
|||
} else {
|
||||
""
|
||||
};
|
||||
let tag = if id > 0 {
|
||||
format!("[msg #{id}] ")
|
||||
} else {
|
||||
String::new()
|
||||
};
|
||||
let pending = hive_sh4re::inbox::pending_hint(unread);
|
||||
format!("{banner}{tag}Incoming message from `{from}`:\n---\n{body}\n---{pending}")
|
||||
format!("{banner}Incoming message from `{from}`:\n---\n{body}\n---")
|
||||
}
|
||||
|
||||
/// Field-named args for [`build_row`]. Mirrors the turn-stats row
|
||||
|
|
|
|||
Loading…
Reference in a new issue