7f2f29ebc8
After SmartAssistant 2.10.0 introduced UserProfile and AssistantSkill entities, the Python side kept writing only to the filesystem. So an admin browsing the EspoCRM UI saw nothing — but the system prompt did pull from CRM via context['userProfile'] / context['availableSkills']. Result: edits made by Shira (via update_user_profile / skill_manage tool) were invisible to admins; edits made by admins took effect immediately because the prompt fetched from DB. Now the two sources agree. * memory.py — added _sync_user_profile_to_crm() that upserts a UserProfile row whenever update_user_profile writes the file. Best-effort with logging; HTTP failures don't break the tool. * skills.py — added _sync_skill_to_crm() that upserts an AssistantSkill row from the SKILL.md frontmatter (description, triggers, version) plus the full body in content. Called after every save_skill in skill_manage. Read path is unchanged: the EspoCRM CaseContextBuilder / SmartAssistantService populate context fields, and the Python prompt_builder consumes them with in-code defaults as a fallback. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>