Skip to content

fix(mcp): prune_tools max_tools == 0 should mean no cap, not zero candidates #2294

@bug-ops

Description

@bug-ops

Bug

In crates/zeph-mcp/src/pruning.rs, when PruningParams.max_tools == 0:

if result.len() >= params.max_tools  // 0 >= 0 = true on first iteration

No LLM-selected candidates are added. The config docs say max_tools = 0 means "no limit", but the code treats it as "no candidates". These are contradictory.

Expected behavior

max_tools == 0 → no cap on LLM-selected candidates.

Fix required before wiring PR

This must be resolved before prune_tools is wired into the agent loop.

Component

zeph-mcp (pruning.rs)

Metadata

Metadata

Assignees

Labels

P2High value, medium complexitybugSomething isn't workingtoolsTool execution and MCP integration

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions