The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
fix(memory): surface All-In trigger failures in the UI instead of a success toast
Shanu06d105c18aa7
diff --git a/app/src/components/intelligence/MemorySourcesRegistry.tsx b/app/src/components/intelligence/MemorySourcesRegistry.tsxindex 825fcff04b..5b93672da4 100644--- a/app/src/components/intelligence/MemorySourcesRegistry.tsx+++ b/app/src/components/intelligence/MemorySourcesRegistry.tsx@@ -437,7 +437,28 @@ export function MemorySourcesRegistry({try {const result = await applyAllIn();setSources(result.sources);- onToast?.({ type: 'success', title: t('memorySources.allIn.success') });+ // openhuman#5820: the RPC resolves even when triggers failed, so the+ // verdict comes from the counts, not from "the call did not throw".+ // Every trigger failing (the incident: `no memory source registered`+ // x4) is an error; a partial start is a warning that names both+ // counts. Only a clean sweep is a success.+ if (result.sync_failed > 0 && result.sync_triggered === 0) {+ onToast?.({+ type: 'error',+ title: t('memorySources.allIn.allFailed'),+ message: result.sync_errors[0],+ });+ } else if (result.sync_failed > 0) {+ onToast?.({+ type: 'warning',+ title: t('memorySources.allIn.partial')+ .replace('{triggered}', String(result.sync_triggered))+ .replace('{failed}', String(result.sync_failed)),+ message: result.sync_errors[0],+ });+ } else {+ onToast?.({ type: 'success', title: t('memorySources.allIn.success') });+ }} catch (err) {onToast?.({type: 'error',diff --git a/app/src/components/intelligence/__tests__/MemorySourcesRegistry.test.tsx b/app/src/components/intelligence/__tests__/MemorySourcesRegistry.test.tsxindex ae5b23af8f..58f19a028f 100644--- a/app/src/components/intelligence/__tests__/MemorySourcesRegistry.test.tsx+++ b/app/src/components/intelligence/__tests__/MemorySourcesRegistry.test.tsx@@ -206,7 +206,12 @@ describe('MemorySourcesRegistry', () => {it('confirming All In calls applyAllIn, updates sources, and shows success toast', async () => {const updatedSrc = makeSource({ id: 'src_2', label: 'New Repo', enabled: true });- mockedApplyAllIn.mockResolvedValue({ sources: [updatedSrc], sync_triggered: 1 });+ mockedApplyAllIn.mockResolvedValue({+ sources: [updatedSrc],+ sync_triggered: 1,+ sync_failed: 0,+ sync_errors: [],+ });const { onToast } = setup();await screen.findByText('My Repo');@@ -230,6 +235,58 @@ describe('MemorySourcesRegistry', () => {});});+ it('All In with every trigger failing shows an error toast, not success (openhuman#5820)', async () => {+ const updatedSrc = makeSource({ id: 'src_2', label: 'New Repo', enabled: true });+ mockedApplyAllIn.mockResolvedValue({+ sources: [updatedSrc],+ sync_triggered: 0,+ sync_failed: 1,+ sync_errors: ['src_2: not found: no memory source registered as src_2'],+ });++ const { onToast } = setup();+ await screen.findByText('My Repo');+ fireEvent.click(screen.getByTestId('all-in-button'));+ await screen.findByText('Go All In?');+ fireEvent.click(screen.getByText('Yes'));++ await waitFor(() => {+ expect(onToast).toHaveBeenCalledWith(+ expect.objectContaining({+ type: 'error',+ message: 'src_2: not found: no memory source registered as src_2',+ })+ );+ });+ expect(onToast).not.toHaveBeenCalledWith(expect.objectContaining({ type: 'success' }));+ });++ it('All In with a partial start shows a warning naming both counts', async () => {+ const updatedSrc = makeSource({ id: 'src_2', label: 'New Repo', enabled: true });+ mockedApplyAllIn.mockResolvedValue({+ sources: [updatedSrc],+ sync_triggered: 2,+ sync_failed: 1,+ sync_errors: ['src_3: boom'],+ });++ const { onToast } = setup();+ await screen.findByText('My Repo');+ fireEvent.click(screen.getByTestId('all-in-button'));+ await screen.findByText('Go All In?');+ fireEvent.click(screen.getByText('Yes'));++ await waitFor(() => {+ expect(onToast).toHaveBeenCalledWith(+ expect.objectContaining({+ type: 'warning',+ title: 'Syncs started: 2. Could not start: 1.',+ message: 'src_3: boom',+ })+ );+ });+ });+it('All In failure shows error toast', async () => {mockedApplyAllIn.mockRejectedValue(new Error('RPC error'));diff --git a/app/src/lib/i18n/ar.ts b/app/src/lib/i18n/ar.tsindex 6ffe23c479..63de2d781c 100644--- a/app/src/lib/i18n/ar.ts+++ b/app/src/lib/i18n/ar.ts@@ -2808,6 +2808,8 @@ const messages: TranslationMap = {'memorySources.allIn.cancel': 'لا','memorySources.allIn.success': 'تم تمكين جميع المصادر بدون قيود. بدأت المزامنة.','memorySources.allIn.failed': 'تعذّر تطبيق خيار الكل. يرجى المحاولة مرة أخرى.',+ 'memorySources.allIn.allFailed': 'تعذّر بدء أي مزامنة. تحقق من كل مصدر لمعرفة السبب.',+ 'memorySources.allIn.partial': 'المزامنات التي بدأت: {triggered}. التي تعذّر بدؤها: {failed}.','memorySources.settings.button': 'الإعدادات','memorySources.settings.title': 'إعدادات المزامنة','memorySources.settings.maxPrs': 'أقصى عدد لطلبات السحب',diff --git a/app/src/lib/i18n/bn.ts b/app/src/lib/i18n/bn.tsindex f3e11708d9..04b37813d2 100644--- a/app/src/lib/i18n/bn.ts+++ b/app/src/lib/i18n/bn.ts@@ -2874,6 +2874,8 @@ const messages: TranslationMap = {'memorySources.allIn.cancel': 'না','memorySources.allIn.success': 'সব উৎস সীমা ছাড়া সক্রিয় হয়েছে। সিঙ্ক শুরু হয়েছে।','memorySources.allIn.failed': 'সব চালু করা সম্ভব হয়নি। আবার চেষ্টা করুন।',+ 'memorySources.allIn.allFailed': 'কোনো সিঙ্ক শুরু করা যায়নি। কারণ জানতে প্রতিটি উৎস দেখুন।',+ 'memorySources.allIn.partial': 'শুরু হওয়া সিঙ্ক: {triggered}। শুরু করা যায়নি: {failed}।','memorySources.settings.button': 'সেটিংস','memorySources.settings.title': 'সিঙ্ক সেটিংস','memorySources.settings.maxPrs': 'সর্বোচ্চ পুল রিকোয়েস্ট',diff --git a/app/src/lib/i18n/de.ts b/app/src/lib/i18n/de.tsindex 7d6b516097..231e6d36d9 100644--- a/app/src/lib/i18n/de.ts+++ b/app/src/lib/i18n/de.ts@@ -2952,6 +2952,8 @@ const messages: TranslationMap = {'memorySources.allIn.cancel': 'Nein','memorySources.allIn.success': 'Alle Quellen ohne Limits aktiviert. Synchronisierung gestartet.','memorySources.allIn.failed': 'Konnte „Alles aktivieren" nicht anwenden. Bitte erneut versuchen.',+ 'memorySources.allIn.allFailed': 'Keine Synchronisierung konnte gestartet werden. Prüfe jede Quelle, um den Grund zu sehen.',+ 'memorySources.allIn.partial': 'Gestartete Synchronisierungen: {triggered}. Nicht startbar: {failed}.','memorySources.settings.button': 'Einstellungen','memorySources.settings.title': 'Synchronisierungseinstellungen','memorySources.settings.maxPrs': 'Maximale Pull-Requests',diff --git a/app/src/lib/i18n/en.ts b/app/src/lib/i18n/en.tsindex 740a834939..dd3774e19a 100644--- a/app/src/lib/i18n/en.ts+++ b/app/src/lib/i18n/en.ts@@ -3122,6 +3122,8 @@ const en: TranslationMap = {'memorySources.allIn.cancel': 'No','memorySources.allIn.success': 'All sources enabled with no limits. Syncing started.','memorySources.allIn.failed': 'Could not apply All In. Please try again.',+ 'memorySources.allIn.allFailed': 'No sync could start. Check each source for the reason.',+ 'memorySources.allIn.partial': 'Syncs started: {triggered}. Could not start: {failed}.','memorySources.settings.button': 'Settings','memorySources.settings.title': 'Sync settings','memorySources.settings.maxPrs': 'Max pull requests',diff --git a/app/src/lib/i18n/es.ts b/app/src/lib/i18n/es.tsindex 3c08cf70ec..29458fad80 100644--- a/app/src/lib/i18n/es.ts+++ b/app/src/lib/i18n/es.ts@@ -2928,6 +2928,8 @@ const messages: TranslationMap = {'memorySources.allIn.success':'Todas las fuentes activadas sin límites. Sincronización iniciada.','memorySources.allIn.failed': 'No se pudo aplicar todo activo. Por favor, inténtelo de nuevo.',+ 'memorySources.allIn.allFailed': 'No se pudo iniciar ninguna sincronización. Revisa cada fuente para ver el motivo.',+ 'memorySources.allIn.partial': 'Sincronizaciones iniciadas: {triggered}. No se pudieron iniciar: {failed}.','memorySources.settings.button': 'Configuración','memorySources.settings.title': 'Configuración de sincronización','memorySources.settings.maxPrs': 'Máximo de pull requests',diff --git a/app/src/lib/i18n/fr.ts b/app/src/lib/i18n/fr.tsindex 3152a2cabc..2d4c805415 100644--- a/app/src/lib/i18n/fr.ts+++ b/app/src/lib/i18n/fr.ts@@ -2951,6 +2951,8 @@ const messages: TranslationMap = {'memorySources.allIn.success': 'Toutes les sources activées sans limite. Synchronisation lancée.','memorySources.allIn.failed': "Impossible d'appliquer tout activer. Veuillez réessayer.",'memorySources.settings.button': 'Paramètres',+ 'memorySources.allIn.allFailed': 'Aucune synchronisation n’a pu démarrer. Vérifiez chaque source pour connaître la raison.',+ 'memorySources.allIn.partial': 'Synchronisations lancées : {triggered}. Impossibles à lancer : {failed}.','memorySources.settings.title': 'Paramètres de synchronisation','memorySources.settings.maxPrs': 'Nombre maximal de pull requests','memorySources.settings.maxIssues': "Nombre maximal d'issues",diff --git a/app/src/lib/i18n/hi.ts b/app/src/lib/i18n/hi.tsindex 4d94293276..b50970e572 100644--- a/app/src/lib/i18n/hi.ts+++ b/app/src/lib/i18n/hi.ts@@ -2872,6 +2872,8 @@ const messages: TranslationMap = {'memorySources.allIn.cancel': 'नहीं','memorySources.allIn.success': 'सभी स्रोत बिना सीमा के सक्रिय हुए। सिंक शुरू हो गई।','memorySources.allIn.failed': 'सब चालू नहीं किया जा सका। कृपया पुनः प्रयास करें।',+ 'memorySources.allIn.allFailed': 'कोई भी सिंक शुरू नहीं हो सका। कारण जानने के लिए हर स्रोत को जाँचें।',+ 'memorySources.allIn.partial': 'शुरू हुए सिंक: {triggered}। शुरू नहीं हो सके: {failed}।','memorySources.settings.button': 'सेटिंग','memorySources.settings.title': 'सिंक सेटिंग','memorySources.settings.maxPrs': 'अधिकतम पुल रिक्वेस्ट',diff --git a/app/src/lib/i18n/id.ts b/app/src/lib/i18n/id.tsindex 6c0445e737..bcacfa6820 100644--- a/app/src/lib/i18n/id.ts+++ b/app/src/lib/i18n/id.ts@@ -2884,6 +2884,8 @@ const messages: TranslationMap = {'memorySources.allIn.cancel': 'Tidak','memorySources.allIn.success': 'Semua sumber diaktifkan tanpa batas. Sinkronisasi dimulai.','memorySources.allIn.failed': 'Gagal mengaktifkan semua. Silakan coba lagi.',+ 'memorySources.allIn.allFailed': 'Tidak ada sinkronisasi yang bisa dimulai. Periksa setiap sumber untuk melihat alasannya.',+ 'memorySources.allIn.partial': 'Sinkronisasi dimulai: {triggered}. Tidak bisa dimulai: {failed}.','memorySources.settings.button': 'Pengaturan','memorySources.settings.title': 'Pengaturan sinkronisasi','memorySources.settings.maxPrs': 'Maksimal pull request',diff --git a/app/src/lib/i18n/it.ts b/app/src/lib/i18n/it.tsindex c1cf636dbf..83e8bdea47 100644--- a/app/src/lib/i18n/it.ts+++ b/app/src/lib/i18n/it.ts@@ -2927,6 +2927,8 @@ const messages: TranslationMap = {'memorySources.allIn.success':'Tutte le sorgenti attivate senza limiti. Sincronizzazione avviata.','memorySources.allIn.failed': 'Impossibile attivare tutto. Riprova.',+ 'memorySources.allIn.allFailed': 'Nessuna sincronizzazione è potuta partire. Controlla ogni fonte per vedere il motivo.',+ 'memorySources.allIn.partial': 'Sincronizzazioni avviate: {triggered}. Non avviabili: {failed}.','memorySources.settings.button': 'Impostazioni','memorySources.settings.title': 'Impostazioni di sincronizzazione','memorySources.settings.maxPrs': 'Numero massimo di pull request',diff --git a/app/src/lib/i18n/ko.ts b/app/src/lib/i18n/ko.tsindex 1bed2541ca..48baee2b7f 100644--- a/app/src/lib/i18n/ko.ts+++ b/app/src/lib/i18n/ko.ts@@ -2838,6 +2838,8 @@ const messages: TranslationMap = {'memorySources.allIn.cancel': '아니오','memorySources.allIn.success': '제한 없이 모든 소스가 활성화되었습니다. 동기화가 시작되었습니다.','memorySources.allIn.failed': '전체 활성화를 적용하지 못했습니다. 다시 시도해 주세요.',+ 'memorySources.allIn.allFailed': '동기화를 하나도 시작할 수 없습니다. 각 소스에서 원인을 확인하세요.',+ 'memorySources.allIn.partial': '시작된 동기화: {triggered}. 시작하지 못함: {failed}.','memorySources.settings.button': '설정','memorySources.settings.title': '동기화 설정','memorySources.settings.maxPrs': '최대 풀 리퀘스트 수',diff --git a/app/src/lib/i18n/pl.ts b/app/src/lib/i18n/pl.tsindex 18c7f510b1..fdee06eafb 100644--- a/app/src/lib/i18n/pl.ts+++ b/app/src/lib/i18n/pl.ts@@ -2904,6 +2904,8 @@ const messages: TranslationMap = {'memorySources.allIn.success':'Wszystkie źródła włączone bez limitów. Synchronizacja uruchomiona.','memorySources.allIn.failed': 'Nie udało się włączyć wszystkiego. Spróbuj ponownie.',+ 'memorySources.allIn.allFailed': 'Nie udało się uruchomić żadnej synchronizacji. Sprawdź każde źródło, aby poznać przyczynę.',+ 'memorySources.allIn.partial': 'Uruchomione synchronizacje: {triggered}. Nie udało się uruchomić: {failed}.','memorySources.settings.button': 'Ustawienia','memorySources.settings.title': 'Ustawienia synchronizacji','memorySources.settings.maxPrs': 'Maksymalna liczba pull requestów',diff --git a/app/src/lib/i18n/pt.ts b/app/src/lib/i18n/pt.tsindex 3b615595ed..a6ee785e14 100644--- a/app/src/lib/i18n/pt.ts+++ b/app/src/lib/i18n/pt.ts@@ -2922,6 +2922,8 @@ const messages: TranslationMap = {'memorySources.allIn.cancel': 'Não','memorySources.allIn.success': 'Todas as fontes ativadas sem limites. Sincronização iniciada.','memorySources.allIn.failed': 'Não foi possível ativar tudo. Por favor, tente novamente.',+ 'memorySources.allIn.allFailed': 'Nenhuma sincronização pôde começar. Verifique cada fonte para ver o motivo.',+ 'memorySources.allIn.partial': 'Sincronizações iniciadas: {triggered}. Não foi possível iniciar: {failed}.','memorySources.settings.button': 'Configurações','memorySources.settings.title': 'Configurações de sincronização','memorySources.settings.maxPrs': 'Máximo de pull requests',diff --git a/app/src/lib/i18n/ru.ts b/app/src/lib/i18n/ru.tsindex c9aabb9ab3..a08e96810f 100644--- a/app/src/lib/i18n/ru.ts+++ b/app/src/lib/i18n/ru.ts@@ -2894,6 +2894,8 @@ const messages: TranslationMap = {'Все источники активированы без ограничений. Синхронизация запущена.','memorySources.allIn.failed':'Не удалось применить «Включить всё». Пожалуйста, попробуйте снова.',+ 'memorySources.allIn.allFailed': 'Ни одну синхронизацию не удалось запустить. Проверьте каждый источник, чтобы узнать причину.',+ 'memorySources.allIn.partial': 'Запущено синхронизаций: {triggered}. Не удалось запустить: {failed}.','memorySources.settings.button': 'Настройки','memorySources.settings.title': 'Настройки синхронизации','memorySources.settings.maxPrs': 'Максимум pull request',diff --git a/app/src/lib/i18n/zh-CN.ts b/app/src/lib/i18n/zh-CN.tsindex 14af6a186c..c2486840a8 100644--- a/app/src/lib/i18n/zh-CN.ts+++ b/app/src/lib/i18n/zh-CN.ts@@ -2720,6 +2720,8 @@ const messages: TranslationMap = {'memorySources.allIn.cancel': '否','memorySources.allIn.success': '所有来源已无限制启用。同步已开始。','memorySources.allIn.failed': '无法应用全部启用。请重试。',+ 'memorySources.allIn.allFailed': '没有任何同步能够开始。请检查每个来源以了解原因。',+ 'memorySources.allIn.partial': '已开始同步:{triggered}。无法开始:{failed}。','memorySources.settings.button': '设置','memorySources.settings.title': '同步设置','memorySources.settings.maxPrs': '最大拉取请求数',diff --git a/app/src/services/memorySourcesService.test.ts b/app/src/services/memorySourcesService.test.tsindex dd2d0afd26..a899c85ea9 100644--- a/app/src/services/memorySourcesService.test.ts+++ b/app/src/services/memorySourcesService.test.ts@@ -148,6 +148,24 @@ describe('memorySourcesService', () => {expect(result.sources[0].id).toBe('src_1');});+ it('applyAllIn normalises the #5820 failure fields for cores that omit them', async () => {+ mockedCall.mockResolvedValueOnce({+ result: { sources: [], sync_triggered: 0 },+ logs: [],+ } as never);+ const legacy = await applyAllIn();+ expect(legacy.sync_failed).toBe(0);+ expect(legacy.sync_errors).toEqual([]);++ mockedCall.mockResolvedValueOnce({+ result: { sources: [], sync_triggered: 0, sync_failed: 2, sync_errors: ['a: x', 'b: y'] },+ logs: [],+ } as never);+ const failed = await applyAllIn();+ expect(failed.sync_failed).toBe(2);+ expect(failed.sync_errors).toEqual(['a: x', 'b: y']);+ });+it('applyAllIn handles envelope-wrapped response', async () => {mockedCall.mockResolvedValue({ result: { sources: [], sync_triggered: 0 }, logs: [] } as never);diff --git a/app/src/services/memorySourcesService.ts b/app/src/services/memorySourcesService.tsindex 31a694c8bc..0177b43ccd 100644--- a/app/src/services/memorySourcesService.ts+++ b/app/src/services/memorySourcesService.ts@@ -185,6 +185,15 @@ export async function getSupportedToolkits(): Promise<string[]> {export interface ApplyAllInResult {sources: MemorySourceEntry[];sync_triggered: number;+ /**+ * Enabled sources whose sync trigger failed (openhuman#5820). Older cores+ * omit it; the service normalises absence to `0`, so a caller can always+ * read it. `sync_triggered === 0 && sync_failed > 0` is the "nothing+ * started" outcome the toast must not report as success.+ */+ sync_failed: number;+ /** One `<source_id>: <error>` line per failed trigger. */+ sync_errors: string[];}/**@@ -198,7 +207,12 @@ export async function applyAllIn(): Promise<ApplyAllInResult> {method: 'openhuman.memory_sources_apply_all_in',});const data = unwrap<ApplyAllInResult>(resp);- return { sources: data.sources ?? [], sync_triggered: data.sync_triggered ?? 0 };+ return {+ sources: data.sources ?? [],+ sync_triggered: data.sync_triggered ?? 0,+ sync_failed: data.sync_failed ?? 0,+ sync_errors: data.sync_errors ?? [],+ };}export interface CodingSessionSourceStatus {diff --git a/src/openhuman/memory/sources/schemas.rs b/src/openhuman/memory/sources/schemas.rsindex 8ac0a80ad8..902ea66b98 100644--- a/src/openhuman/memory/sources/schemas.rs+++ b/src/openhuman/memory/sources/schemas.rs@@ -594,6 +594,18 @@ pub fn schemas(function: &str) -> ControllerSchema {comment: "Number of sync tasks spawned.",required: true,},+ FieldSchema {+ name: "sync_failed",+ ty: TypeSchema::U64,+ comment: "Number of enabled sources whose sync trigger failed (openhuman#5820).",+ required: true,+ },+ FieldSchema {+ name: "sync_errors",+ ty: TypeSchema::Array(Box::new(TypeSchema::String)),+ comment: "One `<source_id>: <error>` line per failed trigger; absent when none failed.",+ required: false,+ },],},"coding_session_status" => ControllerSchema {