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 <noreply@anthropic.com>
This commit is contained in:
Glucksberg
2026-02-11 03:17:32 +00:00
parent 809175612c
commit 63827c9dcb
+2 -2
View File
@@ -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<string, string> = {
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-<agentId>"
if (project.startsWith("openclaw-")) {