Skip to content
This repository was archived by the owner on Aug 29, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/features/sessions/src/components/dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ export function Dashboard(props: DashboardProps) {
</SidebarProvider>
);
}

Original file line number Diff line number Diff line change
Expand Up @@ -512,4 +512,3 @@ describe("dashboard launch selection", () => {
).toBe(true);
});
});

16 changes: 13 additions & 3 deletions packages/infrastructure/protocol/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,19 @@ const TranscriptImageAvailableSchema = z
.string()
.min(1)
.max(Math.ceil(TRANSCRIPT_IMAGE_MAX_BYTES / 3) * 4)
.refine(isTranscriptImageBase64Alphabet)
.refine((data) => data.length % 4 === 0)
.refine((data) => getTranscriptImageBase64ByteLength(data) <= TRANSCRIPT_IMAGE_MAX_BYTES),
.superRefine((data, context) => {
if (getTranscriptImageBase64ByteLength(data) > TRANSCRIPT_IMAGE_MAX_BYTES) {
context.addIssue({ code: "custom", message: "Image exceeds the per-image byte limit" });
return;
}
if (data.length % 4 !== 0) {
context.addIssue({ code: "custom", message: "Expected padded base64" });
return;
}
if (!isTranscriptImageBase64Alphabet(data)) {
context.addIssue({ code: "custom", message: "Expected valid base64" });
}
}),
})
.strict();
const TranscriptImageUnavailableSchema = z
Expand Down
55 changes: 54 additions & 1 deletion packages/infrastructure/session-client/src/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
import type { NotificationEvent } from "@omp-remote/protocol";
import type { NotificationEvent, Session, SessionTranscriptResponse } from "@omp-remote/protocol";
import { afterEach, beforeEach, describe, expect, it, type Mock, vi } from "vitest";
import {
applyTranscriptToSessions,
boundedServerError,
commandResultValue,
cleanupSessionHistory,
createCatalogLoadCoordinator,
dispatchNotificationEvent,
mergeSessions,
mergeTranscriptMessages,
type QueuedUserMessage,
rejectPendingCommands,
resolvePendingCommand,
sendBrowserCommand,
SESSION_COMMAND_TIMEOUT_MS,
snapshotSessionsWithCurrentMessages,
type TranscriptProvenance,
upsertTranscriptMessage,
useSessionClient,
} from "./index.js";

Expand All @@ -31,6 +39,51 @@ vi.mock("react", () => ({
},
}));

const SESSION: Session = {
id: "session-1",
source: "rpc",
name: "Stream test",
cwd: "/tmp/stream-test",
branch: "feature/streaming",
status: "running",
connected: true,
model: "openai/gpt-5.6",
contextPercent: 12,
createdAt: "2026-07-28T21:00:00.000Z",
lastActivity: "2026-07-28T22:00:00.000Z",
capabilities: ["prompt", "steer", "follow_up", "abort", "resume"],
messages: [
{
id: "message-1",
role: "assistant",
text: "Starting",
timestamp: "2026-07-28T22:01:00.000Z",
streaming: true,
presentation: "text",
},
],
sessionPath: "/tmp/session.jsonl",
activeSubagents: [],
skillCommands: [],
};
const makeMsg = (id: string, text = id, streaming = false): Session["messages"][number] => ({
id,
role: "user",
text,
timestamp: "2026-08-01T00:00:00.000Z",
streaming,
presentation: "text",
});
const makePage = (
sessionId: string,
messages: Session["messages"] = [],
status: "available" | "complete" | "unavailable" | "invalidated" = "complete",
olderCursor: string | null = null,
): SessionTranscriptResponse =>
(status === "available"
? { sessionId, messages, status: "available", olderCursor: olderCursor ?? "cursor" }
: { sessionId, messages, status, olderCursor: null }) as SessionTranscriptResponse;

class FakeWebSocket extends EventTarget {
static readonly OPEN = 1;
static readonly CLOSED = 3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,4 +254,3 @@ describe("application errors client support", () => {
expect(result).toEqual({ ok: true, clearedCount: 1 });
});
});

Loading