#714 Add generic configurable update handler tool

closed high Created 2025-12-25 21:46 · Updated 2025-12-25 22:15

Description

Edit
Current state: The tools.testing.update_handler is hardcoded to handle 'approve_request' updates with a specific handler function. To handle updates with custom logic (like LLM responses), developers must create new tools. Problem: Workflow DSL is JSON-based, but ctx.handle_update() requires Python functions. No declarative way to compose update handling with tool execution. Solution: Create tools.update.handle - a generic update handler that accepts: - update_name: which update to listen for - response_tool: which tool to invoke for generating response - response_kwargs: kwargs to pass to the response tool - timeout_seconds: how long to wait Example usage: builder.task( 'handle_messages', 'tools.update.handle', kwargs={ 'update_name': 'user_message', 'response_tool': 'tools.llm.call', 'response_kwargs': { 'provider': 'ollama', 'model': 'deepseek-v3.2:cloud', 'prompt': '{{update_payload.message}}', }, 'timeout_seconds': 300, } ) This removes the need for custom tools per update type and makes the engine properly composable.

Comments

Loading comments...

Context

Loading context...

Audit History

View All
Loading audit history...