MCPcopy Create free account
hub / github.com/allocnode/oh-my-sage / insertCompressedSummary

Method insertCompressedSummary

src/server/session/store.ts:252–258  ·  view source on GitHub ↗

* 插入压缩摘要消息 * 将当前 session 从最后一条 compressed 消息之后的内容压缩为一条 compressed 消息 * 原始消息保留在文件中,compressed 消息追加在末尾 * reloadMessages 读取时会找到最后一条 compressed 并截断其前面的历史

(sessionId: string, summary: string)

Source from the content-addressed store, hash-verified

250 * reloadMessages 读取时会找到最后一条 compressed 并截断其前面的历史
251 */
252 async insertCompressedSummary(sessionId: string, summary: string): Promise<SessionMessage> {
253 return this.appendMessage(sessionId, {
254 role: 'compressed',
255 content: summary,
256 timestamp: new Date().toISOString(),
257 });
258 }
259
260 /**
261 * 截断 Session 消息

Callers 1

compressHistoryMethod · 0.80

Calls 1

appendMessageMethod · 0.95

Tested by

no test coverage detected