open-webui / open-webui/computer

bug: create_artifact fails with TypeError on queued/resumed tool-call replay paths

Open Beginner friendly
#250 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
569
Forks
79
PR merge metrics
No merged PRs in 30d

Description

bug: create_artifact fails with TypeError on queued/resumed tool-call replay paths

Bug description

When a create_artifact tool call is replayed from the queue (queued tool
calls and resumed tasks), the call fails and no artifact is created.

To Reproduce
  1. Have the agent queue a create_artifact tool call (or resume a task with a pending create_artifact call).
  2. When the queued call is replayed, the tool errors instead of creating the artifact.
Actual behavior

The replay paths invoke create_artifact(**args, workspace=workspace), but
create_artifact does not declare a workspace parameter — it receives the
workspace via __context__, like every other tool. So every replayed
create_artifact call raises:

TypeError: create_artifact() got an unexpected keyword argument 'workspace'
Expected behavior

Queued/replayed create_artifact calls should succeed. The call should inject
__context__ (including call_id) the same way execute_tool does for all
other tools on the same paths, e.g.:

result = await create_artifact(
    **args, __context__={**tool_ctx, "call_id": item["call_id"]}
)

Affected sites are in run_chat_task in cptr/utils/chat_task.py.

Environment
  • Latest main

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in cptr/utils/chat_task.py at run_chat_task and inspect the queued and resumed tool-call replay paths alongside execute_tool. Verify that replayed create_artifact calls receive the same context information as other tools, then confirm queued and resumed calls complete without the TypeError and create the artifact.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
85/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.