recv: optional wait_seconds parameter, capped at 60s
AgentRequest::Recv and ManagerRequest::Recv grow an optional wait_seconds field (default None → 30s, capped at 60s server-side). agent_server / manager_server clamp via recv_timeout(). MCP tool schemas advertise the param so claude can pick its own poll window — useful when an agent wants to throttle wakes without entering a distinct nap state. both harness loops still pass None, keeping the existing 30s default behaviour for system-level Recvs.
This commit is contained in:
parent
637085644d
commit
f65ee88269
6 changed files with 73 additions and 21 deletions
|
|
@ -116,7 +116,8 @@ async fn serve(
|
|||
let label = std::env::var("HIVE_LABEL").unwrap_or_else(|_| "hive-ag3nt".into());
|
||||
let system_prompt = turn::write_system_prompt(socket, &label, mcp::Flavor::Agent).await?;
|
||||
loop {
|
||||
let recv: Result<AgentResponse> = client::request(socket, &AgentRequest::Recv).await;
|
||||
let recv: Result<AgentResponse> =
|
||||
client::request(socket, &AgentRequest::Recv { wait_seconds: None }).await;
|
||||
match recv {
|
||||
Ok(AgentResponse::Message { from, body }) => {
|
||||
tracing::info!(%from, %body, "inbox");
|
||||
|
|
|
|||
|
|
@ -96,7 +96,8 @@ async fn serve(socket: &Path, interval: Duration, bus: Bus) -> Result<()> {
|
|||
let label = std::env::var("HIVE_LABEL").unwrap_or_else(|_| "hm1nd".into());
|
||||
let system_prompt = turn::write_system_prompt(socket, &label, mcp::Flavor::Manager).await?;
|
||||
loop {
|
||||
let recv: Result<ManagerResponse> = client::request(socket, &ManagerRequest::Recv).await;
|
||||
let recv: Result<ManagerResponse> =
|
||||
client::request(socket, &ManagerRequest::Recv { wait_seconds: None }).await;
|
||||
match recv {
|
||||
Ok(ManagerResponse::Message { from, body }) => {
|
||||
if from == SYSTEM_SENDER {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue