Skip to content

bug: Issue with create_artifact (Plan Mode) #110

Description

@rgaricano

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)...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions