Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

feat(prompt): organize preference notes by user

cyhf6de9ae9ed82
diff --git a/config/paths.py b/config/paths.py
index 23356c828..801a0aa5e 100644
--- a/config/paths.py
+++ b/config/paths.py
@@ -63,21 +63,18 @@ def get_user_preferences_path() -> Path:
_USER_PREFERENCES_TEMPLATE = """# User Preferences
-Use this file for stable user-specific habits, preferences, and recurring rules.
+Use this file for stable long-term habits, preferences, and recurring rules.
+Prefer user-specific notes under `## Users`.
+Only put rules under `## Shared` when they truly apply across users.
Keep it concise, factual, and deduplicated.
Do not store secrets here unless the user explicitly asks.
-## Communication
-- Add stable communication preferences here.
+## Shared
+- Add rules here only when they truly apply across users.
-## Engineering Habits
-- Add stable workflow preferences here.
-
-## Project Rules
-- Add recurring project or repo rules here.
-
-## Avoid
-- Add stable things to avoid here.
+## Users
+### platform/user_id
+- Add stable preferences for this user here.
"""
diff --git a/core/reply_enhancer.py b/core/reply_enhancer.py
index 4e4407611..0e18c840e 100644
--- a/core/reply_enhancer.py
+++ b/core/reply_enhancer.py
@@ -218,8 +218,9 @@ _USER_PREFERENCES_PROMPT = """\
## 5. User preference file
A shared user preference file is available at `{preferences_path}`.
-When useful, you may read it to learn the user's stable habits, preferences, and recurring rules.
-You may also update it as you learn durable preferences from repeated interactions.
+When useful, you may read it to learn stable habits, preferences, and recurring rules.
+You may also update it, usually in the current user's section: `{user_section}`.
+Only write to a shared section when a rule truly applies across users.
Keep it short, factual, deduplicated, and free of secrets unless the user explicitly asks.
"""
@@ -244,6 +245,23 @@ def _build_scheduled_tasks_prompt(context: MessageContext, *, fallback_platform:
)
+def _build_user_preferences_prompt(
+ context: Optional[MessageContext],
+ *,
+ fallback_platform: Optional[str] = None,
+) -> str:
+ platform = fallback_platform
+ user_id = "<user_id>"
+ if context is not None:
+ platform = context.platform or context.platform_specific.get("platform") or fallback_platform
+ user_id = context.user_id or "<user_id>"
+ user_section = f"{platform or '<platform>'}/{user_id}"
+ return _USER_PREFERENCES_PROMPT.format(
+ preferences_path=f"`{paths.get_user_preferences_path()}`",
+ user_section=user_section,
+ )
+
+
def build_reply_enhancements_prompt(
*,
include_quick_replies: bool = True,
@@ -258,7 +276,7 @@ def build_reply_enhancements_prompt(
if context is not None:
prompt += _build_scheduled_tasks_prompt(context, fallback_platform=fallback_platform)
prompt += _VIBE_SKILL_PROMPT
- prompt += _USER_PREFERENCES_PROMPT.format(preferences_path=f"`{paths.get_user_preferences_path()}`")
+ prompt += _build_user_preferences_prompt(context, fallback_platform=fallback_platform)
return prompt
diff --git a/skills/use-vibe-remote/SKILL.md b/skills/use-vibe-remote/SKILL.md
index 5fa6ce180..0e14757c3 100644
--- a/skills/use-vibe-remote/SKILL.md
+++ b/skills/use-vibe-remote/SKILL.md
@@ -2,7 +2,7 @@
name: use-vibe-remote
slug: use-vibe-remote
description: Safely inspect and modify local Vibe Remote configuration, routing, runtime settings, scheduled tasks, and operational state.
-version: 0.1.4
+version: 0.1.5
---
# Use Vibe Remote
@@ -43,7 +43,7 @@ Important paths:
- `~/.vibe_remote/config/config.json`: global config
- `~/.vibe_remote/state/settings.json`: per-channel and per-user overrides
- `~/.vibe_remote/state/scheduled_tasks.json`: persisted scheduled tasks
-- `~/.vibe_remote/state/user_preferences.md`: stable user habits, preferences, and recurring rules
+- `~/.vibe_remote/state/user_preferences.md`: shared long-term preference file; prefer user-specific notes under `platform/user_id` sections and keep shared rules truly cross-user
- `~/.vibe_remote/state/sessions.json`: runtime session state
- `~/.vibe_remote/logs/vibe_remote.log`: main application log
- `~/.vibe_remote/runtime/status.json`: runtime status file
diff --git a/tests/test_reply_enhancer_platform.py b/tests/test_reply_enhancer_platform.py
index 94bc72604..f4b49be43 100644
--- a/tests/test_reply_enhancer_platform.py
+++ b/tests/test_reply_enhancer_platform.py
@@ -71,6 +71,7 @@ class ReplyEnhancerPlatformTests(unittest.IsolatedAsyncioTestCase):
self.assertIn("https://github.com/cyhhao/vibe-remote/raw/master/skills/use-vibe-remote/SKILL.md", prompt)
self.assertIn("## 5. User preference file", prompt)
self.assertIn("`/tmp/user_preferences.md`", prompt)
+ self.assertIn("`<platform>/<user_id>`", prompt)
def test_prompt_includes_scheduled_task_usage_with_threadless_default_session_key(self):
context = MessageContext(
@@ -91,7 +92,9 @@ class ReplyEnhancerPlatformTests(unittest.IsolatedAsyncioTestCase):
self.assertIn("slack::channel::C1::thread::171717.123", prompt)
self.assertIn("If `--timezone` is omitted, the task uses the local system timezone at creation time.", prompt)
self.assertIn("https://github.com/cyhhao/vibe-remote/raw/master/skills/use-vibe-remote/SKILL.md", prompt)
- self.assertIn("When useful, you may read it to learn the user's stable habits, preferences, and recurring rules.", prompt)
+ self.assertIn("When useful, you may read it to learn stable habits, preferences, and recurring rules.", prompt)
+ self.assertIn("usually in the current user's section: `slack/U1`.", prompt)
+ self.assertIn("Only write to a shared section when a rule truly applies across users.", prompt)
self.assertIn("Keep it short, factual, deduplicated, and free of secrets unless the user explicitly asks.", prompt)
def test_prompt_uses_fallback_platform_for_unannotated_context(self):
@@ -110,6 +113,7 @@ class ReplyEnhancerPlatformTests(unittest.IsolatedAsyncioTestCase):
)
self.assertIn("Default session key: `slack::channel::C1`", prompt)
+ self.assertIn("usually in the current user's section: `slack/U1`.", prompt)
def test_file_links_with_parentheses_are_preserved(self):
enhanced = process_reply("![video](file:///Users/test/SaveTwitter.Net_GABV3XNWYAARAZz(gif).mp4)")
diff --git a/tests/test_v2_paths.py b/tests/test_v2_paths.py
index 42a5aa3ed..1b5a7fc54 100644
--- a/tests/test_v2_paths.py
+++ b/tests/test_v2_paths.py
@@ -22,4 +22,6 @@ def test_ensure_data_dirs(tmp_path, monkeypatch):
assert preferences_path.exists()
text = preferences_path.read_text(encoding="utf-8")
assert "# User Preferences" in text
+ assert "Prefer user-specific notes under `## Users`." in text
+ assert "### platform/user_id" in text
assert "Do not store secrets here unless the user explicitly asks." in text