From 0a4166baa0cfdb8a0d3fcc3b3801781c5bb087c6 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Thu, 9 Jul 2026 16:04:19 -0500 Subject: [PATCH] refac --- cptr/utils/chat_task.py | 4 +++- cptr/utils/tools.py | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cptr/utils/chat_task.py b/cptr/utils/chat_task.py index 671b393..9672e9e 100644 --- a/cptr/utils/chat_task.py +++ b/cptr/utils/chat_task.py @@ -2166,7 +2166,9 @@ async def run_chat_task( for idx in other_indices: tc, item = call_items[idx] if tc["name"] == "create_artifact": - result = await create_artifact(**tc["arguments"], workspace=workspace) + args = dict(tc["arguments"]) + args.pop("workspace", None) + result = await create_artifact(**args, workspace=workspace) else: result = await execute_tool( tc["name"], diff --git a/cptr/utils/tools.py b/cptr/utils/tools.py index eba3411..9d4fb6f 100644 --- a/cptr/utils/tools.py +++ b/cptr/utils/tools.py @@ -2923,6 +2923,8 @@ async def execute_tool(name: str, args: dict, __context__: dict) -> str: if not is_builtin_tool_enabled(name, __context__.get("builtin_tools")): return f"Error: tool disabled: {name}" fn = info["fn"] + args = dict(args) + args.pop("workspace", None) try: sig = inspect.signature(fn) if "__context__" in sig.parameters: