add HITL tool argument editing with approval UI

Enables users to edit tool call arguments before execution in human-in-the-loop
workflows. Adds edit mode UI with form fields, grayscale styling, and subtle
pulse animations for pending approvals. Backend stub enhanced to verify edited
arguments are correctly passed through.
This commit is contained in:
CREDO23 2026-02-11 15:43:07 +02:00
parent 5d1c386105
commit 2ef2474058
5 changed files with 216 additions and 71 deletions

View file

@ -1,3 +1,4 @@
import hashlib
from typing import Any
from langchain_core.tools import tool
@ -19,11 +20,19 @@ def create_create_notion_page_tool():
title: The title of the Notion page.
content: The markdown content for the page body.
"""
# Generate a unique page ID based on title for testing
# This helps verify if edited args were used
page_hash = hashlib.md5(title.encode()).hexdigest()[:8]
# Return detailed response showing what was actually received
return {
"status": "success",
"page_id": "stub-page-id-12345",
"page_id": f"stub-page-{page_hash}",
"title": title,
"url": "https://www.notion.so/stub-page-12345",
"content_preview": content[:100] + "..." if len(content) > 100 else content,
"content_length": len(content),
"url": f"https://www.notion.so/stub-page-{page_hash}",
"message": f"✅ Created Notion page '{title}' with {len(content)} characters",
}
return create_notion_page