Skip to content

feat: strict_tools capability + DCP ToolCallPart pruning - #389

Open
Danerw wants to merge 3 commits into
wolf1069b:mainfrom
Danerw:feat/toolcall-pruning
Open

feat: strict_tools capability + DCP ToolCallPart pruning#389
Danerw wants to merge 3 commits into
wolf1069b:mainfrom
Danerw:feat/toolcall-pruning

Conversation

@Danerw

@Danerw Danerw commented Aug 24, 2026

Copy link
Copy Markdown

Summary

Two related improvements to tool-call handling:

1. strict_tools capability (new)

Adds StrictToolsCapability, which upgrades tool schemas with strict=True when the model config leaves it unset. This fixes 400 errors from LiteLLM → SGLang routing where strict=None is silently ignored upstream.

  • New: src/wolfharness/capabilities/strict_tools.py
  • Registered in wolfharness_config/capabilities.py (KNOWN_CAPABILITY_TYPES, IMPORT_MAP, config union, build dispatch)
  • Usage guide: docs/strict_tools-guide.md
  • Tests: tests/capabilities/test_strict_tools.py

2. DCP: prune ToolCallPart args when pruning tool returns

When DCP prunes/prunes a ToolReturnPart, the matching ToolCallPart.args is 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's json.loads path through Chat Completions).

Applies consistently across:

  • Prune id actions, distill, meta-tool auto-prune, dedup and re-prune paths
  • All gated by a new prune_tool_calls: bool = True config option on DCPConfig (and matching DynamicContextPruningCapability init param)

Tests

  • tests/capabilities/test_strict_tools.py — 8 tests
  • tests/capabilities/dcp/ — 133 tests
  • Full unit suite: 5144 passed (16 pre-existing failures in tests/wolfharness_server/acp_server/test_acp_mcp_fastmcp_integration.py are baseline issues on main, unrelated to this PR)

t-wangzhiwen 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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant