feat(mcp): enhance MCP server registration with error handling and improve transport process management

refactor: update various tools for better error handling and path resolution
fix: improve markdown rendering and input display in TUI
This commit is contained in:
asepharyana
2026-07-20 13:12:04 +07:00
parent 89ee213454
commit 148ba4e07b
17 changed files with 242 additions and 82 deletions
@@ -56,25 +56,34 @@ pub async fn execute_cycle(
let cycle_index = cycle.index;
use crate::workflow::hive_mind::types::NodeDirective;
// Run all directives in this cycle concurrently.
let handles: Vec<_> = cycle
.directives
.iter()
.enumerate()
.map(|(i, directive)| {
let dir = directive.clone();
.map(|(i, node_dir): (usize, &NodeDirective)| {
let dir = node_dir.directive.clone();
let access_tier = node_dir.access_tier.clone();
let ctx = SubagentContext::new(
dir.clone(),
tool_ctx.clone(),
"full".to_string(),
access_tier.clone(),
base_url.clone(),
api_key.clone(),
model.clone(),
);
let tc = tool_ctx.clone();
let access = match access_tier.as_str() {
"write" => AccessTier::Write,
"full" => AccessTier::Full,
_ => AccessTier::Read,
};
async move {
let result = run_agent(ctx, &dir, AccessTier::Full, tc).await?;
let result = run_agent(ctx, &dir, access, tc).await?;
Ok::<NodeOutput, anyhow::Error>(NodeOutput {
id: format!("Node-{}-{}", cycle_index, i),
directive: dir,