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
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | Screenshot 2025-11-17 at 1.25.14 PM.png | 787.9 KB | narendrar |
Issue fork canvas-3557567
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
Comment #2
akhil babuVerified 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
Comment #4
narendrarAs a work-around, created a new tool which will check for empty tile and description.
Comment #5
utkarsh_33 commentedI 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:-
Comment #6
utkarsh_33 commentedComment #7
narendrarRe, #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.
Comment #8
utkarsh_33 commentedTested 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.
Comment #9
tedbowSo 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?
Comment #10
tedbowThere some problems with the test. I will fix and set it back to RTBC soon
Comment #11
tedbowCloudflare outage is stopping test from running 😭
Comment #14
narendrar