Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): keep the child thread open when its remote parent was deleted #27436

MergedScottN-PV(GitHub profile, opens in a new tab)merged 5 commits intomain fromrefs/pull/27436/headmerged by juliusmarminge View on GitHub

Showing 3 changed files with 167 additions and 6 deletions.

x
0 of 3 viewed, 3 left
127 additions and 0 deletionsapps/web/src/components/chat/ThreadRelationshipsControl.remote-parent.browser.test.tsxAdded
View file
@@ -0,0 +1,127 @@
+import { EnvironmentId, ThreadId, type OrchestrationV2ThreadShell } from "@t3tools/contracts";
+import * as Cause from "effect/Cause";
+import { expect, it, vi } from "vite-plus/test";
+​
+import { act, render, type Screen } from "../../../test/render";
+​
+const { read, toast } = vi.hoisted(() => ({
+ read: vi.fn<(input: unknown) => Promise<unknown>>(),
+ toast: vi.fn(),
+}));
+​
+const childEnvironmentId = EnvironmentId.make("child-environment");
+const childThreadId = ThreadId.make("child-thread");
+const parentEnvironmentId = EnvironmentId.make("parent-environment");
+// The panel reads only identity, lineage and delegation from the current thread.
+const child = {
+ id: childThreadId,
+ title: "Child",
+ lineage: { rootThreadId: childThreadId, parentThreadId: null, relationshipToParent: null },
+ forkedFrom: null,
+ delegatedFrom: {
+ environmentId: parentEnvironmentId,
+ threadId: ThreadId.make("parent-thread"),
+ title: "Parent",
+ },
+} as Partial<OrchestrationV2ThreadShell> as OrchestrationV2ThreadShell;
+​
+vi.mock(import("../../state/orchestration"), async (original) => ({
+ ...(await original()),
+ threadTitlesRead: {