I found problems with some models in Plan Mode, mainly because the models inject the workspace param and then arise a type error that block the artifact creation, or if it is created it's not showed.
TypeError: create_artifact() got multiple values for keyword argument 'workspace'
<Error: create_artifact tool is unavailable in current environment. Research must proceed with read-only tools only.>
For solve it I added a guard for duplicated workspace argument (keeping the actual KEYWORD_ONLY & only inject the one supplied by llm if workspace doesn't exists....perhaps in the future it will be desirable to allow LLMs to plan in mixed workspaces) :
|
if tc["name"] == "create_artifact": |
|
result = await create_artifact(**tc["arguments"], workspace=workspace) |
-->
if tc["name"] == "create_artifact":
args = dict(tc["arguments"])
args.pop("workspace", None)
result = await create_artifact(**args, workspace=workspace)
To ensure it was displayed I added an explicit instruction to PLAN_MODE_PROMPT: ...using create_artifact (and show it)...
I found problems with some models in Plan Mode, mainly because the models inject the workspace param and then arise a type error that block the artifact creation, or if it is created it's not showed.
TypeError: create_artifact() got multiple values for keyword argument 'workspace'<Error: create_artifact tool is unavailable in current environment. Research must proceed with read-only tools only.>For solve it I added a guard for duplicated workspace argument (keeping the actual KEYWORD_ONLY & only inject the one supplied by llm if workspace doesn't exists....perhaps in the future it will be desirable to allow LLMs to plan in mixed workspaces) :
computer/cptr/utils/chat_task.py
Lines 2168 to 2169 in 7e3f3ff
-->
To ensure it was displayed I added an explicit instruction to PLAN_MODE_PROMPT:
...using create_artifact (and show it)...