Skip to content

Conversation

PauiC
Copy link

@PauiC PauiC commented Sep 22, 2025

Description

This feature provides intelligent summarization when ML Commons Chat Agents reach their maximum iteration limit without completing tasks.

Key Components:

Trigger Mechanism: Activates when agent execution reaches the max_iteration parameter limit

Control Parameter: summarize_when_max_iteration (boolean, default: false) enables/disables the feature

Related Issues

#4150

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Jiaru Jiang <jiaruj@amazon.com>
Signed-off-by: Jiaru Jiang <jiaruj@amazon.com>
@PauiC PauiC temporarily deployed to ml-commons-cicd-env-require-approval September 22, 2025 07:11 — with GitHub Actions Inactive
@PauiC PauiC temporarily deployed to ml-commons-cicd-env-require-approval September 22, 2025 07:11 — with GitHub Actions Inactive
@PauiC PauiC temporarily deployed to ml-commons-cicd-env-require-approval September 22, 2025 07:11 — with GitHub Actions Inactive
@PauiC PauiC temporarily deployed to ml-commons-cicd-env-require-approval September 22, 2025 07:11 — with GitHub Actions Inactive
@PauiC
Copy link
Author

PauiC commented Sep 22, 2025

Here is an example
image

@xinyual
Copy link
Collaborator

xinyual commented Sep 22, 2025

Do we plan to summarize the memory when it's too long?

@PauiC
Copy link
Author

PauiC commented Sep 22, 2025

Do we plan to summarize the memory when it's too long?

As far as I know, there’s no such plan.

Copy link

codecov bot commented Sep 22, 2025

Codecov Report

❌ Patch coverage is 64.28571% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.01%. Comparing base (7bf4b54) to head (51dbde8).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
.../ml/engine/algorithms/agent/MLChatAgentRunner.java 64.28% 10 Missing and 10 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #4184      +/-   ##
============================================
- Coverage     82.02%   82.01%   -0.01%     
- Complexity     9195     9206      +11     
============================================
  Files           789      789              
  Lines         39541    39597      +56     
  Branches       4387     4396       +9     
============================================
+ Hits          32432    32475      +43     
- Misses         5219     5224       +5     
- Partials       1890     1898       +8     
Flag Coverage Δ
ml-commons 82.01% <64.28%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@PauiC PauiC requested a deployment to ml-commons-cicd-env-require-approval September 22, 2025 23:10 — with GitHub Actions Waiting
@PauiC PauiC requested a deployment to ml-commons-cicd-env-require-approval September 22, 2025 23:10 — with GitHub Actions Waiting
Signed-off-by: Jiaru Jiang <jiaruj@amazon.com>
Signed-off-by: Jiaru Jiang <jiaruj@amazon.com>
@PauiC PauiC requested a deployment to ml-commons-cicd-env-require-approval September 30, 2025 03:37 — with GitHub Actions Waiting
@PauiC PauiC requested a deployment to ml-commons-cicd-env-require-approval September 30, 2025 03:37 — with GitHub Actions Waiting
@PauiC PauiC requested a deployment to ml-commons-cicd-env-require-approval September 30, 2025 03:37 — with GitHub Actions Waiting
@PauiC PauiC requested a deployment to ml-commons-cicd-env-require-approval September 30, 2025 03:37 — with GitHub Actions Waiting
Comment on lines 907 to 938
sendTraditionalMaxIterationsResponse(
sessionId,
listener,
question,
parentInteractionId,
verbose,
traceDisabled,
traceTensors,
conversationIndexMemory,
traceNumber,
additionalInfo,
summaryThought,
0,
tools
);
}, e -> { log.warn("Failed to generate LLM summary", e); }));
} else {
sendTraditionalMaxIterationsResponse(
sessionId,
listener,
question,
parentInteractionId,
verbose,
traceDisabled,
traceTensors,
conversationIndexMemory,
traceNumber,
additionalInfo,
lastThought,
maxIterations,
tools
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

in both places, we are using the same method? so can we just define the parameters that change and call the method once

Comment on lines 957 to 964
String incompleteResponse;
if (maxIterations == 0) {
incompleteResponse = lastThought.get();
} else {
incompleteResponse = (lastThought.get() != null && !lastThought.get().isEmpty() && !"null".equals(lastThought.get()))
? String.format("%s. Last thought: %s", String.format(MAX_ITERATIONS_MESSAGE, maxIterations), lastThought.get())
: String.format(MAX_ITERATIONS_MESSAGE, maxIterations);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

is maxIterations here being used as a flag? I don't understand the need for this

Copy link
Author

Choose a reason for hiding this comment

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

Yes, maxIterations is used as a flag so we can reuse the sendTraditionalMaxIterationsResponse method.

Signed-off-by: Jiaru Jiang <jiaruj@amazon.com>
@PauiC PauiC requested a deployment to ml-commons-cicd-env-require-approval October 10, 2025 05:44 — with GitHub Actions Waiting
@PauiC PauiC requested a deployment to ml-commons-cicd-env-require-approval October 10, 2025 05:44 — with GitHub Actions Waiting
@PauiC PauiC requested a deployment to ml-commons-cicd-env-require-approval October 10, 2025 05:44 — with GitHub Actions Waiting
@PauiC PauiC requested a deployment to ml-commons-cicd-env-require-approval October 10, 2025 05:44 — with GitHub Actions Waiting
Signed-off-by: Jiaru Jiang <jiaruj@amazon.com>
@PauiC PauiC requested a deployment to ml-commons-cicd-env-require-approval October 10, 2025 07:08 — with GitHub Actions Waiting
@PauiC PauiC requested a deployment to ml-commons-cicd-env-require-approval October 10, 2025 07:08 — with GitHub Actions Waiting
@PauiC PauiC requested a deployment to ml-commons-cicd-env-require-approval October 10, 2025 07:08 — with GitHub Actions Waiting
@PauiC PauiC requested a deployment to ml-commons-cicd-env-require-approval October 10, 2025 07:08 — with GitHub Actions Waiting
Signed-off-by: Jiaru Jiang <jiaruj@amazon.com>
@PauiC PauiC requested a deployment to ml-commons-cicd-env-require-approval October 10, 2025 07:56 — with GitHub Actions Waiting
@PauiC PauiC requested a deployment to ml-commons-cicd-env-require-approval October 10, 2025 07:56 — with GitHub Actions Waiting
@PauiC PauiC requested a deployment to ml-commons-cicd-env-require-approval October 10, 2025 07:56 — with GitHub Actions Waiting
@PauiC PauiC requested a deployment to ml-commons-cicd-env-require-approval October 10, 2025 07:56 — with GitHub Actions Waiting
Signed-off-by: Jiaru Jiang <jiaruj@amazon.com>
@PauiC PauiC requested a deployment to ml-commons-cicd-env-require-approval October 13, 2025 06:01 — with GitHub Actions Waiting
@PauiC PauiC requested a deployment to ml-commons-cicd-env-require-approval October 13, 2025 06:01 — with GitHub Actions Waiting
@PauiC PauiC requested a deployment to ml-commons-cicd-env-require-approval October 13, 2025 06:01 — with GitHub Actions Waiting
@PauiC PauiC requested a deployment to ml-commons-cicd-env-require-approval October 13, 2025 06:01 — with GitHub Actions Waiting
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.

4 participants