mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-05-28 00:35:13 +02:00
Minor agent-orchestrator updates (#746)
Tidy agent-orchestrator logs Added CLI support for selecting the pattern... tg-invoke-agent -q "What is the document about?" -p supervisor -v tg-invoke-agent -q "What is the document about?" -p plan-then-execute -v tg-invoke-agent -q "What is the document about?" -p react -v Added new event types to tg-show-explain-trace
This commit is contained in:
parent
816a8cfcf6
commit
89e13a756a
9 changed files with 152 additions and 75 deletions
|
|
@ -57,7 +57,7 @@ class Aggregator:
|
|||
"request_template": request_template,
|
||||
"created_at": time.time(),
|
||||
}
|
||||
logger.info(
|
||||
logger.debug(
|
||||
f"Aggregator: registered fan-out {correlation_id}, "
|
||||
f"expecting {expected_siblings} subagents"
|
||||
)
|
||||
|
|
@ -82,7 +82,7 @@ class Aggregator:
|
|||
completed = len(entry["results"])
|
||||
expected = entry["expected"]
|
||||
|
||||
logger.info(
|
||||
logger.debug(
|
||||
f"Aggregator: {correlation_id} — "
|
||||
f"{completed}/{expected} subagents complete"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ class PatternBase:
|
|||
)
|
||||
|
||||
await next(completion_request)
|
||||
logger.info(
|
||||
logger.debug(
|
||||
f"Subagent completion emitted for "
|
||||
f"correlation={request.correlation_id}, "
|
||||
f"goal={getattr(request, 'subagent_goal', '')}"
|
||||
|
|
|
|||
|
|
@ -60,10 +60,6 @@ class ReactPattern(PatternBase):
|
|||
filtered_tools = self.filter_tools(
|
||||
self.processor.agent.tools, request,
|
||||
)
|
||||
logger.info(
|
||||
f"Filtered from {len(self.processor.agent.tools)} "
|
||||
f"to {len(filtered_tools)} available tools"
|
||||
)
|
||||
|
||||
# Create temporary agent with filtered tools and optional framing
|
||||
additional_context = self.processor.agent.additional_context
|
||||
|
|
|
|||
|
|
@ -414,7 +414,6 @@ class Processor(AgentService):
|
|||
self.meta_router = MetaRouter(config=config)
|
||||
|
||||
logger.info(f"Loaded {len(tools)} tools")
|
||||
logger.info("Tool configuration reloaded.")
|
||||
|
||||
except Exception as e:
|
||||
logger.error(
|
||||
|
|
@ -436,7 +435,7 @@ class Processor(AgentService):
|
|||
answer_text = step.observation
|
||||
break
|
||||
|
||||
logger.info(
|
||||
logger.debug(
|
||||
f"Received subagent completion: "
|
||||
f"correlation={correlation_id}, goal={subagent_goal}"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -550,8 +550,6 @@ class Processor(AgentService):
|
|||
current_state=getattr(request, 'state', None)
|
||||
)
|
||||
|
||||
logger.info(f"Filtered from {len(self.agent.tools)} to {len(filtered_tools)} available tools")
|
||||
|
||||
# Create temporary agent with filtered tools
|
||||
temp_agent = AgentManager(
|
||||
tools=filtered_tools,
|
||||
|
|
|
|||
|
|
@ -34,17 +34,17 @@ def filter_tools_by_group_and_state(
|
|||
if current_state is None or current_state == "":
|
||||
current_state = "undefined"
|
||||
|
||||
logger.info(f"Filtering tools with groups={requested_groups}, state={current_state}")
|
||||
|
||||
logger.debug(f"Filtering tools with groups={requested_groups}, state={current_state}")
|
||||
|
||||
filtered_tools = {}
|
||||
|
||||
|
||||
for tool_name, tool in tools.items():
|
||||
if _is_tool_available(tool, requested_groups, current_state):
|
||||
filtered_tools[tool_name] = tool
|
||||
else:
|
||||
logger.debug(f"Tool {tool_name} filtered out")
|
||||
|
||||
logger.info(f"Filtered {len(tools)} tools to {len(filtered_tools)} available tools")
|
||||
|
||||
logger.debug(f"Filtered {len(tools)} tools to {len(filtered_tools)} available tools")
|
||||
return filtered_tools
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue