Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(memory): suppress only deadlines the core itself reported, and drop the plural trap\n\nReview follow-up on #5803.\n\n## Only a core-reported deadline is evidence of running work\n\nCodex was right, and this was a real hole in the fix rather than a nitpick.\n`isIngestTimeout` matched any `timed out after Nms` plus a duck-typed\n`kind === 'timeout'`. Both admit cases where nothing is running:\n\n - The renderer's own AbortController fires as\n `Core RPC <method> timed out after 585000ms` with `kind: 'timeout'`. It\n proves the client stopped waiting and nothing more; a wedged, overloaded or\n absent core is indistinguishable from one happily distilling sessions.\n - A bare phrase like `request timed out after 30s` from an ordinary provider\n failure matched too.\n\nSuppressing either shows "still running" over work that stopped - the same\nfalse-reporting defect this PR exists to remove, with the sign flipped, and the\nworse direction: a false "failed" is recoverable because the next status poll\nshows what landed, a false "still running" is not.\n\nThe predicate now requires the `ingest coding sessions: ` prefix, which only\n`ingest_coding_sessions_rpc` adds, around both of its deadline paths. A message\ncarrying it can only have been produced inside that handler, which proves the\ncore received the request and started the call. The `kind` check is gone\nentirely - it was precisely the renderer signal that must not be suppressed.\n\nNew test asserts a renderer abort still rejects; the predicate test now pins\nboth directions, including `{ kind: 'timeout' }` alone being insufficient.\nRevert-checked: restoring the old predicate fails both.\n\n## Plurals\n\n`Foram importadas 1 sessões` was wrong, and a singular/plural pair would only\nhave moved the problem: ru and pl need three forms, ar six, so `1 vs many`\nwould still misrender `2 сессии` against `5 сессий`. There is no\n`Intl.PluralRules` layer in this repo to hang a real rule on.\n\nReworded so the count never sits against an inflected noun - "Sessions imported\nso far: {processed}." - which is correct in all fourteen locales and needs no\ninfrastructure. Applied to every locale, not only pt.\n\nNote: the pre-existing `completeMessage` / `stoppedMessage` / `partialFailure`\nstrings have the same shape. Left alone here - this PR does not otherwise touch\nthem, and fixing them is a separate pass.\n\n## Verification\n\n71 files / 649 tests passing; typecheck 0; lint 0 errors; i18n:check 0 missing\n0 extra; i18n:english:check clean; prettier clean.\n\nRefs tinyhumansai/openhuman#5802\n

M3gA-Mind0e5cad94c4e7
diff --git a/app/src/components/intelligence/__tests__/CodingSessionsCard.test.tsx b/app/src/components/intelligence/__tests__/CodingSessionsCard.test.tsx
index ec41be6470..9ba2be2c9d 100644
--- a/app/src/components/intelligence/__tests__/CodingSessionsCard.test.tsx
+++ b/app/src/components/intelligence/__tests__/CodingSessionsCard.test.tsx
@@ -223,7 +223,7 @@ describe('CodingSessionsCard', () => {
expect.objectContaining({
type: 'info',
title: 'Import still running',
- message: expect.stringContaining('Imported 3 sessions so far'),
+ message: expect.stringContaining('Sessions imported so far: 3'),
})
)
);
diff --git a/app/src/lib/i18n/ar.ts b/app/src/lib/i18n/ar.ts
index bca0afed3f..86585e2338 100644
--- a/app/src/lib/i18n/ar.ts
+++ b/app/src/lib/i18n/ar.ts
@@ -6658,7 +6658,7 @@ const messages: TranslationMap = {
'فشلت {failed} جلسات بينما تمت معالجة {processed}. شغّل الاستيعاب مرة أخرى لإعادة المحاولة.',
'memorySources.codingSessions.stillRunning': 'الاستيراد ما زال جاريًا',
'memorySources.codingSessions.stillRunningMessage':
- 'تم استيراد {processed} جلسة حتى الآن. لم ينتهِ الاستيراد ضمن المهلة المحددة لكنه ما زال يعمل في الخلفية؛ تحقق مرة أخرى بعد دقيقة بدلًا من بدئه من جديد.',
+ 'عدد الجلسات المستوردة حتى الآن: {processed}. لم ينتهِ الاستيراد ضمن المهلة المحددة لكنه ما زال يعمل في الخلفية؛ تحقق مرة أخرى بعد دقيقة بدلًا من بدئه من جديد.',
'memorySources.codingSessions.failed': 'فشل استيعاب جلسات البرمجة',
'flows.canvas.sidePanelToggle': 'اللوحة الجانبية',
'flows.canvas.legendTab': 'يدوي',
diff --git a/app/src/lib/i18n/bn.ts b/app/src/lib/i18n/bn.ts
index eff8e979f5..71ca7a7e84 100644
--- a/app/src/lib/i18n/bn.ts
+++ b/app/src/lib/i18n/bn.ts
@@ -6813,7 +6813,7 @@ const messages: TranslationMap = {
'{processed}টি সেশন প্রক্রিয়া করার সময় {failed}টি ব্যর্থ হয়েছে। আবার চেষ্টা করতে গ্রহণ পুনরায় চালান।',
'memorySources.codingSessions.stillRunning': 'ইম্পোর্ট এখনও চলছে',
'memorySources.codingSessions.stillRunningMessage':
- 'এখন পর্যন্ত {processed}টি সেশন ইম্পোর্ট হয়েছে। নির্ধারিত সময়ের মধ্যে ইম্পোর্ট শেষ হয়নি, তবে সেটি ব্যাকগ্রাউন্ডে চলছে; আবার শুরু না করে এক মিনিট পরে দেখুন।',
+ 'এখন পর্যন্ত ইম্পোর্ট হওয়া সেশন: {processed}টি। নির্ধারিত সময়ের মধ্যে ইম্পোর্ট শেষ হয়নি, তবে সেটি ব্যাকগ্রাউন্ডে চলছে; আবার শুরু না করে এক মিনিট পরে দেখুন।',
'memorySources.codingSessions.failed': 'কোডিং সেশন গ্রহণ ব্যর্থ হয়েছে',
'flows.canvas.sidePanelToggle': 'সাইড প্যানেল',
'flows.canvas.legendTab': 'ম্যানুয়াল',
diff --git a/app/src/lib/i18n/de.ts b/app/src/lib/i18n/de.ts
index 21fb43d122..ee6c90c284 100644
--- a/app/src/lib/i18n/de.ts
+++ b/app/src/lib/i18n/de.ts
@@ -6998,7 +6998,7 @@ const messages: TranslationMap = {
'{failed} Sitzungen sind fehlgeschlagen, während {processed} verarbeitet wurden. Starten Sie das Einlesen erneut.',
'memorySources.codingSessions.stillRunning': 'Import läuft noch',
'memorySources.codingSessions.stillRunningMessage':
- 'Bisher wurden {processed} Sitzungen importiert. Der Import wurde nicht innerhalb seines Zeitbudgets fertig, läuft aber im Hintergrund weiter. Schauen Sie in einer Minute noch einmal nach, statt ihn neu zu starten.',
+ 'Bisher importierte Sitzungen: {processed}. Der Import wurde nicht innerhalb seines Zeitbudgets fertig, läuft aber im Hintergrund weiter. Schauen Sie in einer Minute noch einmal nach, statt ihn neu zu starten.',
'memorySources.codingSessions.failed': 'Einlesen der Coding-Sitzungen fehlgeschlagen',
'flows.canvas.sidePanelToggle': 'Seitenleiste',
'flows.canvas.legendTab': 'Manuell',
diff --git a/app/src/lib/i18n/en.ts b/app/src/lib/i18n/en.ts
index 9157ef82a8..c12e6f8d93 100644
--- a/app/src/lib/i18n/en.ts
+++ b/app/src/lib/i18n/en.ts
@@ -7195,7 +7195,7 @@ const en: TranslationMap = {
'{failed} sessions failed while {processed} were processed. Run ingestion again to retry them.',
'memorySources.codingSessions.stillRunning': 'Import still running',
'memorySources.codingSessions.stillRunningMessage':
- 'Imported {processed} sessions so far. The import did not finish inside its time budget but is still running in the background; check back in a minute rather than starting it again.',
+ 'Sessions imported so far: {processed}. The import did not finish inside its time budget but is still running in the background; check back in a minute rather than starting it again.',
'memorySources.codingSessions.failed': 'Coding-session ingestion failed',
'notifications.configRecovered.title': 'Settings file recovered',
'notifications.configRecovered.body':
diff --git a/app/src/lib/i18n/es.ts b/app/src/lib/i18n/es.ts
index 6febc23023..2cd4017898 100644
--- a/app/src/lib/i18n/es.ts
+++ b/app/src/lib/i18n/es.ts
@@ -6956,7 +6956,7 @@ const messages: TranslationMap = {
'Fallaron {failed} sesiones mientras se procesaron {processed}. Ejecuta la ingesta de nuevo para reintentarlas.',
'memorySources.codingSessions.stillRunning': 'La importación sigue en curso',
'memorySources.codingSessions.stillRunningMessage':
- 'Se han importado {processed} sesiones hasta ahora. La importación no terminó dentro de su tiempo asignado, pero sigue ejecutándose en segundo plano; vuelve a comprobarlo en un minuto en lugar de iniciarla otra vez.',
+ 'Sesiones importadas hasta ahora: {processed}. La importación no terminó dentro de su tiempo asignado, pero sigue ejecutándose en segundo plano; vuelve a comprobarlo en un minuto en lugar de iniciarla otra vez.',
'memorySources.codingSessions.failed': 'Falló la ingesta de sesiones de programación',
'flows.canvas.sidePanelToggle': 'Panel lateral',
'flows.canvas.legendTab': 'Manual',
diff --git a/app/src/lib/i18n/fr.ts b/app/src/lib/i18n/fr.ts
index 97c30e94d9..85cd0141be 100644
--- a/app/src/lib/i18n/fr.ts
+++ b/app/src/lib/i18n/fr.ts
@@ -6983,7 +6983,7 @@ const messages: TranslationMap = {
'{failed} sessions ont échoué tandis que {processed} ont été traitées. Relancez l’ingestion pour réessayer.',
'memorySources.codingSessions.stillRunning': 'Import toujours en cours',
'memorySources.codingSessions.stillRunningMessage':
- "{processed} sessions importées jusqu'ici. L'import n'a pas abouti dans le temps imparti mais continue en arrière-plan ; revenez dans une minute plutôt que de le relancer.",
+ "Sessions importées jusqu'ici : {processed}. L'import n'a pas abouti dans le temps imparti mais continue en arrière-plan ; revenez dans une minute plutôt que de le relancer.",
'memorySources.codingSessions.failed': 'Échec de l’ingestion des sessions de programmation',
'flows.canvas.sidePanelToggle': 'Panneau latéral',
'flows.canvas.legendTab': 'Manuel',
diff --git a/app/src/lib/i18n/hi.ts b/app/src/lib/i18n/hi.ts
index ba57cb00cc..0ff716e6c9 100644
--- a/app/src/lib/i18n/hi.ts
+++ b/app/src/lib/i18n/hi.ts
@@ -6809,7 +6809,7 @@ const messages: TranslationMap = {
'{processed} सत्र संसाधित हुए, जबकि {failed} विफल रहे। दोबारा प्रयास करने के लिए अंतर्ग्रहण फिर चलाएँ।',
'memorySources.codingSessions.stillRunning': 'आयात अब भी चल रहा है',
'memorySources.codingSessions.stillRunningMessage':
- 'अब तक {processed} सत्र आयात हुए हैं। आयात अपनी समय सीमा में पूरा नहीं हुआ, लेकिन पृष्ठभूमि में चल रहा है; इसे दोबारा शुरू करने के बजाय एक मिनट बाद देखें।',
+ 'अब तक आयात किए गए सत्र: {processed}. आयात अपनी समय सीमा में पूरा नहीं हुआ, लेकिन पृष्ठभूमि में चल रहा है; इसे दोबारा शुरू करने के बजाय एक मिनट बाद देखें।',
'memorySources.codingSessions.failed': 'कोडिंग सत्र शामिल करना विफल रहा',
'flows.canvas.sidePanelToggle': 'साइड पैनल',
'flows.canvas.legendTab': 'मैनुअल',
diff --git a/app/src/lib/i18n/id.ts b/app/src/lib/i18n/id.ts
index 27ec8671a3..00bdd8f9b1 100644
--- a/app/src/lib/i18n/id.ts
+++ b/app/src/lib/i18n/id.ts
@@ -6844,7 +6844,7 @@ const messages: TranslationMap = {
'{failed} sesi gagal sementara {processed} berhasil diproses. Jalankan penyerapan lagi untuk mencoba ulang.',
'memorySources.codingSessions.stillRunning': 'Impor masih berjalan',
'memorySources.codingSessions.stillRunningMessage':
- 'Sejauh ini {processed} sesi telah diimpor. Impor belum selesai dalam batas waktunya tetapi masih berjalan di latar belakang; periksa lagi sebentar lagi daripada memulainya ulang.',
+ 'Sesi yang sudah diimpor: {processed}. Impor belum selesai dalam batas waktunya tetapi masih berjalan di latar belakang; periksa lagi sebentar lagi daripada memulainya ulang.',
'memorySources.codingSessions.failed': 'Gagal menyerap sesi pemrograman',
'flows.canvas.sidePanelToggle': 'Panel samping',
'flows.canvas.legendTab': 'Manual',
diff --git a/app/src/lib/i18n/it.ts b/app/src/lib/i18n/it.ts
index 66ba6d2e3e..d966b4fd77 100644
--- a/app/src/lib/i18n/it.ts
+++ b/app/src/lib/i18n/it.ts
@@ -6939,7 +6939,7 @@ const messages: TranslationMap = {
'{failed} sessioni non sono riuscite mentre {processed} sono state elaborate. Avvia di nuovo l’acquisizione per riprovare.',
'memorySources.codingSessions.stillRunning': 'Importazione ancora in corso',
'memorySources.codingSessions.stillRunningMessage':
- "Finora sono state importate {processed} sessioni. L'importazione non si è conclusa entro il tempo previsto ma prosegue in background; ricontrolla tra un minuto invece di avviarla di nuovo.",
+ "Sessioni importate finora: {processed}. L'importazione non si è conclusa entro il tempo previsto ma prosegue in background; ricontrolla tra un minuto invece di avviarla di nuovo.",
'memorySources.codingSessions.failed':
'Acquisizione delle sessioni di programmazione non riuscita',
'flows.canvas.sidePanelToggle': 'Pannello laterale',
diff --git a/app/src/lib/i18n/ko.ts b/app/src/lib/i18n/ko.ts
index 28a4673069..406060c7df 100644
--- a/app/src/lib/i18n/ko.ts
+++ b/app/src/lib/i18n/ko.ts
@@ -6734,7 +6734,7 @@ const messages: TranslationMap = {
'세션 {processed}개를 처리하는 동안 {failed}개가 실패했습니다. 다시 시도하려면 수집을 다시 실행하세요.',
'memorySources.codingSessions.stillRunning': '가져오기가 아직 진행 중입니다',
'memorySources.codingSessions.stillRunningMessage':
- '지금까지 {processed}개의 세션을 가져왔습니다. 제한 시간 안에 끝나지 않았지만 백그라운드에서 계속 실행 중입니다. 다시 시작하지 말고 잠시 후 확인하세요.',
+ '지금까지 가져온 세션: {processed}개. 제한 시간 안에 끝나지 않았지만 백그라운드에서 계속 실행 중입니다. 다시 시작하지 말고 잠시 후 확인하세요.',
'memorySources.codingSessions.failed': '코딩 세션 수집 실패',
'flows.canvas.sidePanelToggle': '사이드 패널',
'flows.canvas.legendTab': '수동',
diff --git a/app/src/lib/i18n/pl.ts b/app/src/lib/i18n/pl.ts
index 104833f0ed..c0fb43670d 100644
--- a/app/src/lib/i18n/pl.ts
+++ b/app/src/lib/i18n/pl.ts
@@ -6910,7 +6910,7 @@ const messages: TranslationMap = {
'Nie udało się przetworzyć {failed} sesji, a {processed} przetworzono. Uruchom import ponownie, aby spróbować jeszcze raz.',
'memorySources.codingSessions.stillRunning': 'Import wciąż trwa',
'memorySources.codingSessions.stillRunningMessage':
- 'Zaimportowano dotąd {processed} sesji. Import nie zakończył się w wyznaczonym czasie, ale nadal działa w tle; sprawdź ponownie za minutę, zamiast uruchamiać go od nowa.',
+ 'Zaimportowane dotąd sesje: {processed}. Import nie zakończył się w wyznaczonym czasie, ale nadal działa w tle; sprawdź ponownie za minutę, zamiast uruchamiać go od nowa.',
'memorySources.codingSessions.failed': 'Nie udało się wczytać sesji programistycznych',
'flows.canvas.sidePanelToggle': 'Panel boczny',
'flows.canvas.legendTab': 'Ręczny',
diff --git a/app/src/lib/i18n/pt.ts b/app/src/lib/i18n/pt.ts
index 2be0ed5ecb..540d283950 100644
--- a/app/src/lib/i18n/pt.ts
+++ b/app/src/lib/i18n/pt.ts
@@ -6923,7 +6923,7 @@ const messages: TranslationMap = {
'{failed} sessões falharam enquanto {processed} foram processadas. Execute a ingestão novamente para tentar de novo.',
'memorySources.codingSessions.stillRunning': 'Importação ainda em andamento',
'memorySources.codingSessions.stillRunningMessage':
- 'Foram importadas {processed} sessões até agora. A importação não terminou dentro do tempo previsto, mas continua a ser executada em segundo plano; verifique novamente daqui a um minuto em vez de iniciá-la outra vez.',
+ 'Sessões importadas até agora: {processed}. A importação não terminou dentro do tempo previsto, mas continua a ser executada em segundo plano; verifique novamente daqui a um minuto em vez de iniciá-la outra vez.',
'memorySources.codingSessions.failed': 'Falha ao ingerir sessões de programação',
'flows.canvas.sidePanelToggle': 'Painel lateral',
'flows.canvas.legendTab': 'Manual',
diff --git a/app/src/lib/i18n/ru.ts b/app/src/lib/i18n/ru.ts
index 6431275398..1358047852 100644
--- a/app/src/lib/i18n/ru.ts
+++ b/app/src/lib/i18n/ru.ts
@@ -6884,7 +6884,7 @@ const messages: TranslationMap = {
'Не удалось обработать сеансов: {failed}; обработано: {processed}. Запустите загрузку ещё раз для повтора.',
'memorySources.codingSessions.stillRunning': 'Импорт всё ещё выполняется',
'memorySources.codingSessions.stillRunningMessage':
- 'На данный момент импортировано сессий: {processed}. Импорт не завершился в отведённое время, но продолжает выполняться в фоновом режиме; загляните через минуту, а не запускайте его заново.',
+ 'Импортировано сессий на данный момент: {processed}. Импорт не завершился в отведённое время, но продолжает выполняться в фоновом режиме; загляните через минуту, а не запускайте его заново.',
'memorySources.codingSessions.failed': 'Не удалось загрузить сеансы программирования',
'flows.canvas.sidePanelToggle': 'Боковая панель',
'flows.canvas.legendTab': 'Вручную',
diff --git a/app/src/lib/i18n/zh-CN.ts b/app/src/lib/i18n/zh-CN.ts
index 84ca3cac68..5b342c2e37 100644
--- a/app/src/lib/i18n/zh-CN.ts
+++ b/app/src/lib/i18n/zh-CN.ts
@@ -6443,7 +6443,7 @@ const messages: TranslationMap = {
'{processed} 个会话已处理,{failed} 个失败。请再次运行摄取以重试。',
'memorySources.codingSessions.stillRunning': '导入仍在进行中',
'memorySources.codingSessions.stillRunningMessage':
- '目前已导入 {processed} 个会话。导入未在限定时间内完成,但仍在后台运行;请稍后再查看,不要重新开始。',
+ '目前已导入的会话数:{processed}。导入未在限定时间内完成,但仍在后台运行;请稍后再查看,不要重新开始。',
'memorySources.codingSessions.failed': '编程会话摄取失败',
'flows.canvas.sidePanelToggle': '侧边栏',
'flows.canvas.legendTab': '手动',
diff --git a/app/src/services/memorySourcesService.test.ts b/app/src/services/memorySourcesService.test.ts
index 79c1809ef1..dd2d0afd26 100644
--- a/app/src/services/memorySourcesService.test.ts
+++ b/app/src/services/memorySourcesService.test.ts
@@ -340,11 +340,43 @@ describe('memorySourcesService', () => {
await expect(drainCodingSessions()).rejects.toThrow('persona pipeline failed');
});
- it('isIngestTimeout does not treat an unrelated message as a deadline', () => {
+ it('rejects a renderer-side abort instead of calling it still-running', async () => {
+ // The client's own AbortController proves the renderer stopped waiting and
+ // nothing else — a wedged, overloaded or absent core produces exactly the
+ // same signal as one happily distilling sessions. Suppressing it would show
+ // a false success over work that may never have started, which is #5802
+ // with the sign flipped. Only the core's own prefix is evidence.
+ const abort = Object.assign(
+ new Error(
+ 'Core RPC openhuman.memory_sources_ingest_coding_sessions timed out after 585000ms'
+ ),
+ { kind: 'timeout' }
+ );
+ mockedCall.mockRejectedValueOnce(abort);
+
+ await expect(drainCodingSessions()).rejects.toThrow('timed out after 585000ms');
+ });
+
+ it('isIngestTimeout suppresses only deadlines the core reported', () => {
+ // Suppressed: both shapes carry `ingest coding sessions: `, which only
+ // `ingest_coding_sessions_rpc` adds — proof the handler ran.
+ expect(
+ isIngestTimeout(
+ new Error('ingest coding sessions: call to `IngestCodingSessions` timed out after 30000ms')
+ )
+ ).toBe(true);
+ expect(isIngestTimeout(new Error('ingest coding sessions: timed out after 570s'))).toBe(true);
+
+ // Not suppressed. A bare timeout phrase carries no evidence that anything
+ // was dispatched, and an unprefixed pattern would have swallowed an
+ // ordinary provider failure.
+ expect(isIngestTimeout(new Error('timed out after 30000ms'))).toBe(false);
+ expect(isIngestTimeout(new Error('request timed out after 30s'))).toBe(false);
+ expect(isIngestTimeout(new Error('Core RPC x timed out after 585000ms'))).toBe(false);
expect(isIngestTimeout(new Error('the request timed out'))).toBe(false);
expect(isIngestTimeout(new Error('session scan failed'))).toBe(false);
- expect(isIngestTimeout(new Error('timed out after 30000ms'))).toBe(true);
- expect(isIngestTimeout(new Error('timed out after 570s'))).toBe(true);
+ // A kind field alone is not evidence either.
+ expect(isIngestTimeout({ kind: 'timeout' })).toBe(false);
});
it('stops when a budget-hit pass makes no forward progress', async () => {
diff --git a/app/src/services/memorySourcesService.ts b/app/src/services/memorySourcesService.ts
index aa1ee7dce4..31a694c8bc 100644
--- a/app/src/services/memorySourcesService.ts
+++ b/app/src/services/memorySourcesService.ts
@@ -314,35 +314,44 @@ export interface CodingSessionDrainProgress {
}
/**
- * Whether a rejected ingest pass is a deadline rather than a failure.
+ * Whether a rejected ingest pass is a deadline the **core itself** reported.
*
- * Three shapes reach here, and all three mean "stopped waiting", not "broke":
+ * Suppressing a timeout is only defensible when the work is genuinely still
+ * running, and that needs proof — not merely the absence of a reply. The proof
+ * used here is the message prefix: `ingest coding sessions: ` is added by
+ * `ingest_coding_sessions_rpc` (`src/openhuman/memory/sources/rpc.rs`) around
+ * both of its deadline paths, so a message carrying it can only have been
+ * produced *inside* that handler. The core received the request, resolved the
+ * binding and started the call. Two shapes qualify:
*
- * - `CoreRpcError` with `kind === 'timeout'` — the client's own
- * `AbortController` fired at `timeoutMs`.
- * - `... timed out after 30000ms` — a tinybus call deadline, rendered by
- * `vendor/tinybus/crates/tinybus/src/error.rs`. `classifyRpcError` already
- * maps this to `'timeout'`, but it is matched here too so the check does not
- * depend on a `CoreRpcError` reaching this frame intact.
- * - `ingest coding sessions: timed out after 570s` — the core's own
- * `ingest_budget` ceiling (`memory/sources/rpc.rs`). Note the unit: this one
- * is **seconds**, so it does not match `classifyRpcError`'s `\d+ms` arm and
- * is classified `'transport'`. Only the message catches it.
+ * - `ingest coding sessions: timed out after 570s` — the RPC's own
+ * `ingest_budget` ceiling. Note the unit: **seconds**.
+ * - ``ingest coding sessions: call to `IngestCodingSessions` timed out after
+ * 30000ms`` — the tinybus call deadline, wrapped by the same handler.
+ * **Milliseconds.**
*
- * The kind is read structurally rather than through `instanceof CoreRpcError`.
- * A class identity is the wrong thing to hang this on: it is one bundling
- * decision or one partially-mocked module away from silently answering `false`
- * and putting the failure banner back — which is exactly what a unit test
- * mocking `coreRpcClient` reproduces.
+ * Everything else is a failure, and two near-misses are deliberately excluded:
*
- * A false positive here would hide a real failure, so the pattern stays
- * anchored on the literal phrase both layers emit rather than on a bare
- * "timeout" anywhere in the text.
+ * - **The renderer's own `AbortController`** (`CoreRpcError` with
+ * `kind === 'timeout'`, message `Core RPC <method> timed out after <n>ms`).
+ * It proves the client stopped waiting and nothing more. A core that is
+ * wedged, overloaded, or not running produces exactly the same signal as one
+ * that is happily distilling sessions, so treating it as "still running"
+ * would show a false success and discourage a retry that is actually needed
+ * — the same false-reporting defect as #5802 with the sign flipped.
+ * - **A bare timeout phrase.** A provider failure surfacing as
+ * `request timed out after 30s` would have matched an unprefixed pattern.
+ *
+ * That asymmetry is the point: a *false negative* here costs a banner that
+ * says "failed" when the work continues — annoying, and recoverable, because
+ * the next status poll shows what landed. A *false positive* costs a banner
+ * that says "still running" over work that stopped, which is unrecoverable
+ * without the user noticing on their own. So the predicate is deliberately
+ * narrow and keyed on evidence rather than on symptom.
*/
export function isIngestTimeout(cause: unknown): boolean {
- if ((cause as { kind?: unknown } | null)?.kind === 'timeout') return true;
const message = cause instanceof Error ? cause.message : String(cause);
- return /timed out after \d+\s*(ms|s)\b/i.test(message);
+ return /ingest coding sessions:[\s\S]*timed out after \d+\s*(ms|s)\b/i.test(message);
}
export interface CodingSessionDrainOptions {