fix: resolve DM channel for agent:main:main sessions

The main agent session uses key 'agent:main:main' which doesn't
contain a channel ID. The session monitor now falls back to reading
deliveryContext/lastTo from sessions.json and resolves 'user:XXXX'
format via the Mattermost direct channel API.

Fixes: status watcher not tracking the main agent's active transcript
This commit is contained in:
sol
2026-03-07 22:35:33 +00:00
parent 7aebebf193
commit 0d0e6e9d90
3 changed files with 131 additions and 6 deletions

View File

@@ -206,6 +206,9 @@ async function startDaemon() {
transcriptDir: config.transcriptDir,
pollMs: config.sessionPollMs,
defaultChannel: config.defaultChannel,
mmToken: config.mm.token,
mmUrl: config.mm.baseUrl,
botUserId: config.mm.botUserId,
logger: logger.child({ module: 'session-monitor' }),
});