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.

fix(memory): clarify empty profile message (#1716)

rkrkrkk0d3902733cb5
diff --git a/core/memory/runtime.py b/core/memory/runtime.py
index d7a5a0309..d4d8481e1 100644
--- a/core/memory/runtime.py
+++ b/core/memory/runtime.py
@@ -1239,10 +1239,14 @@ class MemoryRuntime:
# Derived from this request's own result. Reading it off the shared
# provider let a concurrent read for another principal decide what this
# caller was told.
- empty = isinstance(result, MemoryItems) and not result.items
+ confirmed_empty = (
+ isinstance(result, MemoryItems)
+ and not result.items
+ and not result.warnings
+ )
return {
**_result_payload(result),
- "profile_warning": "empty" if empty else None,
+ "profile_warning": "empty" if confirmed_empty else None,
}
async def list_episodes_payload(
diff --git a/tests/test_memory_runtime.py b/tests/test_memory_runtime.py
index 83af8fc7e..b7f88d8d9 100644
--- a/tests/test_memory_runtime.py
+++ b/tests/test_memory_runtime.py
@@ -12,6 +12,7 @@ from core.memory.everos import ProviderHealthSnapshot
from core.memory.processing_record import RuntimeHealthProjection, SourceObservation
from core.memory.runtime import MemoryConfig, MemoryRuntime
from core.memory.store import MemoryStore
+from core.memory.types import MemoryItems
def _runtime(tmp_path: Path) -> MemoryRuntime:
@@ -26,6 +27,37 @@ def _runtime(tmp_path: Path) -> MemoryRuntime:
)
+ ("warnings", "expected_warning"),
+ [
+ ((), "empty"),
+ (("memory_search_partial",), None),
+ ],
+)
+async def test_profile_payload_only_labels_confirmed_empty_results(
+ tmp_path: Path,
+ warnings: tuple[str, ...],
+ expected_warning: str | None,
+) -> None:
+ runtime = _runtime(tmp_path)
+
+ async def profile(**_kwargs: object) -> MemoryItems:
+ return MemoryItems(warnings=warnings)
+
+ runtime.module.profile = profile
+
+ payload = await runtime.profile_payload("owner-1", "default")
+
+ assert payload == {
+ "status": "ok",
+ "items": [],
+ "warnings": list(warnings),
+ "profile_warning": expected_warning,
+ }
+ await runtime.close()
+
+
def _write_legacy_clear_journal(store: MemoryStore, *, open_slot: object = None) -> Path:
journal = store.path.with_name("clear-journal.sqlite")
connection = sqlite3.connect(journal)
diff --git a/ui/src/components/settings/memory/MemoryProfilePanel.test.tsx b/ui/src/components/settings/memory/MemoryProfilePanel.test.tsx
index 46008eed5..2817d4cd7 100644
--- a/ui/src/components/settings/memory/MemoryProfilePanel.test.tsx
+++ b/ui/src/components/settings/memory/MemoryProfilePanel.test.tsx
@@ -112,4 +112,19 @@ describe('MemoryProfilePanel structured text', () => {
expect(await screen.findByText('memory.profile.partial')).toBeTruthy();
expect(screen.getByText('Available user profile')).toBeTruthy();
});
+
+ it('does not call a partially unread empty profile ungenerated', async () => {
+ getMemoryProfile.mockResolvedValue({
+ status: 'ok',
+ items: [],
+ warnings: ['memory_search_partial'],
+ profile_warning: 'empty',
+ });
+
+ render(<MemoryProfilePanel enabled />);
+
+ expect(await screen.findByText('memory.profile.partial')).toBeTruthy();
+ expect(screen.queryByText('memory.profile.warningEmpty')).toBeNull();
+ expect(screen.queryByText('memory.profile.empty')).toBeNull();
+ });
});
diff --git a/ui/src/components/settings/memory/MemoryProfilePanel.tsx b/ui/src/components/settings/memory/MemoryProfilePanel.tsx
index dbb5bc748..d8022895e 100644
--- a/ui/src/components/settings/memory/MemoryProfilePanel.tsx
+++ b/ui/src/components/settings/memory/MemoryProfilePanel.tsx
@@ -81,7 +81,7 @@ export const MemoryProfilePanel: React.FC<{ enabled: boolean }> = ({ enabled })
const { t } = useTranslation();
const api = useApi();
// Only a SUCCESSFUL response is the benign Provider-A case: `profile_warning:'empty'`
- // (or simply zero items) renders as the graceful "not available"/empty copy. A closed
+ // (or simply zero items) renders as the graceful empty-state copy. A closed
// failure — sidecar down, provider outage, timeout, etc. — is a real ERROR, and the
// resource surfaces it distinctly per its code.
const { data, error, loading, reload } = useMemoryResource<MemoryItemsOk>({
@@ -102,6 +102,8 @@ export const MemoryProfilePanel: React.FC<{ enabled: boolean }> = ({ enabled })
}
const items = data?.items ?? null;
+ const partial = data?.warnings.includes('memory_search_partial') ?? false;
+ const partialEmpty = partial && items !== null && items.length === 0;
return (
<div className="flex flex-col gap-3">
@@ -112,7 +114,7 @@ export const MemoryProfilePanel: React.FC<{ enabled: boolean }> = ({ enabled })
{t('memory.profile.refresh')}
</Button>
</div>
- {data?.warnings.includes('memory_search_partial') ? (
+ {partial ? (
<div className="rounded-lg border border-border bg-surface px-4 py-3 text-sm text-muted">
{t('memory.profile.partial')}
</div>
@@ -124,9 +126,9 @@ export const MemoryProfilePanel: React.FC<{ enabled: boolean }> = ({ enabled })
<Loader2 className="size-4 animate-spin" />
{t('memory.profile.loading')}
</div>
- ) : data?.profile_warning === 'empty' ? (
+ ) : partialEmpty ? null : data?.profile_warning === 'empty' ? (
<div className="rounded-2xl border border-gold/30 bg-gold/[0.06] p-6 text-center text-[13px] text-foreground">
- {t('memory.profile.warningUnavailable')}
+ {t('memory.profile.warningEmpty')}
</div>
) : !items || items.length === 0 ? (
<div className="rounded-2xl border border-dashed border-border bg-surface p-8 text-center text-sm text-muted">
diff --git a/ui/src/components/settings/memory/memoryCopyContract.test.ts b/ui/src/components/settings/memory/memoryCopyContract.test.ts
index 7836dc35c..689f1ab30 100644
--- a/ui/src/components/settings/memory/memoryCopyContract.test.ts
+++ b/ui/src/components/settings/memory/memoryCopyContract.test.ts
@@ -6,6 +6,14 @@ import zh from '../../../i18n/zh.json';
const bundles = { en, zh } as const;
describe('Memory UI copy contracts', () => {
+ it.each(['en', 'zh'] as const)('explains how an ungenerated profile will develop in %s', (language) => {
+ const emptyProfile = bundles[language].memory.profile.warningEmpty;
+ expect(emptyProfile).toMatch(language === 'en' ? /hasn't been generated yet/i : /画像尚未生成/);
+ expect(emptyProfile).toMatch(language === 'en' ? /more content/i : /积累更多内容/);
+ expect(emptyProfile).toMatch(language === 'en' ? /Avibe will try to generate/i : /Avibe 会尝试/);
+ expect(emptyProfile).not.toMatch(language === 'en' ? /provider|support/i : /提供方|支持/);
+ });
+
it.each(['en', 'zh'] as const)('names runtime recovery by user intent in %s', (language) => {
const runtimeAction = bundles[language].memory.runtimeAction;
expect(runtimeAction.retryButton).toBe(language === 'en' ? 'Retry startup' : '重试启动');
diff --git a/ui/src/i18n/en.json b/ui/src/i18n/en.json
index 1481a5194..a6c907e0c 100644
--- a/ui/src/i18n/en.json
+++ b/ui/src/i18n/en.json
@@ -4505,8 +4505,8 @@
"loading": "Loading profile…",
"empty": "No profile yet — keep chatting, then check back once messages have been processed.",
"loadFailed": "Couldn't load your profile.",
- "partial": "One profile source could not be loaded. The profile shown here may be incomplete.",
- "warningUnavailable": "A profile isn't available from this provider yet. This is expected, not an error — try Search instead, or check back later.",
+ "partial": "Some profile information could not be loaded. Refresh to try again.",
+ "warningEmpty": "Your profile hasn't been generated yet. Keep chatting with your Agent; once there's more content, Avibe will try to generate it. You can also search your existing memories.",
"disabledHint": "Enable Memory to view your profile.",
"refresh": "Refresh",
"summary": "Summary",
diff --git a/ui/src/i18n/zh.json b/ui/src/i18n/zh.json
index 65e609603..a616e15eb 100644
--- a/ui/src/i18n/zh.json
+++ b/ui/src/i18n/zh.json
@@ -4505,8 +4505,8 @@
"loading": "正在加载画像…",
"empty": "还没有画像——继续聊天,消息处理后再来看看。",
"loadFailed": "无法加载你的画像。",
- "partial": "有一个画像来源未能加载,当前显示的画像可能不完整。",
- "warningUnavailable": "该提供方暂不支持画像。这是预期行为,不是错误——可以试试搜索,或稍后再来看看。",
+ "partial": "部分画像信息未能加载,请刷新重试。",
+ "warningEmpty": "画像尚未生成。继续与 Agent 对话,积累更多内容后,Avibe 会尝试为你生成画像;你也可以先搜索已有记忆。",
"disabledHint": "启用记忆后即可查看画像。",
"refresh": "刷新",
"summary": "概览",