fix: remove redundant system reminder wrappers

This commit is contained in:
2026-08-20 15:01:43 +09:00
parent 2315c69f0a
commit e66876249e
9 changed files with 35 additions and 84 deletions
@@ -312,8 +312,7 @@ mod tests {
let SystemItem::TaskReminder { body, .. } = &queued[0] else {
panic!("unexpected system item: {:?}", queued[0]);
};
assert_eq!(body.matches("<system-reminder>").count(), 1);
assert_eq!(body.matches("</system-reminder>").count(), 1);
assert!(body.starts_with("Current session steps are listed below."));
assert!(body.contains("taskid 1"));
assert!(body.contains("pending"));
assert!(body.contains("keep going"));
@@ -338,19 +337,17 @@ mod tests {
panic!("unexpected system item: {:?}", queued[0]);
};
assert_eq!(*source, SystemReminderSource::TaskInactivity);
assert_eq!(body.matches("<system-reminder>").count(), 1);
assert_eq!(body.matches("</system-reminder>").count(), 1);
assert!(body.starts_with("Current session steps are listed below."));
assert!(body.contains("typed"));
}
#[test]
fn render_task_reminder_body_is_unwrapped_for_system_reminder_helper() {
fn render_task_reminder_body_is_plain_system_text() {
let feature = TaskFeature::new();
let task = feature.task_store().create("body".into(), String::new());
let body = render_task_reminder_body(&[task]);
assert!(!body.contains("<system-reminder>"));
assert!(!body.contains("</system-reminder>"));
assert!(body.starts_with("Current session steps are listed below."));
assert!(body.contains("TaskUpdate"));
assert!(body.contains("taskid 1"));
}
+2 -5
View File
@@ -176,9 +176,7 @@ impl SystemItemAppendHandle {
/// Queue a task-inactivity reminder for durable model-visible append.
///
/// The body should be the unwrapped reminder text; the host-side
/// `SystemReminder` renderer wraps it exactly once in `<system-reminder>`
/// tags before commit.
/// The body is committed verbatim as the typed item's system-message text.
pub fn append_task_reminder(&self, body: impl Into<String>) {
let item = SystemReminder::task_inactivity(body).into_system_item();
self.pending
@@ -452,8 +450,7 @@ mod tests {
assert_eq!(queued.len(), 1);
match &queued[0] {
SystemItem::TaskReminder { body, .. } => {
assert_eq!(body.matches("<system-reminder>").count(), 1);
assert!(body.contains("remember tasks"));
assert_eq!(body, "remember tasks");
}
other => panic!("unexpected system item: {other:?}"),
}
+2 -2
View File
@@ -12,8 +12,8 @@
//!
//! This is the **single lane** for "system messages produced by Worker
//! state that should land in the next LLM request": Notify,
//! agent-visible WorkerEvent variants, and any future `<system-reminder>`
//! injection all ride this queue.
//! agent-visible WorkerEvent variants, and any future typed system reminder
//! insertion all ride this queue.
//! Per `tickets/notify-history-persist.md` and `AGENTS.md` (LLM
//! context の加工原則), there is **no** "transient, history-skipping"
//! lane — everything injected into a request is also committed to