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

Method saveUserMessage

src/server/agent/agent.ts:278–290  ·  view source on GitHub ↗

* 保存用户消息到 session

(content: string)

Source from the content-addressed store, hash-verified

276
277 /**
278 * 保存用户消息到 Session
279 */
280 private async saveUserMessage(content: string): Promise<void> {
281 if (!this.sessionId) return;
282
283 try {
284 await this.sessionStore.appendMessage(this.sessionId, {
285 role: 'user',
286 content,
287 timestamp: new Date().toISOString(),
288 });
289 } catch (error) {
290 console.error('保存用户消息失败:', error);
291 }
292 }
293

Callers 1

runMethod · 0.95

Calls 1

appendMessageMethod · 0.80

Tested by

no test coverage detected