Skip to content

Skip empty memory summaries in context window#26

Merged
study8677 merged 2 commits intostudy8677:mainfrom
shuofengzhang:fix-skip-empty-summary
Mar 2, 2026
Merged

Skip empty memory summaries in context window#26
study8677 merged 2 commits intostudy8677:mainfrom
shuofengzhang:fix-skip-empty-summary

Conversation

@shuofengzhang
Copy link
Contributor

What changed

  • Skip emitting a summary system message when the summarizer returns an empty string.
  • Add coverage to ensure empty summaries don't add extra context entries.

Why

  • Avoids a noisy "Previous Summary:" placeholder when there's nothing to summarize.
  • Keeps the context window focused on relevant messages.

Testing

  • ✅ .................................................................. [100%]
    =============================== warnings summary ===============================
    .venv/lib/python3.14/site-packages/google/genai/types.py:43
    /home/shuofengzhangl/.openclaw/workspace/oss_pr_workflow/repos/study8677-antigravity-workspace-template/.venv/lib/python3.14/site-packages/google/genai/types.py:43: DeprecationWarning: '_UnionGenericAlias' is deprecated and slated for removal in Python 3.17
    VersionedUnionType = Union[builtin_types.UnionType, _UnionGenericAlias]

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
66 passed, 1 warning in 2.97s

@study8677
Copy link
Owner

@shuofengzhang Thanks for the great work on this PR — the change is clear, well-scoped, and the added test coverage is especially helpful. Really appreciate it.

@study8677 study8677 merged commit cc78305 into study8677:main Mar 2, 2026
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.

2 participants