feat(tools): ClaimSource provenance, ErrorDomain recovery, MCP tool pruning#2293
Merged
feat(tools): ClaimSource provenance, ErrorDomain recovery, MCP tool pruning#2293
Conversation
This was referenced Mar 27, 2026
…runing Implements three tool-reliability improvements from research issues: - ClaimSource enum on ToolOutput tracks executor provenance (Shell, FileSystem, WebScrape, Mcp, A2a, CodeSearch, Diagnostics, Memory). Added as Option<ClaimSource> to avoid construction-site blast radius. Set by all existing executors; exposed in AuditEntry for structured audit logs. (#2266) - ErrorDomain 4-domain companion to ToolErrorCategory maps all 11 categories to Planning/Reflection/Action/System recovery strategies. Exposes domain() method and helper predicates is_auto_retryable() and needs_llm_correction() for agent loop recovery dispatch. AuditEntry gains error_domain field. (#2253) - ToolPruningConfig added to McpConfig with enabled/max_tools/pruning_provider/ min_tools_to_prune/always_include fields. prune_tools<P: LlmProvider>() free function implements workflow-mode pruning (remove irrelevant tools via LLM, merge with always_include, cap at max_tools). Not yet wired into agent loop; wiring is a follow-up PR after max_tools semantics and description sanitization are resolved. (#2204) Closes #2204 Closes #2253 Closes #2266
953bf02 to
7855ad9
Compare
Owner
Author
|
CI is failing with 6 |
This was referenced Mar 27, 2026
This was referenced Mar 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements three tool-reliability improvements from research issues:
ClaimSource (
#2266): Enum onToolOutputtracking executor provenance (Shell, FileSystem, WebScrape, Mcp, A2a, CodeSearch, Diagnostics, Memory). Added asOption<ClaimSource>to avoid struct-update blast radius. Set by all executors; exposed inAuditEntryfor structured audit logs.ErrorDomain (
#2253): 4-domain companion toToolErrorCategorymapping all 11 error categories to Planning/Reflection/Action/System recovery strategies. Exposesdomain()method andis_auto_retryable()/needs_llm_correction()predicates for agent loop dispatch.ToolPruning (
#2204):ToolPruningConfiginMcpConfig+prune_tools<P: LlmProvider>()free function implementing MemTool workflow-mode pruning (LLM removes irrelevant MCP tools, always_include bypasses, max_tools cap). Not yet wired into agent loop — wiring is a follow-up PR.Test plan
cargo +nightly fmt --check— cleancargo clippy --workspace -- -D warnings— zero warningscargo nextest run --workspace --lib --bins— 6305 passed, 0 failedparse_name_arrayhandles markdown fences, empty array, unknown namesKnown limitations (tracked as follow-up issues)
prune_toolsnot wired into agent loop — wiring PR must first resolve:max_tools == 0semantics bug (should mean "no cap", currently "no candidates")always_includecap semantics (do pinned tools count towardmax_tools?)ClaimSource→ContentSourceKindbridge inzeph-sanitizeris a follow-up (requires zeph-core integration)Closes
Closes #2204
Closes #2253
Closes #2266