agent: add Remind request + ReminderTiming enum (stub implementation)
This commit is contained in:
parent
862bc1de44
commit
7e9fd8e978
2 changed files with 34 additions and 0 deletions
|
|
@ -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(),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -169,6 +169,17 @@ pub struct InboxRow {
|
|||
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
|
||||
/// it came in on; `Send.from` is filled in by the server, not the client.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
|
|
@ -218,6 +229,18 @@ pub enum AgentRequest {
|
|||
#[serde(default)]
|
||||
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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue