Skip to content

[BUG] Agents with "compaction" | Tools name error #1550

Closed

Description

@sidritic

📋 Prerequisites

  • I have searched the existing issues to avoid creating a duplicate
  • By submitting this issue, you agree to follow our Code of Conduct
  • I am using the latest version of the software
  • I have tried to clear cache/cookies or used incognito mode (if ui-related)
  • I can consistently reproduce this issue

🎯 Affected Service(s)

Not Sure

🚦 Impact/Severity

Minor inconvenience

🐛 Bug Description

As our user are likely to have longer session with Kagent, I wanted to enable the compaction feature. For testing purposes used the following configs:

    context:
      compaction:
        compactionInterval: 5
        overlapSize: 2
        summarizer:
          modelConfig: bedrock-model-config

This is the orchestrator agent in multi-agent architecture.
Howerver, after the "compaction" of the context is triggered, the Agent seems to forget the sub-agent available, to use as tools and throws an error:

Tool 'agent_name_aa' not found.\nAvailable tools: datetime_get_current_time, kagent__NS__agent_name_aa, kagent__NS__agent_name_bb ....

🔄 Steps To Reproduce

  1. create an Agent
  2. enable the compaction config
  3. trigger the compaction, e.g. based on the configs above, asking >5 promts
  4. when propt a task that requires delegating to other agents, error is thrown

🤔 Expected Behavior

The compaction is effectively reducing the context size, by summarizing it.
The Agent acting as orchestrator, should continue its work normally, even after the compaction.
It should not "forget" the available sub-agent, used for delegeting tasks.

📱 Actual Behavior

An error is thrown, and the task is not delegated to appropriate sub-agent.
Seems like the names of the sub-agent are different from what's expected.

💻 Environment

  • AWS EKS - eks.29
  • Kubernetes - 1.33
  • Kagent: 0.7.23
  • Model: Bedrock - Anthropic Claude Sonnet 4.5

🔧 CLI Bug Report

No response

🔍 Additional Context

No response

📋 Logs

📷 Screenshots

No response

🙋 Are you willing to contribute?

  • I am willing to submit a PR to fix this issue

Activity

  1. added theissue type on Mar 26, 2026
  2. yashrajshuklaaa commented on Apr 1, 2026

    @yashrajshuklaaa
    Contributor

    /assign

    i'd like work on this issue

  3. yashrajshuklaaa commented on Apr 1, 2026

    @yashrajshuklaaa
    Contributor

    hey
    want to look into this one

    the error is pretty telling tbh:

    Tool 'agent_name_aa' not found.
    Available tools: datetime_get_current_time, kagent__NS__agent_name_aa, ...
    

    so the tool IS there, just the orchestrator is calling it by the short name while post-compaction everything is registered under the namespaced version (kagent__NS__...). my guess is the summarizer writes something like "use agent_name_aa for X tasks" into the compacted context and when the agent reads that back it tries to invoke it exactly as written - dropping the namespace prefix.

    want to:

    • find where tools are resolved after compaction kicks in
    • see if the summarizer output is what's losing the prefix, or if it's the lookup side that's not normalizing
    • fix whichever side makes more sense (probably alias both formats to the same handler)

    if someone can point me to where compaction rebuilds the context / where tool calls get dispatched i can move faster, otherwise ill just start digging from the compaction interval trigger
    willing to PR once i nail down the root cause

  4. sairamreddy66 commented on May 21, 2026

    @sairamreddy66

    Hi, Is this fixed. If not can I work on this?

  5. yashrajshuklaaa commented on May 22, 2026

    @yashrajshuklaaa
    Contributor

    hi @sairamreddy66 i am working on this and it's almost ready

  6. added a commit that references this issue on Jun 1, 2026
    32ce1fb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions