Open History to see the last commit
1import {
2 DEFAULT_TEXT_GENERATION_MODEL,
3 ProviderInstanceId,
4 type ModelSelection,
5 type OrchestrationThread,
6} from "@t3tools/contracts";
7
8export function makeHandoverModelSelection(instanceId: ProviderInstanceId): ModelSelection {
9 return {
10 instanceId,
11 model: DEFAULT_TEXT_GENERATION_MODEL,
12 options: [{ id: "reasoningEffort", value: "high" }],
13 };
14}
15
16export function formatThreadForHandover(thread: OrchestrationThread): string {
17 const metadata = [
18 `Title: ${thread.title}`,
19 `Branch: ${thread.branch ?? "none"}`,
20 `Worktree: ${thread.worktreePath ?? "project checkout"}`,
21 ];
22 const messages = thread.messages
23 .filter((message) => message.role !== "system")
24 .map((message) => `## ${message.role === "user" ? "User" : "Assistant"}\n\n${message.text}`);
25 return ["# Thread metadata", ...metadata, "", "# Conversation", ...messages].join("\n");
26}