refactor(memory): make long-term memory auditable and self-updating - #1794
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR expands DeepChat memory contracts, SQLite storage, runtime extraction and tape context, renderer settings and management UI, localization, and tests, including native SQLite coverage and agent-deletion cleanup. ChangesDeepChat memory and tape management
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
Note
Due to the large number of review comments, Critical, Major severity comments were prioritized as inline comments.
🟡 Minor comments (18)
src/renderer/src/i18n/zh-HK/settings.json-2249-2249 (1)
2249-2249:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winUse Traditional Chinese wording for the conflict status label.
Line 2249 uses simplified text (
冲突中) in the zh-HK locale. Please change it to Traditional (衝突中) for consistency.Proposed fix
- "conflicted": "冲突中" + "conflicted": "衝突中"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/renderer/src/i18n/zh-HK/settings.json` at line 2249, The "conflicted" key in the zh-HK locale file contains simplified Chinese characters (`冲突中`) instead of traditional Chinese characters. Replace the value with the traditional Chinese equivalent (`衝突中`) to ensure consistency with the Hong Kong locale which uses traditional Chinese writing system. Locate the "conflicted" key entry and update its value accordingly.src/renderer/src/i18n/zh-TW/settings.json-2249-2249 (1)
2249-2249:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winUse Traditional Chinese in the zh-TW conflict status label.
Line 2249 uses Simplified Chinese (
冲突中) in a zh-TW file; use衝突中to keep locale consistency.💡 Suggested fix
- "conflicted": "冲突中" + "conflicted": "衝突中"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/renderer/src/i18n/zh-TW/settings.json` at line 2249, The "conflicted" translation entry in the zh-TW settings.json file uses Simplified Chinese character "冲" instead of the Traditional Chinese equivalent "衝". Change the value of the "conflicted" key from "冲突中" to "衝突中" to maintain proper Traditional Chinese locale consistency.src/main/routes/index.ts-459-460 (1)
459-460:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winSanitize
personaStateinstead of using an unchecked cast.Line 459 trusts DB text with
ascasting. Any unexpected stored value will break route output parsing and fail the whole response; coercing unknown values tonullis safer.💡 Suggested fix
export function toMemoryItemDto(row: AgentMemoryRow) { + const personaState = + row.persona_state === 'draft' || + row.persona_state === 'active' || + row.persona_state === 'superseded' || + row.persona_state === 'rejected' + ? row.persona_state + : null + return { @@ - personaState: row.persona_state as 'draft' | 'active' | 'superseded' | 'rejected' | null, + personaState, isAnchor: row.is_anchor === 1 } }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/main/routes/index.ts` around lines 459 - 460, The personaState field assignment on line 459 uses an unsafe type cast (`as`) on the raw database value without validation, which could cause parsing failures if unexpected values are stored. Replace the cast with validation logic that checks whether row.persona_state actually matches one of the allowed values ('draft', 'active', 'superseded', 'rejected'), and if it matches, use that value; otherwise, coerce it to null. This ensures the route output remains safe regardless of what is stored in the database.src/renderer/src/i18n/fa-IR/settings.json-2244-2250 (1)
2244-2250:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winLocalize remaining English status labels in the Persian bundle.
Line [2249] still uses
Conflicted, which breaks i18n consistency in this Persian block.Suggested fix
- "conflicted": "Conflicted" + "conflicted": "دارای تعارض"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/renderer/src/i18n/fa-IR/settings.json` around lines 2244 - 2250, The "conflicted" status label in the settings.json file for the Persian (fa-IR) locale is still in English while all other status labels in this block are properly translated to Persian. Replace the English string "Conflicted" with the appropriate Persian translation for the "conflicted" key to maintain consistency with the surrounding localized status labels like "درحالembedding", "نمایهشده", "خطا", "فقط کلیدواژه", and "بایگانیشده".src/renderer/src/i18n/fr-FR/settings.json-2244-2250 (1)
2244-2250:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winTranslate the remaining English status value in the French locale.
Line [2249] uses
Conflictedinstead of a French label, causing mixed-language UI in the same status group.Suggested fix
- "conflicted": "Conflicted" + "conflicted": "En conflit"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/renderer/src/i18n/fr-FR/settings.json` around lines 2244 - 2250, The conflicted status value in the French locale file is currently set to the English word "Conflicted" instead of being translated to French, creating inconsistency with the other translated status values in the same group. Replace the value for the "conflicted" key with an appropriate French translation to maintain language consistency throughout the settings locale file.src/renderer/src/i18n/it-IT/settings.json-174-181 (1)
174-181:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winLocalize the conflicted status label in Italian.
Line 180 keeps an English label (
"Conflicted") inside the Italian locale block, which causes mixed-language UI in memory status chips.Suggested fix
- "conflicted": "Conflicted" + "conflicted": "In conflitto"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/renderer/src/i18n/it-IT/settings.json` around lines 174 - 181, In the status object within the Italian locale settings file, locate the "conflicted" key which currently has the English value "Conflicted". Replace this English text with the appropriate Italian translation for the "conflicted" status label to ensure consistent Italian localization throughout the memory status chips UI component.src/renderer/src/i18n/ja-JP/settings.json-2243-2250 (1)
2243-2250:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winTranslate the conflicted status value for ja-JP.
Line 2249 uses English (
"Conflicted") while the surrounding status values are localized Japanese.Suggested fix
- "conflicted": "Conflicted" + "conflicted": "競合中"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/renderer/src/i18n/ja-JP/settings.json` around lines 2243 - 2250, The "conflicted" status value in the status object is using the English string "Conflicted" instead of a Japanese translation, which is inconsistent with the other localized status values like "pending_embedding", "embedded", "error", "fts_only", and "archived" that are all properly translated to Japanese. Replace the English "Conflicted" value with an appropriate Japanese translation to maintain consistency with the rest of the ja-JP locale file.src/renderer/src/i18n/ru-RU/settings.json-2243-2250 (1)
2243-2250:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winTranslate the
conflictedstatus in Russian locale.The
conflictedvalue is still"Conflicted"while adjacent status labels are localized, creating a mixed-language status list.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/renderer/src/i18n/ru-RU/settings.json` around lines 2243 - 2250, In the status object within the Russian locale settings file, the "conflicted" property value is still in English ("Conflicted") while all other adjacent status labels like "pending_embedding", "embedded", "error", "fts_only", and "archived" are properly translated to Russian. Replace the English value for the "conflicted" key with its appropriate Russian translation to maintain consistency with the rest of the localized status labels in the file.src/renderer/src/i18n/pt-BR/settings.json-2243-2250 (1)
2243-2250:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winLocalize the
conflictedstatus label.
memoryManager.status.conflictedis still"Conflicted"while the neighboring status labels are translated, so this appears mixed-language in the pt-BR UI.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/renderer/src/i18n/pt-BR/settings.json` around lines 2243 - 2250, In the status object within the Portuguese Brazilian localization file, the conflicted key currently has the English value "Conflicted" while all neighboring status labels are translated to Portuguese. Translate the "Conflicted" value to Portuguese to maintain consistency with the other status labels in the same status object such as embedded (Indexado), error (Erro), fts_only (Apenas palavras-chave), and archived (Arquivado).src/renderer/src/i18n/tr-TR/settings.json-174-181 (1)
174-181:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winLocalize
conflictedfor tr-TR status labels.
memoryManager.status.conflictedis still"Conflicted"while other statuses in the same block are Turkish.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/renderer/src/i18n/tr-TR/settings.json` around lines 174 - 181, The status object in the tr-TR settings localization file has an inconsistency where the "conflicted" property value is still in English while all other status properties in the same block are translated to Turkish. Update the value of the "conflicted" key within the status object to use the appropriate Turkish translation instead of the English "Conflicted" text.src/renderer/src/i18n/pl-PL/settings.json-174-181 (1)
174-181:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winLocalize the
conflictedstatus label in Polish.Line 180 is still English (
"Conflicted"), which breaks language consistency in the Polish status set.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/renderer/src/i18n/pl-PL/settings.json` around lines 174 - 181, The status object in the Polish translation file contains an untranslated English label for the "conflicted" key. Locate the "conflicted" property within the status object in the settings.json file and replace the English value "Conflicted" with its appropriate Polish translation to maintain consistency with the other localized status labels like "Zindeksowane", "Błąd", "Tylko słowa kluczowe", and "Zarchiwizowano".src/renderer/src/i18n/ko-KR/settings.json-2243-2250 (1)
2243-2250:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winLocalize the
conflictedstatus label in Korean.Line 2249 uses English (
"Conflicted") while surrounding status strings are localized Korean, which creates inconsistent UI language.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/renderer/src/i18n/ko-KR/settings.json` around lines 2243 - 2250, The "conflicted" status label in the status object is currently set to English "Conflicted" while all other status labels like "pending_embedding", "embedded", "error", "fts_only", and "archived" are properly localized in Korean. Translate the value of the "conflicted" property to Korean to match the localization pattern of the surrounding status labels in the settings.json file.src/renderer/src/i18n/ms-MY/settings.json-174-181 (1)
174-181:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winLocalize the
conflictedstatus label in Malay.Line 180 keeps
"Conflicted"in English, which is inconsistent with the surrounding Malay status labels.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/renderer/src/i18n/ms-MY/settings.json` around lines 174 - 181, The "conflicted" status label in the status object within the Malay language settings file is currently set to "Conflicted" in English, which is inconsistent with the other status labels that are all translated to Malay (such as "Diindeks" for embedded and "Ralat" for error). Translate the value of the "conflicted" key from English to its proper Malay equivalent to maintain consistency with the surrounding localized status labels.src/renderer/src/i18n/he-IL/settings.json-2249-2249 (1)
2249-2249:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winTranslate the remaining English status label in the Hebrew locale.
Line 2249 uses
"Conflicted"while adjacent status labels are Hebrew, so the memory status list renders mixed-language text inhe-IL.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/renderer/src/i18n/he-IL/settings.json` at line 2249, The "conflicted" status label in the Hebrew locale file (he-IL/settings.json) is currently set to the English value "Conflicted" while adjacent status labels are properly translated to Hebrew, causing mixed-language rendering. Replace the English "Conflicted" value with its appropriate Hebrew translation to ensure consistent localization throughout the settings file for the he-IL locale.src/renderer/src/i18n/id-ID/settings.json-180-180 (1)
180-180:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winTranslate the remaining English status label to Indonesian.
Line 180 uses
"Conflicted"while the othermemoryManager.statusvalues are localized; this will surface mixed-language UI in the same status list.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/renderer/src/i18n/id-ID/settings.json` at line 180, The status label "Conflicted" in the memoryManager.status section at line 180 is in English while other status values in the same section are properly localized to Indonesian, creating inconsistent mixed-language UI. Replace the English value "Conflicted" with the appropriate Indonesian translation for the "conflicted" key to maintain consistent localization throughout the status list.src/renderer/src/i18n/da-DK/settings.json-2243-2250 (1)
2243-2250:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winTranslate the conflicted status label in Danish locale.
Line 2249 is still English (
"Conflicted"), which causes mixed-language UI in the Danish memory manager status list.Suggested fix
- "conflicted": "Conflicted" + "conflicted": "I konflikt"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/renderer/src/i18n/da-DK/settings.json` around lines 2243 - 2250, In the Danish locale file (da-DK/settings.json), the "conflicted" status label within the status object is still in English ("Conflicted") while all other status labels like "embedded", "error", "fts_only", and "archived" are properly translated to Danish. Replace the English "Conflicted" value with an appropriate Danish translation to maintain consistent language throughout the status object and avoid mixed-language UI in the memory manager.src/renderer/src/i18n/de-DE/settings.json-180-180 (1)
180-180:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winTranslate the
conflictedstatus label to German.The value is still English (
"Conflicted"), which makes the status list partially untranslated in the German UI.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/renderer/src/i18n/de-DE/settings.json` at line 180, The "conflicted" key in the German translation file de-DE/settings.json still has the English value "Conflicted" instead of a German translation. Replace the value of the "conflicted" key with the appropriate German translation for the word "Conflicted" to ensure the status label appears correctly in German UI.src/renderer/src/i18n/es-ES/settings.json-180-180 (1)
180-180:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winTranslate the
conflictedstatus label to Spanish.
"Conflicted"is left in English, so this status renders inconsistently in the Spanish UI.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/renderer/src/i18n/es-ES/settings.json` at line 180, The "conflicted" key in the Spanish settings translation file contains an English value instead of a Spanish translation. Locate the "conflicted" key in the settings.json file and replace its English value "Conflicted" with the appropriate Spanish translation to ensure consistent UI rendering across all status labels in the Spanish language interface.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/main/presenter/agentRuntimePresenter/index.ts`:
- Around line 1847-1858: The enqueueSessionExtraction method queues extraction
tasks but does not prevent stale tasks from executing after a session is reset,
allowing them to corrupt memory state at lines like memoryCursorOrderSeq
advancement and memory/extract anchor appending. Implement epoch-based
invalidation by adding a session epoch/version field that increments whenever
clearMessages, destroySession, or tape reset operations occur, then validate the
epoch at the point where extractAndStore would commit results (before advancing
memoryCursorOrderSeq and appending memory/extract anchors) so stale pre-reset
extraction tasks cannot modify session state.
In `@src/main/presenter/memoryPresenter/types.ts`:
- Around line 307-343: The FTS_SIMILARITY_BASELINE constant is set to 0.3, but
this is greater than DEFAULT_SIMILARITY_THRESHOLD which is 0.2. According to the
comment on the FTS_SIMILARITY_BASELINE line, it should be kept below the vector
similarity threshold to prevent FTS-only hits from outranking genuine vector
matches. Fix this by reducing the FTS_SIMILARITY_BASELINE value to be strictly
less than DEFAULT_SIMILARITY_THRESHOLD (for example, 0.15 or 0.1) to maintain
the stated invariant.
In `@src/main/routes/index.ts`:
- Around line 585-587: The code assumes the runtime.sqlitePresenter has full
SQLitePresenter capabilities when accessing table members like
deepchatTapeEntriesTable.getBySession(), but if runtime was created with a
fallback sqlite stub, these table members won't exist and will throw at runtime.
Add a guard condition before the cast in the sqlitePresenter declaration and the
subsequent table access to check if the presenter actually has the
deepchatTapeEntriesTable property available, and handle the fallback case
appropriately. Apply this same guard check to all three locations mentioned: the
cast at line 585, the access at line 2139, and the access at line 2160.
In `@test/main/presenter/fakes/memoryFakes.ts`:
- Around line 72-97: The limit clamping in the listByAgent method of
FakeRepository does not match SQLite table behavior, which clamps limits to the
range [1, 500]. Update the limit clamping logic at line 95 in
FakeRepository.listByAgent where it currently uses Math.max(1,
Math.floor(options.limit)) to instead clamp the limit value between 1 and 500
using Math.max(1, Math.min(500, Math.floor(options.limit))). Apply the same fix
to FakeAuditRepository.listByAgent (around line 386) to ensure both fake
repositories match the actual SQLite behavior and maintain test fidelity for
boundary cases.
---
Minor comments:
In `@src/main/routes/index.ts`:
- Around line 459-460: The personaState field assignment on line 459 uses an
unsafe type cast (`as`) on the raw database value without validation, which
could cause parsing failures if unexpected values are stored. Replace the cast
with validation logic that checks whether row.persona_state actually matches one
of the allowed values ('draft', 'active', 'superseded', 'rejected'), and if it
matches, use that value; otherwise, coerce it to null. This ensures the route
output remains safe regardless of what is stored in the database.
In `@src/renderer/src/i18n/da-DK/settings.json`:
- Around line 2243-2250: In the Danish locale file (da-DK/settings.json), the
"conflicted" status label within the status object is still in English
("Conflicted") while all other status labels like "embedded", "error",
"fts_only", and "archived" are properly translated to Danish. Replace the
English "Conflicted" value with an appropriate Danish translation to maintain
consistent language throughout the status object and avoid mixed-language UI in
the memory manager.
In `@src/renderer/src/i18n/de-DE/settings.json`:
- Line 180: The "conflicted" key in the German translation file
de-DE/settings.json still has the English value "Conflicted" instead of a German
translation. Replace the value of the "conflicted" key with the appropriate
German translation for the word "Conflicted" to ensure the status label appears
correctly in German UI.
In `@src/renderer/src/i18n/es-ES/settings.json`:
- Line 180: The "conflicted" key in the Spanish settings translation file
contains an English value instead of a Spanish translation. Locate the
"conflicted" key in the settings.json file and replace its English value
"Conflicted" with the appropriate Spanish translation to ensure consistent UI
rendering across all status labels in the Spanish language interface.
In `@src/renderer/src/i18n/fa-IR/settings.json`:
- Around line 2244-2250: The "conflicted" status label in the settings.json file
for the Persian (fa-IR) locale is still in English while all other status labels
in this block are properly translated to Persian. Replace the English string
"Conflicted" with the appropriate Persian translation for the "conflicted" key
to maintain consistency with the surrounding localized status labels like
"درحالembedding", "نمایهشده", "خطا", "فقط کلیدواژه", and "بایگانیشده".
In `@src/renderer/src/i18n/fr-FR/settings.json`:
- Around line 2244-2250: The conflicted status value in the French locale file
is currently set to the English word "Conflicted" instead of being translated to
French, creating inconsistency with the other translated status values in the
same group. Replace the value for the "conflicted" key with an appropriate
French translation to maintain language consistency throughout the settings
locale file.
In `@src/renderer/src/i18n/he-IL/settings.json`:
- Line 2249: The "conflicted" status label in the Hebrew locale file
(he-IL/settings.json) is currently set to the English value "Conflicted" while
adjacent status labels are properly translated to Hebrew, causing mixed-language
rendering. Replace the English "Conflicted" value with its appropriate Hebrew
translation to ensure consistent localization throughout the settings file for
the he-IL locale.
In `@src/renderer/src/i18n/id-ID/settings.json`:
- Line 180: The status label "Conflicted" in the memoryManager.status section at
line 180 is in English while other status values in the same section are
properly localized to Indonesian, creating inconsistent mixed-language UI.
Replace the English value "Conflicted" with the appropriate Indonesian
translation for the "conflicted" key to maintain consistent localization
throughout the status list.
In `@src/renderer/src/i18n/it-IT/settings.json`:
- Around line 174-181: In the status object within the Italian locale settings
file, locate the "conflicted" key which currently has the English value
"Conflicted". Replace this English text with the appropriate Italian translation
for the "conflicted" status label to ensure consistent Italian localization
throughout the memory status chips UI component.
In `@src/renderer/src/i18n/ja-JP/settings.json`:
- Around line 2243-2250: The "conflicted" status value in the status object is
using the English string "Conflicted" instead of a Japanese translation, which
is inconsistent with the other localized status values like "pending_embedding",
"embedded", "error", "fts_only", and "archived" that are all properly translated
to Japanese. Replace the English "Conflicted" value with an appropriate Japanese
translation to maintain consistency with the rest of the ja-JP locale file.
In `@src/renderer/src/i18n/ko-KR/settings.json`:
- Around line 2243-2250: The "conflicted" status label in the status object is
currently set to English "Conflicted" while all other status labels like
"pending_embedding", "embedded", "error", "fts_only", and "archived" are
properly localized in Korean. Translate the value of the "conflicted" property
to Korean to match the localization pattern of the surrounding status labels in
the settings.json file.
In `@src/renderer/src/i18n/ms-MY/settings.json`:
- Around line 174-181: The "conflicted" status label in the status object within
the Malay language settings file is currently set to "Conflicted" in English,
which is inconsistent with the other status labels that are all translated to
Malay (such as "Diindeks" for embedded and "Ralat" for error). Translate the
value of the "conflicted" key from English to its proper Malay equivalent to
maintain consistency with the surrounding localized status labels.
In `@src/renderer/src/i18n/pl-PL/settings.json`:
- Around line 174-181: The status object in the Polish translation file contains
an untranslated English label for the "conflicted" key. Locate the "conflicted"
property within the status object in the settings.json file and replace the
English value "Conflicted" with its appropriate Polish translation to maintain
consistency with the other localized status labels like "Zindeksowane", "Błąd",
"Tylko słowa kluczowe", and "Zarchiwizowano".
In `@src/renderer/src/i18n/pt-BR/settings.json`:
- Around line 2243-2250: In the status object within the Portuguese Brazilian
localization file, the conflicted key currently has the English value
"Conflicted" while all neighboring status labels are translated to Portuguese.
Translate the "Conflicted" value to Portuguese to maintain consistency with the
other status labels in the same status object such as embedded (Indexado), error
(Erro), fts_only (Apenas palavras-chave), and archived (Arquivado).
In `@src/renderer/src/i18n/ru-RU/settings.json`:
- Around line 2243-2250: In the status object within the Russian locale settings
file, the "conflicted" property value is still in English ("Conflicted") while
all other adjacent status labels like "pending_embedding", "embedded", "error",
"fts_only", and "archived" are properly translated to Russian. Replace the
English value for the "conflicted" key with its appropriate Russian translation
to maintain consistency with the rest of the localized status labels in the
file.
In `@src/renderer/src/i18n/tr-TR/settings.json`:
- Around line 174-181: The status object in the tr-TR settings localization file
has an inconsistency where the "conflicted" property value is still in English
while all other status properties in the same block are translated to Turkish.
Update the value of the "conflicted" key within the status object to use the
appropriate Turkish translation instead of the English "Conflicted" text.
In `@src/renderer/src/i18n/zh-HK/settings.json`:
- Line 2249: The "conflicted" key in the zh-HK locale file contains simplified
Chinese characters (`冲突中`) instead of traditional Chinese characters. Replace
the value with the traditional Chinese equivalent (`衝突中`) to ensure consistency
with the Hong Kong locale which uses traditional Chinese writing system. Locate
the "conflicted" key entry and update its value accordingly.
In `@src/renderer/src/i18n/zh-TW/settings.json`:
- Line 2249: The "conflicted" translation entry in the zh-TW settings.json file
uses Simplified Chinese character "冲" instead of the Traditional Chinese
equivalent "衝". Change the value of the "conflicted" key from "冲突中" to "衝突中" to
maintain proper Traditional Chinese locale consistency.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 74a1189e-8061-462a-ac73-69ad763bc49f
📒 Files selected for processing (126)
package.jsonsrc/main/presenter/agentRepository/index.tssrc/main/presenter/agentRuntimePresenter/index.tssrc/main/presenter/agentRuntimePresenter/sessionStore.tssrc/main/presenter/agentRuntimePresenter/tapeEffectiveView.tssrc/main/presenter/agentRuntimePresenter/tapeService.tssrc/main/presenter/agentSessionPresenter/index.tssrc/main/presenter/configPresenter/index.tssrc/main/presenter/databaseSecurityPresenter/index.tssrc/main/presenter/index.tssrc/main/presenter/memoryPresenter/decision.tssrc/main/presenter/memoryPresenter/extraction.tssrc/main/presenter/memoryPresenter/index.tssrc/main/presenter/memoryPresenter/injectionPort.tssrc/main/presenter/memoryPresenter/memoryVectorStore.tssrc/main/presenter/memoryPresenter/scoring.tssrc/main/presenter/memoryPresenter/types.tssrc/main/presenter/sqlitePresenter/importData.tssrc/main/presenter/sqlitePresenter/index.tssrc/main/presenter/sqlitePresenter/schemaCatalog.tssrc/main/presenter/sqlitePresenter/sqliteCopyExclusions.tssrc/main/presenter/sqlitePresenter/tables/agentMemory.tssrc/main/presenter/sqlitePresenter/tables/agentMemoryAudit.tssrc/main/presenter/sqlitePresenter/tables/deepchatSessions.tssrc/main/presenter/sqlitePresenter/tables/deepchatTapeEntries.tssrc/main/presenter/sqlitePresenter/tables/deepchatTapeSearchProjection.tssrc/main/presenter/toolPresenter/agentTools/agentMemoryTools.tssrc/main/presenter/toolPresenter/agentTools/agentTapeTools.tssrc/main/presenter/toolPresenter/agentTools/chatSettingsTools.tssrc/main/presenter/toolPresenter/index.tssrc/main/presenter/toolPresenter/runtimePorts.tssrc/main/routes/index.tssrc/renderer/api/MemoryClient.tssrc/renderer/api/SessionClient.tssrc/renderer/settings/App.vuesrc/renderer/settings/components/DeepChatAgentsSettings.vuesrc/renderer/settings/components/MemoryConfigPanel.vuesrc/renderer/settings/components/MemoryManagerDialog.vuesrc/renderer/settings/components/MemoryManagerPanel.vuesrc/renderer/settings/components/MemorySettings.vuesrc/renderer/settings/main.tssrc/renderer/src/i18n/da-DK/routes.jsonsrc/renderer/src/i18n/da-DK/settings.jsonsrc/renderer/src/i18n/de-DE/routes.jsonsrc/renderer/src/i18n/de-DE/settings.jsonsrc/renderer/src/i18n/en-US/routes.jsonsrc/renderer/src/i18n/en-US/settings.jsonsrc/renderer/src/i18n/es-ES/routes.jsonsrc/renderer/src/i18n/es-ES/settings.jsonsrc/renderer/src/i18n/fa-IR/routes.jsonsrc/renderer/src/i18n/fa-IR/settings.jsonsrc/renderer/src/i18n/fr-FR/routes.jsonsrc/renderer/src/i18n/fr-FR/settings.jsonsrc/renderer/src/i18n/he-IL/routes.jsonsrc/renderer/src/i18n/he-IL/settings.jsonsrc/renderer/src/i18n/id-ID/routes.jsonsrc/renderer/src/i18n/id-ID/settings.jsonsrc/renderer/src/i18n/it-IT/routes.jsonsrc/renderer/src/i18n/it-IT/settings.jsonsrc/renderer/src/i18n/ja-JP/routes.jsonsrc/renderer/src/i18n/ja-JP/settings.jsonsrc/renderer/src/i18n/ko-KR/routes.jsonsrc/renderer/src/i18n/ko-KR/settings.jsonsrc/renderer/src/i18n/ms-MY/routes.jsonsrc/renderer/src/i18n/ms-MY/settings.jsonsrc/renderer/src/i18n/pl-PL/routes.jsonsrc/renderer/src/i18n/pl-PL/settings.jsonsrc/renderer/src/i18n/pt-BR/routes.jsonsrc/renderer/src/i18n/pt-BR/settings.jsonsrc/renderer/src/i18n/ru-RU/routes.jsonsrc/renderer/src/i18n/ru-RU/settings.jsonsrc/renderer/src/i18n/tr-TR/routes.jsonsrc/renderer/src/i18n/tr-TR/settings.jsonsrc/renderer/src/i18n/vi-VN/routes.jsonsrc/renderer/src/i18n/vi-VN/settings.jsonsrc/renderer/src/i18n/zh-CN/routes.jsonsrc/renderer/src/i18n/zh-CN/settings.jsonsrc/renderer/src/i18n/zh-HK/routes.jsonsrc/renderer/src/i18n/zh-HK/settings.jsonsrc/renderer/src/i18n/zh-TW/routes.jsonsrc/renderer/src/i18n/zh-TW/settings.jsonsrc/shared/contracts/events/memory.events.tssrc/shared/contracts/events/settings.events.tssrc/shared/contracts/routes.tssrc/shared/contracts/routes/memory.routes.tssrc/shared/contracts/routes/sessions.routes.tssrc/shared/contracts/routes/system.routes.tssrc/shared/settingsNavigation.tssrc/shared/types/agent-interface.d.tssrc/shared/types/chatSettings.tssrc/shared/types/presenters/agent-session.presenter.d.tstest/main/presenter/agentMemoryTable.test.tstest/main/presenter/agentRepository.test.tstest/main/presenter/agentRuntimePresenter/agentRuntimePresenter.test.tstest/main/presenter/agentRuntimePresenter/tapeFacts.test.tstest/main/presenter/agentRuntimePresenter/tapeService.test.tstest/main/presenter/configPresenter/deprecatedProviderCleanup.test.tstest/main/presenter/databaseSecurityPresenter.test.tstest/main/presenter/fakes/memoryFakes.tstest/main/presenter/memory-persona-eval.test.tstest/main/presenter/memoryAdd.test.tstest/main/presenter/memoryDecision.test.tstest/main/presenter/memoryExtraction.test.tstest/main/presenter/memoryInjectionPort.test.tstest/main/presenter/memoryPresenter.test.tstest/main/presenter/memoryRetrieval.eval.test.tstest/main/presenter/memorySearch.test.tstest/main/presenter/memorySessionExtractionLock.test.tstest/main/presenter/memoryVectorStore.test.tstest/main/presenter/pluginPresenter.test.tstest/main/presenter/sqlitePresenter.migrationSqlSplit.test.tstest/main/presenter/sqlitePresenter/deepchatSessionsTable.test.tstest/main/presenter/sqlitePresenter/deepchatTapeEntriesTable.test.tstest/main/presenter/sqlitePresenter/importData.test.tstest/main/presenter/toolPresenter/agentTools/agentMemoryTools.test.tstest/main/presenter/toolPresenter/agentTools/agentTapeTools.test.tstest/main/presenter/toolPresenter/toolPresenter.test.tstest/main/routes/dispatcher.test.tstest/main/routes/memoryDto.test.tstest/renderer/api/clients.test.tstest/renderer/components/DeepChatAgentsSettings.test.tstest/renderer/components/MemoryConfigPanel.test.tstest/renderer/components/MemoryManagerDialog.test.tstest/renderer/components/MemorySettings.test.tstest/renderer/plugins/cuaSettings.test.tstsconfig.node.tsbuildinfo
There was a problem hiding this comment.
♻️ Duplicate comments (1)
src/main/presenter/agentRuntimePresenter/index.ts (1)
1854-1860:⚠️ Potential issue | 🟠 Major | ⚡ Quick winCapture extraction epoch at enqueue time, not start time.
Line 1859 reads epoch when the queued task begins, so a pre-reset queued task can run with the new epoch and still commit an old
toOrderSeq. With compaction tasks, that can pushmemoryCursorOrderSeqfar beyond the real tail and suppress future extraction for valid turns.Suggested fix
private enqueueSessionExtraction( sessionId: string, task: (epoch: number) => Promise<void> ): void { + const epoch = this.ensureMemoryExtractionEpoch(sessionId) const prev = this.memoryExtractionChains.get(sessionId) ?? Promise.resolve() - const runTask = () => task(this.ensureMemoryExtractionEpoch(sessionId)) + const runTask = () => task(epoch) const next = prev.then(runTask, runTask).catch((error) => { logger.warn(`[DeepChatAgent] memory extraction chain error: ${String(error)}`) })Also applies to: 1834-1850, 1914-1955
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/main/presenter/agentRuntimePresenter/index.ts` around lines 1854 - 1860, The issue is that the epoch is being captured when the enqueued task executes rather than when it is enqueued, which allows pre-reset queued tasks to run with a new epoch and commit stale sequence numbers. In the enqueueSessionExtraction method, capture the epoch value by calling ensureMemoryExtractionEpoch(sessionId) immediately at enqueue time before defining the runTask closure, then pass this captured epoch value into the task function instead of calling ensureMemoryExtractionEpoch inside the runTask definition. This ensures the epoch is fixed at the moment the task is queued, not when it eventually runs.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In `@src/main/presenter/agentRuntimePresenter/index.ts`:
- Around line 1854-1860: The issue is that the epoch is being captured when the
enqueued task executes rather than when it is enqueued, which allows pre-reset
queued tasks to run with a new epoch and commit stale sequence numbers. In the
enqueueSessionExtraction method, capture the epoch value by calling
ensureMemoryExtractionEpoch(sessionId) immediately at enqueue time before
defining the runTask closure, then pass this captured epoch value into the task
function instead of calling ensureMemoryExtractionEpoch inside the runTask
definition. This ensures the epoch is fixed at the moment the task is queued,
not when it eventually runs.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f6b062f7-23ee-406a-8441-ec4a52f7b5c0
📒 Files selected for processing (30)
src/main/presenter/agentRuntimePresenter/index.tssrc/main/presenter/memoryPresenter/types.tssrc/main/presenter/sqlitePresenter/tables/deepchatSessions.tssrc/main/routes/index.tssrc/renderer/src/i18n/da-DK/settings.jsonsrc/renderer/src/i18n/de-DE/settings.jsonsrc/renderer/src/i18n/es-ES/settings.jsonsrc/renderer/src/i18n/fa-IR/settings.jsonsrc/renderer/src/i18n/fr-FR/settings.jsonsrc/renderer/src/i18n/he-IL/settings.jsonsrc/renderer/src/i18n/id-ID/settings.jsonsrc/renderer/src/i18n/it-IT/settings.jsonsrc/renderer/src/i18n/ja-JP/settings.jsonsrc/renderer/src/i18n/ko-KR/settings.jsonsrc/renderer/src/i18n/ms-MY/settings.jsonsrc/renderer/src/i18n/pl-PL/settings.jsonsrc/renderer/src/i18n/pt-BR/settings.jsonsrc/renderer/src/i18n/ru-RU/settings.jsonsrc/renderer/src/i18n/tr-TR/settings.jsonsrc/renderer/src/i18n/vi-VN/settings.jsonsrc/renderer/src/i18n/zh-HK/settings.jsonsrc/renderer/src/i18n/zh-TW/settings.jsontest/main/presenter/agentRuntimePresenter/agentRuntimePresenter.test.tstest/main/presenter/agentSessionPresenter/integration.test.tstest/main/presenter/fakes/memoryFakes.tstest/main/presenter/memoryPresenter.test.tstest/main/presenter/memorySessionExtractionLock.test.tstest/main/presenter/sqlitePresenter/deepchatSessionsTable.test.tstest/main/routes/dispatcher.test.tstest/main/routes/memoryDto.test.ts
✅ Files skipped from review due to trivial changes (7)
- src/renderer/src/i18n/fr-FR/settings.json
- src/renderer/src/i18n/da-DK/settings.json
- src/renderer/src/i18n/de-DE/settings.json
- src/renderer/src/i18n/vi-VN/settings.json
- src/renderer/src/i18n/fa-IR/settings.json
- src/renderer/src/i18n/tr-TR/settings.json
- src/renderer/src/i18n/he-IL/settings.json
🚧 Files skipped from review as they are similar to previous changes (16)
- test/main/routes/memoryDto.test.ts
- src/renderer/src/i18n/ko-KR/settings.json
- src/renderer/src/i18n/pt-BR/settings.json
- src/renderer/src/i18n/it-IT/settings.json
- src/renderer/src/i18n/zh-HK/settings.json
- src/renderer/src/i18n/es-ES/settings.json
- src/renderer/src/i18n/ms-MY/settings.json
- src/renderer/src/i18n/zh-TW/settings.json
- src/renderer/src/i18n/id-ID/settings.json
- src/renderer/src/i18n/ja-JP/settings.json
- src/renderer/src/i18n/pl-PL/settings.json
- test/main/presenter/fakes/memoryFakes.ts
- src/main/presenter/sqlitePresenter/tables/deepchatSessions.ts
- src/renderer/src/i18n/ru-RU/settings.json
- src/main/routes/index.ts
- src/main/presenter/memoryPresenter/types.ts
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/architecture/agent-memory-system/spec.md`:
- Around line 308-310: The fenced code blocks in the memory system specification
lack language tags, which triggers MD040 linting errors and prevents syntax
highlighting. Add the `text` language tag to all bare fenced code blocks by
changing the opening fence from ``` to ```text. This applies to the code block
showing the combined formula (around line 308), and also to the additional code
examples mentioned at lines 319-325 and 332-335. The closing backticks should
remain unchanged.
- Around line 576-592: The end-to-end flow block in the documentation is missing
a language tag, which violates the MD040 markdown linting rule. Add the language
identifier `text` to the opening fence of the code block containing the memory
system flow (starting with "enable memory" and ending with "memory.updated
event"). Change the opening backticks from ``` to ```text to explicitly declare
this as a text block.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 33144a81-da8b-467d-b4c7-ca25a2bad7a1
📒 Files selected for processing (2)
docs/ARCHITECTURE.mddocs/architecture/agent-memory-system/spec.md
✅ Files skipped from review due to trivial changes (1)
- docs/ARCHITECTURE.md
Summary
Refactors agent memory from basic recall and online extraction into an auditable long-term memory system: tape-native ingestion, hybrid FTS/vector recall, semantic write coordination, non-destructive forgetting, guarded persona evolution, execution-tape search, and a top-level Memory settings surface.
Memory remains a tape sidecar: data flows tape -> memory with lineage, extraction failures do not block conversation flow, and expensive LLM maintenance runs offline. No new runtime dependencies were added.
Key changes
memory_remember, and user-added memories, including ADD / UPDATE / SUPERSEDE / NOOP / CHALLENGE outcomes.tape_search/tape_context.Summary by CodeRabbit