Skip to content

fix: trim all overflow messages in a single summarizer pass - #211

Merged
plfavreau merged 1 commit into
minitap-ai:mainfrom
citizen204:fix-210-summarizer-full-trim
Jul 9, 2026
Merged

fix: trim all overflow messages in a single summarizer pass#211
plfavreau merged 1 commit into
minitap-ai:mainfrom
citizen204:fix-210-summarizer-full-trim

Conversation

@citizen204

Copy link
Copy Markdown
Contributor

Summary

The return await state.asanitize_update(...) was indented inside the for loop that scans overflow candidates, so the node returned after the very first iteration and removed at most one message per pass — even when history was several messages over MAX_MESSAGES_IN_HISTORY.

Moving the return outside the loop lets the loop collect every overflow candidate before the state update is emitted, so the history is trimmed back to the configured cap in a single pass.

Fixes #210

Changes

  • minitap/mobile_use/agents/summarizer/summarizer.py: dedent return await state.asanitize_update(...) to sit outside the for loop

The `return` was indented inside the `for` loop, causing
the node to exit after the first iteration and remove at most
one message per pass even when history was several messages
over MAX_MESSAGES_IN_HISTORY.

Move `return` outside the loop so every overflow candidate is
collected before the state update is emitted.

Fixes minitap-ai#210
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • rat-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0498d895-c219-4f8b-94ae-2b0a5c9820ca

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@plfavreau
plfavreau merged commit cc20e3d into minitap-ai:main Jul 9, 2026
5 of 6 checks passed
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.

[BUG] Summarizer trims only one overflow message per pass, so message history can stay above MAX_MESSAGES_IN_HISTORY

2 participants