Skip to content

Agent: creating a JSON file shows [object Object] instead of its contents #13362

Open

Description

@YauhenBichel

Relevant environment info

  • OS: macOS
  • Continue version: 2.0.0 (also checked on main at 5522c6f)
  • IDE version: VS Code 1.141.0
  • Model: Qwen3.6-Coder 35B, served locally through an OpenAI-compatible API (provider openai)

Description

In Agent mode, when the model creates a .json file (for example package.json or tsconfig.json) and sends its contents as a JSON value rather than a string, the tool call in the chat shows:

[object Object]

instead of the file contents. Qwen models do this often for JSON files.

Cause: the GUI parses the tool call arguments deeply, so parsedArgs.contents is an object. FunctionSpecificToolCallDiv passes it to CreateFile, which puts it in a template string (gui/src/pages/gui/ToolCallDiv/FunctionSpecificToolCallDiv.tsx, fileContents={args?.contents ?? ""}).

To reproduce

A test that renders FunctionSpecificToolCallDiv for create_new_file with parsedArgs = { filepath: "app/package.json", contents: { name: "app", version: "1.0.0" } }: the preview source is [object Object].

Log output

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions