swarm repositories / source
aboutsummaryrefslogtreecommitdiff
path: root/crates/phone-opus/src/mcp/host
diff options
context:
space:
mode:
Diffstat (limited to 'crates/phone-opus/src/mcp/host')
-rw-r--r--crates/phone-opus/src/mcp/host/runtime.rs17
1 files changed, 16 insertions, 1 deletions
diff --git a/crates/phone-opus/src/mcp/host/runtime.rs b/crates/phone-opus/src/mcp/host/runtime.rs
index 5922766..1d18453 100644
--- a/crates/phone-opus/src/mcp/host/runtime.rs
+++ b/crates/phone-opus/src/mcp/host/runtime.rs
@@ -25,6 +25,7 @@ use crate::mcp::protocol::{
FORCE_ROLLOUT_ENV, HOST_STATE_ENV, HostRequestId, HostStateSeed, PROTOCOL_VERSION, SERVER_NAME,
WORKER_CRASH_ONCE_ENV, WorkerOperation, WorkerSpawnConfig,
};
+use crate::mcp::service::{consult_job_tool_output, consult_jobs_tool_output};
use crate::mcp::telemetry::ServerTelemetry;
pub(crate) fn run_host() -> Result<(), Box<dyn std::error::Error>> {
@@ -360,9 +361,23 @@ impl HostRuntime {
fn handle_host_tool(&mut self, name: &str, arguments: Value) -> Result<Value, FaultRecord> {
let operation = format!("tools/call:{name}");
let generation = self.worker.generation();
- let (presentation, _arguments) =
+ let (presentation, arguments) =
split_presentation(arguments, &operation, generation, FaultStage::Host)?;
match name {
+ "consult_job" => tool_success(
+ consult_job_tool_output(arguments, generation, FaultStage::Host, &operation)?,
+ presentation,
+ generation,
+ FaultStage::Host,
+ &operation,
+ ),
+ "consult_jobs" => tool_success(
+ consult_jobs_tool_output(arguments, generation, FaultStage::Host, &operation)?,
+ presentation,
+ generation,
+ FaultStage::Host,
+ &operation,
+ ),
"health_snapshot" => {
let rollout = if self.binary.rollout_pending().map_err(|error| {
FaultRecord::rollout(generation, &operation, error.to_string())