Skip to content

Conversation

@amanjaiswal73892
Copy link
Collaborator

@amanjaiswal73892 amanjaiswal73892 commented Jul 25, 2025

Anthropic requires maximum 4 cache breakpoints per request. This unsets cache breakpoints from earlier messages and only adds a single breakpoint in the flatten() method.

Description by Korbit AI

What change is being made?

Fix the cache breakpoint handling in the StructuredDiscussion class by resetting previous cache breakpoints before setting a new one.

Why are these changes being made?

The previous implementation did not properly handle the cache breakpoints, only marking the last message for caching. This change ensures that all previous cache breakpoints are reset, avoiding potential issues with incorrect caching in the ToolUseAgent.

Is this description stale? Ask me to generate a new description by commenting /korbit-generate-pr-description

Anthropic requires maximum 4 cache breakpoints per request. This unsets cache breakpoints from earlier messages and only adds a single breakpoint in the flatten() method.
Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've completed my review and didn't find any issues... but I did find this frog.

           .--._.--.
          ( O     O )
          /   . .   \
         .`._______.'.
        /(           )\
      _/  \  \   /  /  \_
   .~   `  \  \ /  /  '   ~.
  {    -.   \  V  /   .-    }
_ _`.    \  |  |  |  /    .'_ _
>_       _} |  |  | {_       _<
 /. - ~ ,_-'  .^.  `-_, ~ - .\
         '-'|/   \|`-`
Files scanned
File Path Reviewed
src/agentlab/agents/tool_use_agent/tool_use_agent.py

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

Copy link
Collaborator

@hnekoeiq hnekoeiq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@amanjaiswal73892 amanjaiswal73892 merged commit 3c2422e into main Jul 25, 2025
7 checks passed
@amanjaiswal73892 amanjaiswal73892 deleted the cache-breakpoint-fix branch July 25, 2025 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants