web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Claude Sonnet stops be...
Copilot Studio
Suggested Answer

Claude Sonnet stops before tool call when generating large tool input

(0) ShareShare
ReportReport
Posted on by
Hello,
 
I am investigating an issue with a custom agent in Microsoft Copilot Studio using the Claude Sonnet model.
 
The agent is designed to generate a SharePoint modern page based on external input data.
 
The high-level workflow is as follows:
 
1. Receive external input data.
2. Retrieve template information for a SharePoint modern page.
3. Generate page content based on the template structure.
4. Generate or replace required IDs / GUIDs.
5. Build the final data for posting the page.
6. Call a Power Automate / SharePoint posting tool.
7. Register the result in a SharePoint list.
 
The issue occurs when the prompt, including the input data and page-generation instructions, becomes large.
 
Specifically, when the agent receives around 30,000 Japanese characters, Claude Sonnet appears to stop while generating the input values to be passed to the tool.
 
I have confirmed the following:
 
- The tool itself can be called successfully with shorter or simpler inputs.
- The Power Automate flow completes within 100 seconds.
- The Copilot Studio error code `FlowActionTimedOut` is not displayed.
- The following size-related Copilot Studio error codes are also not displayed:
  - `AsyncResponsePayloadTooLarge`
  - `ConversationStateTooLarge`
  - `TooMuchDataToHandle`
  - `OutgoingMessageSizeTooBig`
- No other visible Copilot Studio error code is shown.
- The interruption seems to happen before or during the stage where the agent generates and sets the tool input, rather than after the tool has been executed.
- Once this state occurs, the same test session no longer proceeds to the tool call, even if I later instruct the agent to “resume,” “stop the previous work,” or “call the tool.”
- If I start a new test session and use a shorter input, the tool call works again.
 
From the user’s perspective, the session itself does not appear to be disconnected.
 
However, the agent seems to be stuck in an internal reasoning or tool-input-generation state before the actual tool call. After that, the agent does not properly respond to later instructions to call the tool.
 
The process includes relatively complex operations such as:
 
- Understanding the template structure.
- Adjusting the page section structure.
- Replacing web part information.
- Adding or deleting sections.
- Handling fixed IDs and newly generated IDs.
- Generating data for posting the page.
 
I would like to ask the following:
 
1. Are there any practical limits on the character count, token count, or payload size for tool inputs generated by a Copilot Studio agent?
2. Are there any known limitations or issues when using Claude Sonnet in Copilot Studio to generate tool inputs from long prompts?
3. Is it generally unreliable to have an agent generate a large JSON-like payload and pass it directly as a tool input?
4. If the process stops before the tool call and no error code such as `FlowActionTimedOut`, `AsyncResponsePayloadTooLarge`, `ConversationStateTooLarge`, `TooMuchDataToHandle`, or `OutgoingMessageSizeTooBig` is displayed, is there any diagnostic log or investigation method available?
5. Is it a known behavior that, after one failed long-input attempt, the same session may no longer respond properly to later tool-call instructions?
 
Has anyone experienced a similar issue with long prompts, Claude Sonnet, Copilot Studio tool input generation, or SharePoint modern page generation?
 
Any information about known limitations, recommended investigation methods, or possible workarounds would be appreciated.
 
Thank you.
Categories:
I have the same question (0)
  • Suggested answer
    Prasad-MSFT Profile Picture
    Microsoft Employee on at
    1. Practical Limits on Character/Token/Payload Size
    Yes, there are limits:
    • Copilot Studio agents (and underlying LLMs like Claude Sonnet) have a maximum context window (token limit) and output size for each turn.
    • For Claude Sonnet, the context window is typically 200k tokens, but Copilot Studio may enforce a lower cap per message or tool input (often 8k–16k tokens per turn, sometimes less for tool payloads).
    • Tool input payloads (especially JSON) may be truncated or fail if too large, even if no explicit error is shown.
    2. Known Limitations with Claude Sonnet in Copilot Studio
    Yes, there are known issues:
    • Large or complex prompts can cause the model to stall, truncate, or silently fail to generate the full tool input.
    • The agent may appear “stuck” or unresponsive if the LLM cannot fit the reasoning and output within the allowed token/output window.
    • This is more likely with non-Latin scripts (like Japanese), as each character may consume more tokens.
    3. Reliability of Large JSON Payload Generation
    It is generally unreliable to have an agent generate and pass very large JSON-like payloads directly as tool input, especially if the payload approaches or exceeds the per-turn output limit.
    For complex or large data, it’s better to:
    • Break the process into smaller steps.
    • Generate and validate partial payloads.
    • Use a tool or flow to assemble the final payload from smaller agent outputs.
    4. Diagnostics and Investigation
    Copilot Studio does not expose detailed logs for internal LLM reasoning or failed tool input generation.
    If no error code is shown, the only diagnostics are:
    • Reviewing the session transcript for where the process stalls.
    • Reducing input size and complexity to see where the cutoff occurs.
    • Using the Copilot Studio evaluation tool to inspect intermediate outputs (if available).
    • There is no user-accessible log for “silent” failures before tool invocation.

    Recommendations & Workarounds
    1. Reduce input size: Split large prompts or data into smaller chunks.
    2. Chunk processing: Have the agent process and pass data in parts, then assemble in the tool/flow.
    3. Validate intermediate outputs: Add steps to check/confirm generated payloads before tool invocation.
    4. Restart sessions: If a session stalls, start a new one for further testing.
    5. Monitor for platform updates: Microsoft is actively improving Copilot Studio’s handling of large payloads, but current limits are strict.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 633

#2
Vish WR Profile Picture

Vish WR 301

#3
Haque Profile Picture

Haque 216

Last 30 days Overall leaderboard