@junctionpanel/server 0.1.60 → 0.1.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -312,21 +312,23 @@ export class Session {
312
312
  async performAgentMessageSend(input) {
313
313
  await this.ensureAgentLoaded(input.agentId);
314
314
  await this.interruptAgentIfRunning(input.agentId);
315
- try {
316
- this.agentManager.recordUserMessage(input.agentId, input.text, {
317
- messageId: input.messageId,
318
- emitState: false,
319
- images: input.images?.map((image) => ({
320
- data: image.preview?.data ?? image.data,
321
- mimeType: image.preview?.mimeType ?? image.mimeType,
322
- ...(image.label ? { label: image.label } : {}),
323
- ...(image.preview?.width != null ? { width: image.preview.width } : {}),
324
- ...(image.preview?.height != null ? { height: image.preview.height } : {}),
325
- })),
326
- });
327
- }
328
- catch (error) {
329
- this.sessionLogger.error({ err: error, agentId: input.agentId }, `Failed to record user message for agent ${input.agentId}`);
315
+ if (!input.suppressHistory) {
316
+ try {
317
+ this.agentManager.recordUserMessage(input.agentId, input.text, {
318
+ messageId: input.messageId,
319
+ emitState: false,
320
+ images: input.images?.map((image) => ({
321
+ data: image.preview?.data ?? image.data,
322
+ mimeType: image.preview?.mimeType ?? image.mimeType,
323
+ ...(image.label ? { label: image.label } : {}),
324
+ ...(image.preview?.width != null ? { width: image.preview.width } : {}),
325
+ ...(image.preview?.height != null ? { height: image.preview.height } : {}),
326
+ })),
327
+ });
328
+ }
329
+ catch (error) {
330
+ this.sessionLogger.error({ err: error, agentId: input.agentId }, `Failed to record user message for agent ${input.agentId}`);
331
+ }
330
332
  }
331
333
  const prompt = this.buildAgentPrompt(input.text, input.images);
332
334
  const started = this.startAgentStream(input.agentId, prompt, {
@@ -5585,6 +5587,7 @@ export class Session {
5585
5587
  agentId,
5586
5588
  text: msg.text,
5587
5589
  ...(msg.messageId ? { messageId: msg.messageId } : {}),
5590
+ ...(msg.suppressHistory ? { suppressHistory: true } : {}),
5588
5591
  ...(msg.images ? { images: msg.images } : {}),
5589
5592
  runOptions: normalizeAgentRunOptions(msg.runOptions),
5590
5593
  });