From 5bbcdced0f6a78dfd94ce3b0ad5df84211ea811b Mon Sep 17 00:00:00 2001 From: Yufeng He <40085740+he-yufeng@users.noreply.github.com> Date: Tue, 19 May 2026 09:38:55 +0800 Subject: [PATCH 1/3] fix: skip empty llm summaries (#8195) --- astrbot/core/agent/context/compressor.py | 6 +++++- tests/agent/test_context_manager.py | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/astrbot/core/agent/context/compressor.py b/astrbot/core/agent/context/compressor.py index 31a0b0b48..d4642bc50 100644 --- a/astrbot/core/agent/context/compressor.py +++ b/astrbot/core/agent/context/compressor.py @@ -218,11 +218,15 @@ class LLMSummaryCompressor: # generate summary try: response = await self.provider.text_chat(contexts=llm_payload) - summary_content = response.completion_text + summary_content = (response.completion_text or "").strip() except Exception as e: logger.error(f"Failed to generate summary: {e}") return messages + if not summary_content: + logger.warning("LLM context compression returned an empty summary.") + return messages + # build result result = [] result.extend(system_messages) diff --git a/tests/agent/test_context_manager.py b/tests/agent/test_context_manager.py index 0b955ff40..1685947b0 100644 --- a/tests/agent/test_context_manager.py +++ b/tests/agent/test_context_manager.py @@ -94,6 +94,25 @@ class TestContextManager: assert isinstance(manager.compressor, TruncateByTurnsCompressor) + @pytest.mark.asyncio + async def test_llm_compressor_keeps_history_when_summary_is_empty(self): + from astrbot.core.agent.context.compressor import LLMSummaryCompressor + + provider = MockProvider() + provider.text_chat = AsyncMock( + return_value=LLMResponse(role="assistant", completion_text=" ") + ) + compressor = LLMSummaryCompressor(provider=provider, keep_recent=2) # type: ignore[arg-type] + messages = self.create_messages(6) + + with patch("astrbot.core.agent.context.compressor.logger") as mock_logger: + result = await compressor(messages) + + assert result == messages + mock_logger.warning.assert_called_once_with( + "LLM context compression returned an empty summary." + ) + # ==================== Empty and Edge Cases ==================== @pytest.mark.asyncio From de0a7afdcf7056d58c5f3046592e60e1d6f53449 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 May 2026 13:21:03 +0900 Subject: [PATCH 2/3] chore(deps): bump pnpm/action-setup in the github-actions group (#8233) Bumps the github-actions group with 1 update: [pnpm/action-setup](https://github.com/pnpm/action-setup). Updates `pnpm/action-setup` from 6.0.7 to 6.0.8 - [Release notes](https://github.com/pnpm/action-setup/releases) - [Commits](https://github.com/pnpm/action-setup/compare/v6.0.7...v6.0.8) --- updated-dependencies: - dependency-name: pnpm/action-setup dependency-version: 6.0.8 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build-docs.yml | 2 +- .github/workflows/dashboard_ci.yml | 2 +- .github/workflows/release.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 54cf0779f..54ce79f9e 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -13,7 +13,7 @@ jobs: - name: checkout uses: actions/checkout@v6 - name: Setup pnpm - uses: pnpm/action-setup@v6.0.7 + uses: pnpm/action-setup@v6.0.8 with: version: 10.28.2 - name: Setup Node.js diff --git a/.github/workflows/dashboard_ci.yml b/.github/workflows/dashboard_ci.yml index 385fa46d8..15147c9b3 100644 --- a/.github/workflows/dashboard_ci.yml +++ b/.github/workflows/dashboard_ci.yml @@ -15,7 +15,7 @@ jobs: uses: actions/checkout@v6 - name: Setup pnpm - uses: pnpm/action-setup@v6.0.7 + uses: pnpm/action-setup@v6.0.8 with: version: 10.28.2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f422444c7..64f45e93a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,7 +51,7 @@ jobs: echo "tag=$tag" >> "$GITHUB_OUTPUT" - name: Setup pnpm - uses: pnpm/action-setup@v6.0.7 + uses: pnpm/action-setup@v6.0.8 with: version: 10.28.2 From 7a9fb33dd9e10d1cff71da884882ff1fd3018d8f Mon Sep 17 00:00:00 2001 From: Jianyu Li Date: Tue, 19 May 2026 14:41:58 +0800 Subject: [PATCH 3/3] docs: fix typo of the count in FAQ deletion instructions (#8235) Correct the number of fields to be deleted from five to six in the instructions. --- docs/zh/faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/zh/faq.md b/docs/zh/faq.md index e7a230b07..73b2de16e 100644 --- a/docs/zh/faq.md +++ b/docs/zh/faq.md @@ -51,7 +51,7 @@ Set dashboard.host in data/cmd_config.json to enable remote access. }, ``` -删除 `username`, `password`, `pbkdf2_password`, `password_storage_upgraded`, `password_change_required`, `jwt_secret` 五个字段(连同值一起),然后保存。上述片段修改类似如下: +删除 `username`, `password`, `pbkdf2_password`, `password_storage_upgraded`, `password_change_required`, `jwt_secret` 六个字段(连同值一起),然后保存。上述片段修改类似如下: ```json