feat: add Japanese keyword patterns and session-end auto-save#2
Merged
feat: add Japanese keyword patterns and session-end auto-save#2
Conversation
OpenCode v1.2.25+ validates that all part IDs must start with 'prt'. The chat.message hook was creating parts with IDs like 'supermemory-nudge-xxx' and 'supermemory-context-xxx', causing ZodError crashes on every session start. Changes: - Extract generatePartId/generateMessageId into shared ids.ts - Use generatePartId() in index.ts for nudge and context parts - Remove duplicated functions from compaction.ts Fixes supermemoryai#28 Fixes supermemoryai#29 Fixes supermemoryai#32
1. Japanese memory keywords:
Added patterns like 覚えて, メモして, 保存して, 忘れないで etc.
so the plugin recognizes Japanese memory trigger phrases.
2. Session-end auto-save:
- Track user and assistant messages during the session
- On session.deleted event, ingest the conversation into
both project and user scopes via supermemory
- Minimum 3 messages required to trigger save
- Capped at 50 tracked messages / 50k chars to avoid
unbounded memory growth
|
Caution Review failedPull request was closed or merged during review ウォークスルー日本語キーワードパターンを設定に追加し、セッションメッセージの収集と会話要約機能を実装しました。ID生成ロジックを共有モジュールに統合し、セッション終了時にSupermemoryへの会話データ保存機能が追加されました。 変更内容
シーケンス図sequenceDiagram
participant User as ユーザー
participant Session as セッション管理
participant Memory as インメモリ追跡<br/>(sessionMessages)
participant Supermemory as Supermemory<br/>サービス
User->>Session: メッセージ送信
Session->>Memory: collectMessage()でメッセージ保存
Memory->>Memory: 最大50件まで保持
Note over Session: セッション処理中
User->>Session: セッション終了
Session->>Session: session.deleted イベント
Session->>Memory: セッションのメッセージを取得
Memory-->>Session: 50,000文字以内に圧縮した<br/>会話トランスクリプト
Session->>Supermemory: ingestConversation()で<br/>会話要約を保存
Supermemory-->>Session: 保存完了
Note over Session: メタデータ: type="conversation"<br/>source="session-end"
推定コードレビュー工数🎯 3 (中程度) | ⏱️ ~25 分 ウサギのポエム
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
1. Japanese memory keyword patterns
Added 11 Japanese trigger patterns so the plugin recognizes memory requests in Japanese:
2. Session-end auto-save
Automatically saves conversation summaries to supermemory when a session ends:
session.deletedevent, ingests the conversation into both project and user scopesDependencies
Summary by CodeRabbit
リリースノート