Phase 7c: ApprovalResolved helper events into manager's inbox
This commit is contained in:
parent
7c1ed07cf2
commit
1ceabae892
3 changed files with 76 additions and 12 deletions
|
|
@ -9,7 +9,7 @@ use std::time::Duration;
|
|||
use anyhow::{Result, bail};
|
||||
use clap::{Parser, Subcommand};
|
||||
use hive_ag3nt::{DEFAULT_SOCKET, DEFAULT_WEB_PORT, client, web_ui};
|
||||
use hive_sh4re::{ManagerRequest, ManagerResponse};
|
||||
use hive_sh4re::{HelperEvent, ManagerRequest, ManagerResponse, SYSTEM_SENDER};
|
||||
|
||||
#[derive(Parser)]
|
||||
#[command(name = "hive-m1nd", about = "hyperhive manager harness")]
|
||||
|
|
@ -94,7 +94,14 @@ async fn serve(socket: &Path, interval: Duration) -> Result<()> {
|
|||
let recv: Result<ManagerResponse> = client::request(socket, &ManagerRequest::Recv).await;
|
||||
match recv {
|
||||
Ok(ManagerResponse::Message { from, body }) => {
|
||||
tracing::info!(%from, %body, "manager inbox");
|
||||
if from == SYSTEM_SENDER {
|
||||
match serde_json::from_str::<HelperEvent>(&body) {
|
||||
Ok(event) => tracing::info!(?event, "helper event"),
|
||||
Err(_) => tracing::info!(%from, %body, "system message"),
|
||||
}
|
||||
} else {
|
||||
tracing::info!(%from, %body, "manager inbox");
|
||||
}
|
||||
}
|
||||
Ok(ManagerResponse::Empty) => {}
|
||||
Ok(ManagerResponse::Ok) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue