Skip to content

Commit c45b9a3

Browse files
authored
fix(matrix,insights): louder unjoined-room error, outcome-only post log (#18)
## Fixed - Matrix logs a clear actionable error when it cannot join the default room (names the bot user; "invite the bot user, then restart") instead of a soft warn that operators easily miss. - Insight engine "post findings failed" line no longer re-spreads the notifier error; outcome only, since RetryNotifier already logged the cause.
1 parent 7f2b831 commit c45b9a3

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

src/chat/adapters/matrix.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,10 @@ export async function startMatrixAdapter(opts: {
117117
await client.joinRoom(opts.defaultRoomId);
118118
log.info({ roomId: opts.defaultRoomId }, 'matrix joined default room');
119119
} catch (e) {
120-
log.warn({ roomId: opts.defaultRoomId, err: e }, 'matrix failed to join default room');
120+
log.error(
121+
{ roomId: opts.defaultRoomId, botUserId: client.getUserId() ?? undefined, err: e },
122+
'matrix cannot join default room; invite the bot user, then restart',
123+
);
121124
}
122125
}
123126

src/insights/engine.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,9 @@ export async function startInsightEngine(opts: { config: KaytooConfig; insightSi
202202

203203
try {
204204
await opts.insightSink.postInsight(text);
205-
} catch (e) {
206-
// Notifier already logged the cause; record outcome and skip dedupe so the next poll retries.
207-
log.warn({ findingCount: novel.length, output: config.output, ...logErr(e) }, 'post findings failed');
205+
} catch {
206+
// Notifier already logged the cause; record outcome only and skip dedupe so the next poll retries.
207+
log.warn({ findingCount: novel.length, output: config.output }, 'post findings failed');
208208
return;
209209
}
210210
for (const f of novel) dedupe.mark(f.id);

0 commit comments

Comments
 (0)