Skip to content

feat(tools): tool registry, file executor, doom-loop detection#246

Merged
bug-ops merged 2 commits intomainfrom
feat/m18/tool-orchestration
Feb 14, 2026
Merged

feat(tools): tool registry, file executor, doom-loop detection#246
bug-ops merged 2 commits intomainfrom
feat/m18/tool-orchestration

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Feb 14, 2026

Summary

  • Add ToolRegistry with typed ToolDef definitions for 7 built-in tools (bash, read, edit, write, glob, grep, web_scrape)
  • Add sandboxed FileExecutor for file operations with path traversal protection
  • Extend ToolExecutor trait with ToolCall struct and execute_tool_call() for structured tool invocation
  • Update CompositeExecutor to aggregate definitions and route tool calls by tool_id
  • Include tool catalog in system prompt via format_for_prompt()
  • Raise iteration cap from hardcoded 3 to configurable 10 (max_tool_iterations in TOML / ZEPH_AGENT_MAX_TOOL_ITERATIONS env)
  • Add doom-loop detection: break on 3 consecutive identical tool outputs
  • Add context budget check at 80% threshold

Closes #239,Closes #240,Closes #241,Closes #242,Closes #243,Closes #244,Closes #245

Test plan

  • 1304 unit tests pass (10 new tests for registry, file executor, routing, doom-loop, budget check)
  • Security audit: sandbox bypass fixes verified (write, glob, grep paths)
  • Performance review: no high-impact issues
  • clippy zero warnings, fmt clean

@github-actions github-actions bot added documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate dependencies Dependency updates config Configuration file changes enhancement New feature or request size/XL Extra large PR (500+ lines) labels Feb 14, 2026
#239, #240, #241, #242, #243, #244, #245)

Introduce structured tool definitions via ToolRegistry with 7 built-in
tools, sandboxed FileExecutor for file operations, and CompositeExecutor
routing by tool_id. Raise iteration cap from 3 to configurable 10 with
doom-loop detection (3 consecutive identical outputs) and context budget
check at 80% threshold.
@bug-ops bug-ops force-pushed the feat/m18/tool-orchestration branch from 90cee10 to 9f04ce0 Compare February 14, 2026 12:10
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 14, 2026

Codecov Report

❌ Patch coverage is 90.83558% with 68 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/zeph-tools/src/file.rs 92.79% 26 Missing ⚠️
crates/zeph-core/src/agent.rs 68.11% 22 Missing ⚠️
crates/zeph-tools/src/composite.rs 83.82% 11 Missing ⚠️
crates/zeph-core/src/context.rs 75.00% 4 Missing ⚠️
crates/zeph-tools/src/executor.rs 85.71% 3 Missing ⚠️
crates/zeph-tools/src/registry.rs 99.50% 1 Missing ⚠️
src/main.rs 0.00% 1 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #246      +/-   ##
==========================================
+ Coverage   80.86%   81.15%   +0.29%     
==========================================
  Files          79       81       +2     
  Lines       23239    23970     +731     
==========================================
+ Hits        18792    19454     +662     
- Misses       4447     4516      +69     
Files with missing lines Coverage Δ
crates/zeph-core/src/config.rs 98.92% <100.00%> (+<0.01%) ⬆️
crates/zeph-tools/src/registry.rs 99.50% <99.50%> (ø)
src/main.rs 69.96% <0.00%> (-0.06%) ⬇️
crates/zeph-tools/src/executor.rs 97.34% <85.71%> (-2.66%) ⬇️
crates/zeph-core/src/context.rs 97.65% <75.00%> (-1.86%) ⬇️
crates/zeph-tools/src/composite.rs 92.41% <83.82%> (-7.59%) ⬇️
crates/zeph-core/src/agent.rs 69.05% <68.11%> (-0.10%) ⬇️
crates/zeph-tools/src/file.rs 92.79% <92.79%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Add guide/tools.md covering tool registry, file executor sandbox,
dual-mode execution, iteration cap, and doom-loop detection. Update
crates.md, security.md, configuration.md, SUMMARY.md, and README.md.
@bug-ops bug-ops enabled auto-merge (squash) February 14, 2026 12:19
@bug-ops bug-ops merged commit b8d69a8 into main Feb 14, 2026
20 checks passed
@bug-ops bug-ops deleted the feat/m18/tool-orchestration branch February 14, 2026 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Configuration file changes core zeph-core crate dependencies Dependency updates documentation Improvements or additions to documentation enhancement New feature or request rust Rust code changes size/XL Extra large PR (500+ lines)

Projects

None yet

2 participants