Creator App Tests / PR Spam Gate (push) Skipped
Frontend Tests / PR Spam Gate (push) Skipped
NPM Format (website & console) / PR Spam Gate (push) Skipped
Pre-commit Checks / PR Spam Gate (push) Skipped
QwenPaw Creator Plugin Release / check-version (push) Canceled after 0s
QwenPaw Creator Plugin Release / upload-oss (push) Canceled after 0s
Tests / PR Spam Gate (push) Skipped
CodeQL / CodeQL (python) (push) Canceled after 0s
CodeQL / CodeQL (typescript) (push) Canceled after 0s
Creator App Tests / Creator Backend Tests (push) Canceled after 0s
Creator App Tests / Creator UI Build & Tests (push) Canceled after 0s
E2E Smoke Tests / Playwright UI Smoke (push) Canceled after 0s
Frontend Tests / Detect console changes (push) Canceled after 0s
NPM Format (website & console) / website format check (push) Canceled after 0s
NPM Format (website & console) / console format check (push) Canceled after 0s
Pre-commit Checks / Pre-commit (push) Canceled after 0s
QwenPaw Data Plugin Release / check-version (push) Canceled after 0s
Tests / Detect code changes (push) Canceled after 0s
Frontend Tests / Vitest Unit Tests (push) Canceled after 0s
Frontend Tests / Frontend Summary (push) Canceled after 0s
QwenPaw Data Plugin Release / upload-oss (push) Canceled after 0s
Tests / Maintainer Approval (push) Canceled after 0s
Tests / Unit Tests - py3.11 - macos-latest (push) Canceled after 0s
Tests / Unit Tests - py3.11 - ubuntu-latest (push) Canceled after 0s
Tests / Unit Tests - py3.13 - ubuntu-latest (push) Canceled after 0s
Tests / Unit Tests - py3.11 - windows-latest (push) Canceled after 0s
Tests / Contract Tests - py3.11 - macos-latest (push) Canceled after 0s
Tests / Contract Tests - py3.11 - ubuntu-latest (push) Canceled after 0s
Tests / Contract Tests - py3.13 - ubuntu-latest (push) Canceled after 0s
Tests / Contract Tests - py3.11 - windows-latest (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - macos-latest - p0 (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - macos-latest - p1 (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - macos-latest - p2 (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - ubuntu-latest - fallback (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - ubuntu-latest - p0 (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - ubuntu-latest - p1 (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - ubuntu-latest - p2 (push) Canceled after 0s
Tests / Integrated Tests - py3.13 - ubuntu-latest - p0 (push) Canceled after 0s
Tests / Integrated Tests - py3.13 - ubuntu-latest - p1 (push) Canceled after 0s
Tests / Integrated Tests - py3.13 - ubuntu-latest - p2 (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - windows-latest - p0 (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - windows-latest - p1 (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - windows-latest - p2 (push) Canceled after 0s
Tests / Coverage Report (push) Canceled after 0s
Tests / Test Summary (push) Canceled after 0s
166 lines
4.5 KiB
Python
166 lines
4.5 KiB
Python
# -*- coding: utf-8 -*-
|
|
# pylint: disable=protected-access
|
|
"""Inbox notification policy for ReMe memory jobs."""
|
|
|
|
from types import SimpleNamespace
|
|
from unittest.mock import AsyncMock, patch
|
|
|
|
import pytest
|
|
|
|
from qwenpaw.agents.memory.reme_light_memory_manager import (
|
|
ReMeLightMemoryManager,
|
|
)
|
|
|
|
|
|
def _manager() -> ReMeLightMemoryManager:
|
|
manager = ReMeLightMemoryManager.__new__(ReMeLightMemoryManager)
|
|
manager.agent_id = "agent-1"
|
|
manager.get_memory_config = lambda: SimpleNamespace(
|
|
auto_memory_inbox_push_enabled=True,
|
|
auto_dream_inbox_push_enabled=True,
|
|
)
|
|
return manager
|
|
|
|
|
|
@pytest.mark.asyncio
|
|
@pytest.mark.parametrize(
|
|
("job_name", "response", "expected"),
|
|
[
|
|
(
|
|
"auto_memory",
|
|
SimpleNamespace(
|
|
success=True,
|
|
answer="No memory change",
|
|
metadata={"modified": False},
|
|
),
|
|
False,
|
|
),
|
|
(
|
|
"auto_memory",
|
|
SimpleNamespace(
|
|
success=True,
|
|
answer="Memory updated",
|
|
metadata={"modified": True},
|
|
),
|
|
True,
|
|
),
|
|
(
|
|
"auto_memory",
|
|
SimpleNamespace(
|
|
success=False,
|
|
answer="Memory update failed",
|
|
metadata={"modified": False},
|
|
),
|
|
True,
|
|
),
|
|
(
|
|
"auto_dream",
|
|
SimpleNamespace(
|
|
success=True,
|
|
answer="No files found",
|
|
metadata={
|
|
"modified": False,
|
|
"dream": {
|
|
"changed_paths": [],
|
|
"deleted_paths": [],
|
|
"files_scanned": 0,
|
|
},
|
|
},
|
|
),
|
|
False,
|
|
),
|
|
(
|
|
"auto_dream",
|
|
SimpleNamespace(
|
|
success=True,
|
|
answer="All files unchanged",
|
|
metadata={
|
|
"modified": False,
|
|
"dream": {
|
|
"changed_paths": ["memory/2026-08-18.md"],
|
|
"deleted_paths": [],
|
|
"files_scanned": 2,
|
|
"files_unchanged": 2,
|
|
},
|
|
},
|
|
),
|
|
False,
|
|
),
|
|
(
|
|
"auto_dream",
|
|
SimpleNamespace(
|
|
success=True,
|
|
answer="Memory organized",
|
|
metadata={
|
|
"modified": True,
|
|
"dream": {
|
|
"changed_paths": ["memory/2026-08-18.md"],
|
|
"deleted_paths": [],
|
|
},
|
|
},
|
|
),
|
|
True,
|
|
),
|
|
(
|
|
"auto_dream",
|
|
SimpleNamespace(
|
|
success=True,
|
|
answer="Memory catalog updated",
|
|
metadata={
|
|
"modified": False,
|
|
"dream": {
|
|
"changed_paths": [],
|
|
"deleted_paths": ["memory/2026-08-17.md"],
|
|
},
|
|
},
|
|
),
|
|
True,
|
|
),
|
|
(
|
|
"auto_dream",
|
|
SimpleNamespace(
|
|
success=False,
|
|
answer="Memory organization failed",
|
|
metadata={
|
|
"modified": False,
|
|
"dream": {
|
|
"changed_paths": [],
|
|
"deleted_paths": [],
|
|
},
|
|
},
|
|
),
|
|
True,
|
|
),
|
|
(
|
|
"auto_dream",
|
|
SimpleNamespace(
|
|
success=True,
|
|
answer="Result from an older ReMe version",
|
|
metadata={},
|
|
),
|
|
True,
|
|
),
|
|
],
|
|
)
|
|
async def test_memory_inbox_only_suppresses_successful_noops(
|
|
job_name,
|
|
response,
|
|
expected,
|
|
) -> None:
|
|
"""Only definitive successful no-ops should stay out of the inbox."""
|
|
manager = _manager()
|
|
|
|
with patch(
|
|
"qwenpaw.agents.memory.reme_light_memory_manager.append_inbox_event",
|
|
new_callable=AsyncMock,
|
|
return_value={"id": "event-1", "status": "success"},
|
|
) as append_event:
|
|
emitted = await manager._append_reme_job_result_to_inbox(
|
|
job_name,
|
|
response=response,
|
|
kwargs={},
|
|
)
|
|
|
|
assert emitted is expected
|
|
assert append_event.await_count == int(expected)
|