Skip to content

fix(memory): honor category on manual add#1851

Merged
yyhhyyyyyy merged 2 commits into
devfrom
fix/memory-category-passthrough
Jun 30, 2026
Merged

fix(memory): honor category on manual add#1851
yyhhyyyyyy merged 2 commits into
devfrom
fix/memory-category-passthrough

Conversation

@yyhhyyyyyy

@yyhhyyyyyy yyhhyyyyyy commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Fixes manual memory add category passthrough and makes category the source of truth for kind derivation in the memory manager.

Summary by CodeRabbit

  • New Features
    • Added an optional memory category when creating a new memory.
    • Updated the add-memory form to support category selection, including the appropriate show/hide behavior and responsive layout.
    • Added localized labels for “Memory category” and “No category” across multiple languages.
  • Bug Fixes
    • Ensured the correct combination of category vs kind is sent when saving memories.
    • Improved add-memory form reset so defaults return reliably after canceling/submitting.
  • Tests
    • Expanded automated coverage for categorized vs uncategorized memory add/list flows and payload handling.

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 47ca71c2-7d3b-4459-a297-36086a971b1b

📥 Commits

Reviewing files that changed from the base of the PR and between 29801af and e891915.

📒 Files selected for processing (4)
  • src/renderer/api/MemoryClient.ts
  • src/renderer/settings/components/MemoryManagerPanel.vue
  • test/renderer/api/clients.test.ts
  • test/renderer/components/MemoryManagerDialog.test.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/renderer/api/MemoryClient.ts
  • test/renderer/components/MemoryManagerDialog.test.ts
  • test/renderer/api/clients.test.ts

📝 Walkthrough

Walkthrough

Adds an optional memory category to the add flow in the renderer client and settings UI. The panel now switches between category and kind input, locale files add the new labels, and tests cover category passthrough in client and dialog flows.

Changes

Memory Category Add Support

Layer / File(s) Summary
MemoryClient category contract
src/renderer/api/MemoryClient.ts
Adds AgentMemoryCategory support to the add-memory input and forwards either category or kind in the request payload.
MemoryManagerPanel category selector
src/renderer/settings/components/MemoryManagerPanel.vue
Adds the category selector, conditional kind selector, layout updates, state/reset handling, and conditional add payload construction.
i18n strings for addCategoryLabel and addCategoryNone
src/renderer/src/i18n/*/settings.json
Adds the new memory category label and “no category” strings across the locale settings files.
Client and dialog tests for category passthrough
test/renderer/api/clients.test.ts, test/renderer/components/MemoryManagerDialog.test.ts
Updates bridge/client tests to capture and assert memory categories, and adds dialog tests for default, explicit, task-outcome, and reset cases.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • ThinkInAIXYZ/deepchat#1802: Introduces the agent-memory category field in the underlying memory contract that this PR routes through the renderer.

Poem

🐇 A memory hops in, category bright,
Kind steps aside when the label is right.
"No category" waits like a pebble in grass,
While tests nibble carrots and let the payload pass.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly reflects the main change: honoring memory category during manual add.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/memory-category-passthrough

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 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/renderer/api/MemoryClient.ts`:
- Around line 62-74: Make the MemoryClient add contract enforce that kind and
category cannot both be provided, since the current input type and bridge.invoke
payload still allow callers to pass both. Update the add method’s input typing
in MemoryClient so it uses a mutually exclusive shape (or equivalent
discriminated union) for kind versus category, and adjust the payload
construction so only the selected field is forwarded. Use the add method and
memoryAddRoute bridge call as the key places to tighten the renderer-side API.
🪄 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: 7fbca861-eada-4006-93fd-bcdf2f7bf0bc

📥 Commits

Reviewing files that changed from the base of the PR and between 050d014 and 29801af.

📒 Files selected for processing (24)
  • src/renderer/api/MemoryClient.ts
  • src/renderer/settings/components/MemoryManagerPanel.vue
  • src/renderer/src/i18n/da-DK/settings.json
  • src/renderer/src/i18n/de-DE/settings.json
  • src/renderer/src/i18n/en-US/settings.json
  • src/renderer/src/i18n/es-ES/settings.json
  • src/renderer/src/i18n/fa-IR/settings.json
  • src/renderer/src/i18n/fr-FR/settings.json
  • src/renderer/src/i18n/he-IL/settings.json
  • src/renderer/src/i18n/id-ID/settings.json
  • src/renderer/src/i18n/it-IT/settings.json
  • src/renderer/src/i18n/ja-JP/settings.json
  • src/renderer/src/i18n/ko-KR/settings.json
  • src/renderer/src/i18n/ms-MY/settings.json
  • src/renderer/src/i18n/pl-PL/settings.json
  • src/renderer/src/i18n/pt-BR/settings.json
  • src/renderer/src/i18n/ru-RU/settings.json
  • src/renderer/src/i18n/tr-TR/settings.json
  • src/renderer/src/i18n/vi-VN/settings.json
  • src/renderer/src/i18n/zh-CN/settings.json
  • src/renderer/src/i18n/zh-HK/settings.json
  • src/renderer/src/i18n/zh-TW/settings.json
  • test/renderer/api/clients.test.ts
  • test/renderer/components/MemoryManagerDialog.test.ts

Comment thread src/renderer/api/MemoryClient.ts Outdated
@yyhhyyyyyy yyhhyyyyyy merged commit f5b0941 into dev Jun 30, 2026
3 checks passed
@yyhhyyyyyy yyhhyyyyyy deleted the fix/memory-category-passthrough branch June 30, 2026 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant