Skip to content

fix(orchestration): include tool definitions in inline task execution#1509

Merged
bug-ops merged 3 commits intomainfrom
inline-task-tools
Mar 10, 2026
Merged

fix(orchestration): include tool definitions in inline task execution#1509
bug-ops merged 3 commits intomainfrom
inline-task-tools

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Mar 9, 2026

Summary

  • SchedulerAction::RunInline used provider.chat() without tool definitions, so the LLM could only produce text responses — no tools were ever executed during inline task execution
  • Adds run_inline_tool_loop() method on Agent<C> with a fresh isolated message history and a full tool_use → execute → tool_result loop
  • Iterations capped at tool_orchestrator.max_iterations

Test plan

  • text_only_response_returns_immediately — no tool round-trips, returns text immediately
  • single_tool_iteration_returns_final_text — one ToolUse round, verifies tool executed and final text returned
  • multiple_tool_iterations_before_text — two consecutive ToolUse rounds before Text
  • loop_terminates_at_max_iterations — provider always returns ToolUse, verifies loop cap
  • tool_error_produces_is_error_result_and_loop_continues — executor failure is surfaced in tool result, loop continues
  • provider_error_is_propagatedchat_with_tools error propagated up as Err
  • cargo +nightly fmt --check passes
  • cargo clippy --workspace --features full -- -D warnings passes
  • cargo nextest run --config-file .github/nextest.toml --workspace --features full --lib --bins — 4976 passed

Fixes #1494. Related: #1463, #1467.

bug-ops added 2 commits March 10, 2026 00:32
RunInline task execution used provider.chat() without tool definitions,
causing the LLM to describe actions instead of actually executing them.

Replace provider.chat() with a new run_inline_tool_loop() method that:
- builds tool definitions from the current tool executor
- runs chat_with_tools() with a fresh isolated message history
- implements the tool_use -> execute -> tool_result loop
- caps iterations at tool_orchestrator.max_iterations

Fixes #1494. Related: #1463, #1467.
@github-actions github-actions bot added rust Rust code changes core zeph-core crate bug Something isn't working size/L Large PR (201-500 lines) labels Mar 9, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 9, 2026 23:47
@bug-ops bug-ops merged commit 729fc9a into main Mar 10, 2026
18 checks passed
@bug-ops bug-ops deleted the inline-task-tools branch March 10, 2026 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working core zeph-core crate rust Rust code changes size/L Large PR (201-500 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RunInline task execution uses provider.chat() without tool definitions

1 participant