Overview

When using Claude 3.7 Sonnet (anthropic.claude-3-7-sonnet model) in Drupal Canvas AI, the agent fails to consistently execute parallel tool calls for title and metadata generation when using canvas_page_builder_agent or canvas_template_builder_agent.
The orchestrator is designed to proactively generate page titles and metadata when:

  • Page title is empty or "Untitled page"
  • Page description is empty

This functionality works correctly with Claude Sonnet 4 (anthropic.claude-sonnet-4) or later models but fails with Claude 3.7 Sonnet. Claude 3.7 Sonnet is deprecated now, See https://docs.claude.com/en/docs/about-claude/model-deprecations#model-st...

Proposed resolution

This appears to be a model-specific instruction-following issue where Claude 3.7 Sonnet does not reliably execute parallel tool calls even when the instructions explicitly require it.
To support Claude 3.7 Sonnet, we might need to tweak agent instructions, so that it works consistently with tools execution.

User interface changes

Issue fork canvas-3557567

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

narendrar created an issue. See original summary.

akhil babu’s picture

Verified this with @narendrar. For OpenAI and Anthropic models (except Claude 3.7 Sonnet), tool calls are executed in parallel. For example, when both the title and description are empty, the orchestrator invokes the page_builder/template_builder, title_agent, and `metadata_agent` simultaneously.

However, with Claude 3.7 Sonnet, the tool calls happen sequentially. We confirmed this by creating a simple taxonomy agent that adds taxonomy terms to a vocabulary using the `modify_taxonomy_term` tool. When asked to add more than one term to a vocabulary, it consistently invokes the tool multiple times sequentially, even when explicitly instructed in the prompt to use the tools parallelly.

Also, When the orchestrator is invoked for the first time, the model correctly indicates that it will generate both a title and description, but once it invokes page_builder or template_builter, the execution stops

narendrar’s picture

Status: Active » Needs review
StatusFileSize
new787.9 KB

Issue As per attached SS for lin https://docs.claude.com/en/docs/agents-and-tools/tool-use/implement-tool..., it seems parallel tool execution does not work as expected.
As a work-around, created a new tool which will check for empty tile and description.

utkarsh_33’s picture

I tested this and the only thing that's failing is when we manually change the Metadata of any page before the page generation task, ideally it should not change the value of Metadata rather it should create the page and update the title only for the page.
But with the above changes applied it updates the metadata as well, so marking it NW again to fix the issue.
Here are the scenarios that i tested:-

  • Title and metadata not empty or NULL.It updates the metadata and title(Prompt used:-Add 3 hero components to the page around football) Tried 3 times and it works as expected.
  • Title empty and metadata has some value(manually entered before page creation task) -> It updates the metadata but it should not(Prompt used:-Create a page for a university website) Tried 3 times and failed 3 times.
  • Title has some value and metadata empty -> It updates the metadata Only(Prompt used:-Add 3 hero components to the page around cricket) Tried 3 times and it worked correctly.
  • Title and metadata has values related to cricket -> It does not update the metadata and title both(Prompt used:-Add 3 hero components to the page around football) Tried 3 times and it worked correctly.
  • Component creation and editing works as expected.
utkarsh_33’s picture

Status: Needs review » Needs work
narendrar’s picture

Status: Needs work » Needs review

Re, #5.2, Created a follow-up #3558200: Canvas AI: canvas_metadata_generation_agent should not be called if page already has description to address that separately to unblock this issue.

utkarsh_33’s picture

Status: Needs review » Reviewed & tested by the community

Tested this and everything else works correctly as per the scenarios mentioned in #5. Since we have a follow-up for the issue reported we can mark this RTBC.

tedbow’s picture

So has this only been tested on Claude 3.7 Sonnet? Are we sure even though Claude Sonnet 4 doesn't have this problem the changes won't introduce new problems for Claude Sonnet 4?

tedbow’s picture

Assigned: Unassigned » tedbow
Status: Reviewed & tested by the community » Needs work

There some problems with the test. I will fix and set it back to RTBC soon

tedbow’s picture

Assigned: tedbow » Unassigned
Status: Needs work » Reviewed & tested by the community

Cloudflare outage is stopping test from running 😭

  • tedbow committed 44ed0b66 on 1.x authored by narendrar
    #3557567: Claude 3.7 Sonnet fails to executefeat: #3557567 Canvas AI:...
narendrar’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.