feat: strict_tools capability + DCP ToolCallPart pruning - #389
Open
Danerw wants to merge 3 commits into
Open
Conversation
added 3 commits
August 24, 2026 16:12
…schemas Adds StrictToolsCapability which upgrades tool schemas with strict=True for LiteLLM/SGLang compatibility. Registers the capability in wolfharness_config and includes a usage guide plus tests.
When DCP prunes a ToolReturnPart, also replace the matching ToolCallPart args with a valid JSON stub so the conversation stays consistent for downstream serializers (e.g. SGLang). Applies to prune actions, distill, meta-tool auto-prune, de-dup and re-prune paths, gated by the new prune_tool_calls config option.
…task reminders Two shutdown-safety fixes for team mode: 1. Create child member sessions with lifecycle_policy='independent' so team members survive a parent shutdown (e.g. conductor succession: a new conductor must outlive the old conductor's cascade close). 2. Replace the one-reminder-per-session cap with task-id fingerprinting: each distinct unfinished task is reminded at most once, with a configurable total cap via the new TeamModeConfig.max_task_reminders option (default 3). Reminder state is tracked in session metadata (_reminded_task_ids, _task_reminder_count).
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
Two related improvements to tool-call handling:
1.
strict_toolscapability (new)Adds
StrictToolsCapability, which upgrades tool schemas withstrict=Truewhen the model config leaves it unset. This fixes 400 errors from LiteLLM → SGLang routing wherestrict=Noneis silently ignored upstream.src/wolfharness/capabilities/strict_tools.pywolfharness_config/capabilities.py(KNOWN_CAPABILITY_TYPES, IMPORT_MAP, config union, build dispatch)docs/strict_tools-guide.mdtests/capabilities/test_strict_tools.py2. DCP: prune
ToolCallPartargs when pruning tool returnsWhen DCP prunes/prunes a
ToolReturnPart, the matchingToolCallPart.argsis now replaced with a valid JSON stub ({"pruned": true}/{"dedup": true}). Previously the call args stayed in the conversation, which can break downstream serializers (e.g. SGLang'sjson.loadspath through Chat Completions).Applies consistently across:
prune_tool_calls: bool = Trueconfig option onDCPConfig(and matchingDynamicContextPruningCapabilityinit param)Tests
tests/capabilities/test_strict_tools.py— 8 teststests/capabilities/dcp/— 133 teststests/wolfharness_server/acp_server/test_acp_mcp_fastmcp_integration.pyare baseline issues onmain, unrelated to this PR)