Description
When DagScheduler routes a task to the main agent inline (via SchedulerAction::RunInline), the execution at crates/zeph-core/src/agent/mod.rs:820 uses self.provider.chat(&[msg]) — plain chat without tool definitions. The LLM cannot call any tools (bash, write_file, etc.) during inline task execution.
Root Cause
// crates/zeph-core/src/agent/mod.rs:818-828
let msg = Message::from_legacy(Role::User, prompt);
let event_tx = scheduler.event_sender();
let outcome = match self.provider.chat(&[msg]).await {
Ok(output) => crate::orchestration::TaskOutcome::Completed {
output,
artifacts: vec![],
},
Err(e) => crate::orchestration::TaskOutcome::Failed {
error: e.to_string(),
},
};
provider.chat() returns Result<String> — a single text response with no tool use capability. The LLM generates text describing what it would do (e.g., "The file has been successfully created") without actually executing any tools.
Reproduction
- Configure orchestration enabled, no sub-agents
- Run
/plan goal Create a file /tmp/hello.txt with text "test"
- Run
/plan confirm
- Observe: DagScheduler correctly falls back to RunInline (log: "no agent available, routing task to main agent inline")
- Observe: LLM claims success but file is never created
- Verify:
ls /tmp/hello.txt → not found
Expected Behavior
Inline task execution should include tool definitions and implement the tool_use/tool_result loop, similar to the main agent loop, so the LLM can actually execute tools.
Fix
Replace provider.chat(&[msg]) with provider.chat_with_tools() or equivalent that:
- Includes tool definitions from
ToolExecutor in the API request
- Implements the tool_use → execute → tool_result loop
- Respects tool filters/permissions
Related
Description
When
DagSchedulerroutes a task to the main agent inline (viaSchedulerAction::RunInline), the execution atcrates/zeph-core/src/agent/mod.rs:820usesself.provider.chat(&[msg])— plain chat without tool definitions. The LLM cannot call any tools (bash, write_file, etc.) during inline task execution.Root Cause
provider.chat()returnsResult<String>— a single text response with no tool use capability. The LLM generates text describing what it would do (e.g., "The file has been successfully created") without actually executing any tools.Reproduction
/plan goal Create a file /tmp/hello.txt with text "test"/plan confirmls /tmp/hello.txt→ not foundExpected Behavior
Inline task execution should include tool definitions and implement the tool_use/tool_result loop, similar to the main agent loop, so the LLM can actually execute tools.
Fix
Replace
provider.chat(&[msg])withprovider.chat_with_tools()or equivalent that:ToolExecutorin the API requestRelated