fix: pass assistantName to container agent instead of hardcoding 'Andy'

The container agent-runner had 'Andy' hardcoded as the sender name in
archived conversation transcripts. This ignored the configurable
ASSISTANT_NAME setting, so users who changed their assistant's name
(via .env or config) would still see 'Andy' in transcripts.

- Add assistantName field to ContainerInput interface (both host and
  container copies)
- Pass ASSISTANT_NAME from config through to container in index.ts
  and task-scheduler.ts
- Thread assistantName through createPreCompactHook and
  formatTranscriptMarkdown in the agent-runner
- Use 'AssistantNameMissing' as fallback instead of 'Andy' so a
  missing name is visible rather than silently wrong

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dan Shapiro
2026-02-22 12:22:07 -08:00
parent 1980d97d90
commit 107aff850c
4 changed files with 10 additions and 5 deletions

View File

@@ -42,6 +42,7 @@ export interface ContainerInput {
chatJid: string;
isMain: boolean;
isScheduledTask?: boolean;
assistantName?: string;
secrets?: Record<string, string>;
}

View File

@@ -270,6 +270,7 @@ async function runAgent(
groupFolder: group.folder,
chatJid,
isMain,
assistantName: ASSISTANT_NAME,
},
(proc, containerName) => queue.registerProcess(chatJid, proc, containerName, group.folder),
wrappedOnOutput,

View File

@@ -4,6 +4,7 @@ import fs from 'fs';
import path from 'path';
import {
ASSISTANT_NAME,
GROUPS_DIR,
IDLE_TIMEOUT,
MAIN_GROUP_FOLDER,
@@ -113,6 +114,7 @@ async function runTask(
chatJid: task.chat_jid,
isMain,
isScheduledTask: true,
assistantName: ASSISTANT_NAME,
},
(proc, containerName) => deps.onProcess(task.chat_jid, proc, containerName, task.group_folder),
async (streamedOutput: ContainerOutput) => {