From 63827c9dcb29c6999d642a56df4d517e2abbd9f6 Mon Sep 17 00:00:00 2001 From: Glucksberg Date: Wed, 11 Feb 2026 03:17:32 +0000 Subject: [PATCH] fix: type ObservationSSEPayload.project as nullable The project field can be null/undefined for malformed SSE payloads. Update the type and getSourceLabel signature to match the runtime null guard. Co-Authored-By: Claude Opus 4.6 --- openclaw/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openclaw/src/index.ts b/openclaw/src/index.ts index 97240222..ea33da74 100644 --- a/openclaw/src/index.ts +++ b/openclaw/src/index.ts @@ -124,7 +124,7 @@ interface ObservationSSEPayload { concepts: string | null; files_read: string | null; files_modified: string | null; - project: string; + project: string | null; prompt_number: number; created_at_epoch: number; } @@ -181,7 +181,7 @@ const AGENT_EMOJI_MAP: Record = { const CLAUDE_CODE_EMOJI = "⌨️"; const OPENCLAW_DEFAULT_EMOJI = "🦀"; -function getSourceLabel(project: string): string { +function getSourceLabel(project: string | null | undefined): string { if (!project) return OPENCLAW_DEFAULT_EMOJI; // OpenClaw agent projects are formatted as "openclaw-" if (project.startsWith("openclaw-")) {