agent: add Remind request + ReminderTiming enum (stub implementation)

This commit is contained in:
damocles 2026-05-16 12:39:35 +02:00
parent 862bc1de44
commit 7e9fd8e978
2 changed files with 34 additions and 0 deletions

View file

@ -188,5 +188,16 @@ async fn dispatch(req: &AgentRequest, agent: &str, coord: &Arc<Coordinator>) ->
}, },
} }
} }
AgentRequest::Remind {
message,
timing,
file_path,
} => {
// TODO: submit to reminder scheduler
// For now, return a stub response
AgentResponse::Err {
message: "remind not yet implemented".to_owned(),
}
}
} }
} }

View file

@ -169,6 +169,17 @@ pub struct InboxRow {
pub at: i64, pub at: i64,
} }
/// Reminder timing: either relative (wait N seconds) or absolute (at unix
/// timestamp).
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "timing_type", rename_all = "snake_case")]
pub enum ReminderTiming {
/// Remind after this many seconds from now.
InSeconds { seconds: u64 },
/// Remind at this unix timestamp (seconds since epoch).
At { unix_timestamp: i64 },
}
/// Requests on a per-agent socket. The agent's identity is the socket /// Requests on a per-agent socket. The agent's identity is the socket
/// it came in on; `Send.from` is filled in by the server, not the client. /// it came in on; `Send.from` is filled in by the server, not the client.
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
@ -218,6 +229,18 @@ pub enum AgentRequest {
#[serde(default)] #[serde(default)]
ttl_seconds: Option<u64>, ttl_seconds: Option<u64>,
}, },
/// Schedule a reminder message to be delivered to this agent at a
/// future time. The reminder lands in the agent's inbox as an auto-sent
/// message from `"reminder"`. Use for agent follow-ups (e.g. check task
/// status, retry failed operation). Message length is limited; pass
/// `file_path` to store in a file and get a path-reference message
/// instead.
Remind {
message: String,
timing: ReminderTiming,
#[serde(default)]
file_path: Option<String>,
},
} }
/// Responses on a per-agent socket. /// Responses on a per-agent socket.