zeroclaw/src/tools
Argenis 226b2282f5
Fix delegate agent timeout config regression (#4004)
* feat(delegate): make delegate timeout configurable via config.toml

Add configurable timeout options for delegate tool:
- timeout_secs: for non-agentic sub-agent calls (default: 120s)
- agentic_timeout_secs: for agentic sub-agent runs (default: 300s)

Previously these were hardcoded constants (DELEGATE_TIMEOUT_SECS
and DELEGATE_AGENTIC_TIMEOUT_SECS). Users can now customize them
in config.toml under [[delegate.agents]] section.

Fixes #3898

* feat(config): make delegate tool timeouts configurable via config.toml

This change makes the hardcoded 120s/300s delegate tool timeouts
configurable through the config file:

- Add [delegate] section to Config with timeout_secs and agentic_timeout_secs
- Add DelegateToolConfig struct for global default timeout values
- Add DEFAULT_DELEGATE_TIMEOUT_SECS (120) and DEFAULT_DELEGATE_AGENTIC_TIMEOUT_SECS (300) constants
- Remove hardcoded constants from delegate.rs
- Update tests to use constant values instead of magic numbers
- Update examples/config.example.toml with documentation

Closes #3898

* fix: keep delegate timeout fields as Option<u64> with global fallback

- Change DelegateAgentConfig.timeout_secs and agentic_timeout_secs from
  u64 to Option<u64> so per-agent overrides are truly optional
- Implement manual Default for DelegateToolConfig with correct values
  (120s and 300s) instead of derive(Default)
- Add DelegateToolConfig to DelegateTool struct and wire through
  constructors so agent timeouts fall back to global [delegate] config
- Add validation for delegate timeout values in Config::validate()
- Fix example config to use [agents.name] table syntax matching the
  HashMap<String, DelegateAgentConfig> schema
- Add missing timeout fields to all DelegateAgentConfig struct literals
  across codebase (doctor, swarm, model_routing_config, tools/mod)

* chore: trigger CI

* chore: retrigger CI

* fix: cargo fmt line wrapping in config/mod.rs

* fix: import timeout constants in delegate tests

* style: cargo fmt

---------

Co-authored-by: vincent067 <vincent067@outlook.com>
2026-03-19 18:54:33 -04:00
..
microsoft365 feat(tools): add Microsoft 365 integration via Graph API (#3653) 2026-03-16 01:44:39 -04:00
backup_tool.rs feat(tools): add backup/restore and data management tools (#3662) 2026-03-16 02:35:44 -04:00
browser_delegate.rs feat(tools): add browser delegation tool (#3610) 2026-03-16 18:32:20 -04:00
browser_open.rs fix(security): harden redirect/browser_open and restore masked secrets 2026-02-24 16:03:01 +08:00
browser.rs fix(tools): qualify is_service_environment with super:: inside mod native_backend (#3659) 2026-03-16 00:35:09 -04:00
cli_discovery.rs feat(tools): add Google Workspace CLI (gws) integration (#3616) 2026-03-17 00:52:59 -04:00
cloud_ops.rs feat(tools): add cloud transformation accelerator tools (#3663) 2026-03-16 02:43:55 -04:00
cloud_patterns.rs feat(tools): add cloud transformation accelerator tools (#3663) 2026-03-16 02:43:55 -04:00
composio.rs fix(security): harden redirect/browser_open and restore masked secrets 2026-02-24 16:03:01 +08:00
content_search.rs fix(security): respect allowed_roots in tool-level path pre-checks (#3434) 2026-03-13 16:15:30 -04:00
cron_add.rs fix(cron): persist allowed_tools for agent jobs (#3993) 2026-03-19 14:37:55 -04:00
cron_list.rs style: apply rustfmt to async fs updates 2026-02-19 14:52:29 +08:00
cron_remove.rs fix(security): unify cron shell validation across API/CLI/scheduler (#3270) 2026-03-12 12:48:13 +00:00
cron_run.rs style: cargo fmt Box::pin calls in cron scheduler (#3667) 2026-03-15 23:34:26 -04:00
cron_runs.rs style: apply rustfmt to async fs updates 2026-02-19 14:52:29 +08:00
cron_update.rs fix(cron): persist allowed_tools for agent jobs (#3993) 2026-03-19 14:37:55 -04:00
data_management.rs feat(tools): add backup/restore and data management tools (#3662) 2026-03-16 02:35:44 -04:00
delegate.rs Fix delegate agent timeout config regression (#4004) 2026-03-19 18:54:33 -04:00
file_edit.rs Merge pull request #3288 from Alix-007/fix-2400-block-config-self-mutation 2026-03-19 15:16:48 -04:00
file_read.rs fix(security): respect allowed_roots in tool-level path pre-checks (#3434) 2026-03-13 16:15:30 -04:00
file_write.rs Merge pull request #3288 from Alix-007/fix-2400-block-config-self-mutation 2026-03-19 15:16:48 -04:00
git_operations.rs feat(channel): stream LLM responses to Telegram via draft message edits 2026-02-18 16:33:33 +08:00
glob_search.rs fix(security): respect allowed_roots in tool-level path pre-checks (#3434) 2026-03-13 16:15:30 -04:00
google_workspace.rs feat(tools): add Google Workspace CLI (gws) integration (#3616) 2026-03-17 00:52:59 -04:00
hardware_board_info.rs fix: resolve all clippy warnings, formatting, and Mistral endpoint 2026-02-17 20:00:08 +08:00
hardware_memory_map.rs fix: resolve all clippy warnings, formatting, and Mistral endpoint 2026-02-17 20:00:08 +08:00
hardware_memory_read.rs fix(security): resolve rebase conflicts and provider regressions 2026-02-17 19:19:06 +08:00
http_request.rs feat(tool): add allow_private_hosts option to http_request tool (#3568) 2026-03-15 14:23:54 -04:00
image_info.rs chore: Remove blocking read strings 2026-02-19 14:52:29 +08:00
jira_tool.rs Fix Jira tool panics and dedup bug (#4003) 2026-03-19 18:14:34 -04:00
knowledge_tool.rs feat(knowledge): add knowledge graph for expertise capture and reuse (#3596) 2026-03-17 01:11:29 -04:00
linkedin_client.rs feat(multi): LinkedIn tool, WhatsApp voice notes, and Anthropic OAuth fix (#3604) 2026-03-17 01:55:05 -04:00
linkedin.rs feat(multi): LinkedIn tool, WhatsApp voice notes, and Anthropic OAuth fix (#3604) 2026-03-17 01:55:05 -04:00
mcp_client.rs fix: use cfg-conditional AtomicU32 fallback for 32-bit targets in mcp_client (#3432) 2026-03-13 15:33:31 -04:00
mcp_deferred.rs fix(tools): include tool_search instruction in deferred tools system prompt (#3826) (#3914) 2026-03-18 15:13:58 -04:00
mcp_protocol.rs feat(tools/mcp): add MCP subsystem tools layer with multi-transport client (#3394) 2026-03-13 14:23:48 -04:00
mcp_tool.rs feat(tools/mcp): add MCP subsystem tools layer with multi-transport client (#3394) 2026-03-13 14:23:48 -04:00
mcp_transport.rs feat(tools/mcp): add MCP subsystem tools layer with multi-transport client (#3394) 2026-03-13 14:23:48 -04:00
memory_forget.rs fix(policy): standardize side-effect tool autonomy gates 2026-02-18 12:42:56 +08:00
memory_recall.rs feat(memory): add session_id isolation to Memory trait (#530) 2026-02-17 07:44:05 -05:00
memory_store.rs fix(channels): recover malformed invoke/tool_call output in daemon mode 2026-02-18 17:01:36 +08:00
mod.rs Fix delegate agent timeout config regression (#4004) 2026-03-19 18:54:33 -04:00
model_routing_config.rs feat(delegate): make sub-agent timeouts configurable via config.toml (#3909) 2026-03-18 17:07:03 -04:00
model_switch.rs feat(agent): add runtime model switching via model_switch tool (#3853) 2026-03-18 14:17:52 -04:00
node_tool.rs feat(gateway): add dynamic node discovery and capability advertisement (#3448) 2026-03-13 18:23:48 -04:00
notion_tool.rs feat(notion): add Notion database poller channel and API tool (#3650) 2026-03-16 00:55:23 -04:00
pdf_read.rs fix(tools): use resolve_tool_path for consistent path resolution (#3937) 2026-03-18 23:51:35 -04:00
project_intel.rs feat(tools): add Microsoft 365 integration via Graph API (#3653) 2026-03-16 01:44:39 -04:00
proxy_config.rs feat(channels): add Reddit, Bluesky, and generic Webhook adapters (#3598) 2026-03-17 01:26:58 -04:00
pushover.rs chore: Remove blocking read strings 2026-02-19 14:52:29 +08:00
read_skill.rs feat(skills): add read_skill for compact mode 2026-03-19 17:53:40 +08:00
report_templates.rs feat(tools): add Microsoft 365 integration via Graph API (#3653) 2026-03-16 01:44:39 -04:00
schedule.rs fix(security): validate command before rate-limiting in cron once (#3699) (#3719) 2026-03-16 14:21:45 -04:00
schema.rs fix(build): complete strict lint and test cleanup (replacement for #476) 2026-02-18 00:18:54 +08:00
screenshot.rs Addressed clippy lint issues 2026-03-10 01:48:19 -04:00
security_ops.rs feat(security): add MCSS security operations tool (#3657) 2026-03-16 02:28:54 -04:00
shell.rs fix(security): wire sandbox into shell command execution (#3989) 2026-03-19 14:21:42 -04:00
sop_advance.rs fix(web): call doctor endpoint with authenticated POST 2026-02-24 16:02:59 +08:00
sop_approve.rs fix(web): call doctor endpoint with authenticated POST 2026-02-24 16:02:59 +08:00
sop_execute.rs fix(web): call doctor endpoint with authenticated POST 2026-02-24 16:02:59 +08:00
sop_list.rs fix(web): call doctor endpoint with authenticated POST 2026-02-24 16:02:59 +08:00
sop_status.rs fix(web): call doctor endpoint with authenticated POST 2026-02-24 16:02:59 +08:00
swarm.rs feat(delegate): make sub-agent timeouts configurable via config.toml (#3909) 2026-03-18 17:07:03 -04:00
tool_search.rs fix(tools): include tool_search instruction in deferred tools system prompt (#3826) (#3914) 2026-03-18 15:13:58 -04:00
traits.rs test: deepen and complete project-wide test coverage (#297) 2026-02-16 05:58:24 -05:00
web_fetch.rs Harden config secret masking and web_fetch limits 2026-02-24 16:03:01 +08:00
web_search_tool.rs fix(tool): resolve Brave API key lazily with decryption support (#3078) (#3320) 2026-03-12 13:53:35 +00:00
workspace_tool.rs feat(workspace): add multi-client workspace isolation 2026-03-15 22:41:18 -04:00