persona: the left-out-lines note says they will be handled when the wake completes, not that they were
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
b9bb470e07
commit
2d48a1e7dd
2 changed files with 3 additions and 3 deletions
|
|
@ -605,7 +605,7 @@ fn agent_input(waked: &Waked, deliveries: &[&ChatDelivery], held: &[&str], own_s
|
|||
.map(|delivery| (delivery, format!("room={} sender={} event={} text={}", quoted(&delivery.room_alias), quoted(if delivery.sender_display.is_empty() { &delivery.sender } else { &delivery.sender_display }), quoted(&delivery.event_id), quoted(&delivery.text))))
|
||||
.collect();
|
||||
// The newest lines up to the budget, the newest always. The lines left out are still held by this wake, so a completed wake acks them:
|
||||
// she is told how many, where the oldest was and that they will not be shown again.
|
||||
// she is told how many, where the oldest was and that they are marked handled once this wake completes.
|
||||
let mut kept = 0;
|
||||
let mut used = 0;
|
||||
for line in lines.iter().rev() {
|
||||
|
|
@ -618,7 +618,7 @@ fn agent_input(waked: &Waked, deliveries: &[&ChatDelivery], held: &[&str], own_s
|
|||
let dropped = lines.len() - kept;
|
||||
if dropped > 0 {
|
||||
let oldest = &lines[0].0;
|
||||
input.push_str(&format!("\n{dropped} older line(s) were not shown, the oldest in room={} at {}. They were marked handled with this wake and will not be shown again.\n", quoted(&oldest.room_alias), DateTime::from_timestamp_millis(i64::try_from(oldest.at_unix_ms).unwrap_or_default()).unwrap_or_default().to_rfc3339()));
|
||||
input.push_str(&format!("\n{dropped} older line(s) were not shown, the oldest in room={} at {}. They are not in this input, and will be marked handled when this wake completes.\n", quoted(&oldest.room_alias), DateTime::from_timestamp_millis(i64::try_from(oldest.at_unix_ms).unwrap_or_default()).unwrap_or_default().to_rfc3339()));
|
||||
}
|
||||
if kept > 0 {
|
||||
let shown: Vec<&str> = lines[dropped..].iter().map(|line| line.1.as_str()).collect();
|
||||
|
|
|
|||
|
|
@ -986,7 +986,7 @@ fn t_h4_a_backlog_over_the_budget_shows_the_newest_lines_and_says_how_many_it_le
|
|||
assert_eq!(input.contains(&format!("event=\"$e{n}\"")), n > dropped, "line {n}: the newest {kept} are shown and no other");
|
||||
}
|
||||
assert!(input.contains(&format!("\n{dropped} older line(s) were not shown, the oldest in room=\"{}\" at {}.", room(1), DateTime::from_timestamp_millis(i64::try_from(BASE_MS - 120_000 + 1000).unwrap()).unwrap().to_rfc3339())), "the count, and the room and time of the oldest of those left out (line 1): {}", &input[..700.min(input.len())]);
|
||||
assert!(input.contains("marked handled") && input.contains("will not be shown again") && !input.contains("read tool"), "the note says what became of them, and points at no tool");
|
||||
assert!(input.contains("are not in this input") && input.contains("will be marked handled when this wake completes") && !input.contains("read tool"), "the note says what became of them, and points at no tool");
|
||||
assert!(input.len() < HELD_LINES_BUDGET + 8 * 1024, "the input is bounded: {}", input.len());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue