DeepTutor: Lifelong Personalized Tutoring. https://deeptutor.info/.
Python ai-agentsai-tutorclawbotcli-tooldeepresearchinteractive-learninglearningmulti-agent-systemsrag
fix(partners): preserve customized seeded personas
dajiaohuangfd6ccb08ffea
diff --git a/deeptutor/services/partners/manager.py b/deeptutor/services/partners/manager.pyindex e4879003f..de3920468 100644--- a/deeptutor/services/partners/manager.py+++ b/deeptutor/services/partners/manager.py@@ -1754,8 +1754,8 @@ the classroom.)# Verbatim texts of retired seeds (including the TutorBot-era variants).-# A library entry that still matches one of these — or that sits on a seed-# id and still mentions TutorBot — is an untouched old seed: safe to swap+# A library entry that still matches one of these on a known seed+# id is an untouched old seed: safe to swap# for the current template without losing any user writing._TUTORBOT_SEED = ("# Soul\n\nI am TutorBot, a personal learning companion.\n\n"@@ -1803,9 +1803,7 @@ _LEGACY_SOUL_ID_ALIASES = {"default-tutorbot": "companion", "default": "companiodef _is_stale_seed(entry: dict[str, str]) -> bool:content = str(entry.get("content") or "")- return content.strip() in {c.strip() for c in _SUPERSEDED_SOUL_CONTENTS} or (- "tutorbot" in content.lower()- )+ return content.strip() in {c.strip() for c in _SUPERSEDED_SOUL_CONTENTS}def _refresh_stale_default_souls(diff --git a/tests/services/partners/test_custom_seed_souls.py b/tests/services/partners/test_custom_seed_souls.pynew file mode 100644index 000000000..40f809ee4--- /dev/null+++ b/tests/services/partners/test_custom_seed_souls.py@@ -0,0 +1,22 @@+"""Legacy template refresh must retain edited text on familiar seed IDs."""++import pytest++from deeptutor.services.partners.manager import PartnerManager++[email protected]("soul_id", ["companion", "math-tutor", "default-tutorbot"])+def test_listing_preserves_custom_soul_that_mentions_tutorbot(partners_root, soul_id):+ manager = PartnerManager()+ entry = {+ "id": soul_id,+ "name": "My tutor",+ "content": "# My lesson plan\nCompare TutorBot with my custom exercises.\n",+ }+ if manager.get_soul(soul_id) is None:+ manager.create_soul(soul_id, entry["name"], entry["content"])+ else:+ manager.update_soul(soul_id, entry["name"], entry["content"])+ before = manager._souls_file.read_bytes()+ assert manager.get_soul(soul_id) == entry+ assert manager._souls_file.read_bytes() == before