agent: per-session todo queue (todo tool, pinned TODO section, GUI panel)
Persistent task list (pending/doing/done) with never-reused seq from a per-session high-water mark; open items injected as a dynamic TODO section with pre-warm-on-change; read-only GUI panel + i18n; TOOL_USE manual extended. Docs updated; agent-feedback memory Q&A exchange and AGENT_RULES seed rules included. Verified: 245 passed / 6 ignored, clippy+fmt clean; dogfooded live.
This commit is contained in:
1 parent
f74d53e446
commit
9b05592efb
16 files changed
+1067
-21
No files matched your search
@@ -182,6 +182,50 @@ async fn memory_enable_rejected_without_service() {
|
||||
assert_eq!(v["settings"]["memory_enabled"], false);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn todos_endpoint_exposes_the_task_list() {
|
||||
let (app, store) = build_app().await;
|
||||
let id = create_session(&app).await;
|
||||
// Empty list initially.
|
||||
let (st, text) = req(
|
||||
&app,
|
||||
Method::GET,
|
||||
&format!("/api/sessions/{id}/todos"),
|
||||
None,
|
||||
)
|
||||
.await;
|
||||
assert_eq!(st, StatusCode::OK, "{text}");
|
||||
assert_eq!(
|
||||
serde_json::from_str::<serde_json::Value>(&text)
|
||||
.unwrap()
|
||||
.as_array()
|
||||
.unwrap()
|
||||
.len(),
|
||||
0
|
||||
);
|
||||
// Seed via the store (the agent writes through the todo tool).
|
||||
store.add_todo(&id, "first step").unwrap();
|
||||
let second = store.add_todo(&id, "second step").unwrap();
|
||||
store
|
||||
.update_todo(&id, second.seq, Some("doing"), None)
|
||||
.unwrap();
|
||||
let (_, text) = req(
|
||||
&app,
|
||||
Method::GET,
|
||||
&format!("/api/sessions/{id}/todos"),
|
||||
None,
|
||||
)
|
||||
.await;
|
||||
let v: serde_json::Value = serde_json::from_str(&text).unwrap();
|
||||
let arr = v.as_array().unwrap();
|
||||
assert_eq!(arr.len(), 2);
|
||||
assert_eq!(arr[0]["seq"], 1);
|
||||
assert_eq!(arr[0]["status"], "pending");
|
||||
assert_eq!(arr[1]["seq"], 2);
|
||||
assert_eq!(arr[1]["status"], "doing");
|
||||
assert_eq!(arr[1]["content"], "second step");
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn session_holds_context_and_persists_usage() {
|
||||
let (app, _store) = build_app().await;
|
||||
|
||||
Reference in new issue
Block a user