Skip to content

MiddlewareError2: Invalid response from "wrapModelCall" in middleware "SkillsMiddleware": expected AIMessage or Command, got object at MiddlewareError2.wrap (D:\AllItemProduct\helix-client\out\main\index.js:84643:12) #295

@caohuiyihao

Description

@caohuiyihao

After the response content was outputted normally, an error was suddenly caught: MiddlewareError2: Invalid response from "wrapModelCall" in middleware "SkillsMiddleware": expected AIMessage or Command, got object at MiddlewareError2.wrap (D:\AllItemProduct\helix-client\out\main\index.js:84643:12) This issue only occurs when using deepagents to create agents. If using langchain to create agents, there is no such problem. Used versions: "deepagents": "1.8.2", "langchain": "1.2.29", "@langchain/langgraph": "1.2.0", "@langchain/openai": "1.2.12",
I tried removing the skills configuration, but the error persisted: MiddlewareError2: Invalid response from "wrapModelCall" in middleware "patchToolCallsMiddleware": expected AIMessage or Command, got object. I also tried removing the tools configuration, but the error still occurred: MiddlewareError2: Invalid response from "wrapModelCall" in middleware "patchToolCallsMiddleware": expected AIMessage or Command, got object

`const backend = getBackend();

this.agent = createDeepAgent({
  backend,
  interruptOn: {
    delete_file: true,
    write_file: false,
    delete_file_dir: true,
    move_file: true,
    copy_file: false,
    get_file_info: false,
    get_file_list: false,
    shell_command: false,
  },
  checkpointer,
  name: this.name,
  model,
  systemPrompt: this.systemPrompt,
  // middleware: [autoSkillMiddleware()],
  middleware: [],
  // tools,
  // skills: [`${SKILLS_DIR}`],
});`

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