agentscope-ai / agentscope-ai/agentscope-java

[Feature]: Add loop mechanism to recheck context after compression

Open
#856 1 comment 0 reactions 0 assignees View on GitHub
area/ext/memory enhancement
Dominant language
Java
Stars
5.6k
Forks
1.3k
Avg merge
4d 12h
Merged PRs (30d)
77

Description

## Problem Description

The `compressIfNeeded()` method currently returns `true` immediately after any compression strategy succeeds, **without checking if the
context still exceeds the threshold after compression**.

## Current Behavior

```java
// Strategy 1-6 are tried sequentially
if (strategy1()) return true; // Returns immediately, no recheck
if (strategy2()) return true;
...
// All strategies failed
log.warn("All compression strategies exhausted but context still exceeds threshold");
return false;

Issue Scenarios

1. Insufficient compression: Strategy 1 compresses tool calls, but context still exceeds threshold after compression

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.