History

feat(orchestration): bound thread history and resume payloads

- Add paginated thread history with bounded snapshots and replay limits - Trim oversized wire payloads and support progressive mobile history loading

Julius Marminge committed 3 months ago

Commit 7d42d311 parent e3883a943 files · +4239 −211Browse files

Showing the changes to packages/client-runtime/src/state/shellReducer.test.ts (1 of 43 files). Show all

Unified · Split

packages/client-runtime/src/state/shellReducer.test.ts+24−0
@@ -214,6 +214,30 @@ describe("applyShellStreamEvent", () => { · 213 unmodified lines
214 expect(next.projects[0]?.repositoryIdentity).toEqual(repositoryIdentity);214 expect(next.projects[0]?.repositoryIdentity).toEqual(repositoryIdentity);
215 });215 });
216 216
217 it("treats higher-sequence compact enrichment as metadata-only", () => {
218 const previous = {
219 ...v2ShellSnapshot,
220 snapshotSequence: 5,
221 projects: [{ ...v2Project, repositoryIdentity: null }],
222 threads: [{ ...v2ThreadShell, title: "Newest title" }],
223 };
224 const next = mergeShellSnapshotProjects(
225 previous,
226 {
227 ...v2ShellSnapshot,
228 snapshotSequence: 8,
229 projects: [{ ...v2Project, repositoryIdentity }],
230 threads: [],
231 archivedThreads: [],
232 },
233 { resolvedRepositoryIdentityRoots: [v2Project.workspaceRoot] },
234 );
235
236 expect(next.snapshotSequence).toBe(5);
237 expect(next.threads[0]?.title).toBe("Newest title");
238 expect(next.projects[0]?.repositoryIdentity).toEqual(repositoryIdentity);
239 });
240
217 it("lower-sequence enrichment cannot resurrect empty structural state", () => {241 it("lower-sequence enrichment cannot resurrect empty structural state", () => {
218 const previous = {242 const previous = {
219 ...v2ShellSnapshot,243 ...v2ShellSnapshot,