feat(orchestration): port thread title regeneration to the v2 runtime

Follow-ups from the main merge:

- Migration numbering: main's 035_ProjectionThreadTitleRegeneration is
  released and keeps its id; this branch's unreleased v2 migrations shift
  to 036-044 instead (a released migration can never be renumbered).
- thread.metadata.update accepts regenerateTitle: true arms an in-flight
  titleRegeneration marker on the thread payload (requestId + startedAt),
  a landing title or explicit false clears it. The marker projects onto
  thread shells and through the client-runtime shell model, so the
  sidebar's Regenerating state works unchanged.
- New ThreadTitleRegenerationService worker reacts to armed markers on
  the live domain-event stream (so ws, MCP, and mobile dispatches all
  behave the same): builds a newest-first conversation digest from the
  v2 projection (8k-char budget, retained attachments — ported from the
  v1 reactor), generates via TextGeneration, and lands the title with a
  follow-up metadata update. Failures clear the marker and log.
- The server advertises threadTitleRegeneration again, and the client
  updateThreadMetadata dispatches regenerateTitle-only updates.

Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
Julius MarmingeandClaude Fable 5 authored and maria-rcks committed 2026-08-03 11:45:15 -04:00
1 parent 607ddc3618
commit 353f352c1e
22 files changed
+272 -49

No files matched your search

@@ -146,6 +146,7 @@ export const make = Effect.gen(function* () {
threadSettlement: true,
threadSnooze: true,
threadVisitedTracking: true,
threadTitleRegeneration: true,
...(serverSelfUpdate === null ? {} : { serverSelfUpdate }),
...(serverSelfUpdate === "boot-service" ? { serverSelfUpdateProgress: true } : {}),
},
@@ -1138,6 +1138,13 @@ const makeOrchestrator = Effect.fn("orchestrationV2.Orchestrator.layer")(functio
...(command.title === undefined ? {} : { title: command.title }),
...(command.branch === undefined ? {} : { branch: command.branch }),
...(command.worktreePath === undefined ? {} : { worktreePath: command.worktreePath }),
// regenerateTitle: true arms the in-flight marker; a landing title
// or an explicit false (generation failed/abandoned) clears it.
...(command.regenerateTitle === true
? { titleRegeneration: { requestId: command.commandId, startedAt: now } }
: command.regenerateTitle === false || command.title !== undefined
? { titleRegeneration: null }
: {}),
updatedAt: now,
};
case "thread.runtime-mode.set":
@@ -843,6 +843,7 @@ export function threadShellFromProjection(
snoozedUntil: projection.thread.snoozedUntil ?? null,
snoozedAt: projection.thread.snoozedAt ?? null,
lastVisitedAt: projection.thread.lastVisitedAt,
titleRegeneration: projection.thread.titleRegeneration ?? null,
deletedAt: projection.thread.deletedAt,
};
}
@@ -1011,6 +1012,7 @@ function shellFromState(input: {
snoozedUntil: input.state.thread.snoozedUntil ?? null,
snoozedAt: input.state.thread.snoozedAt ?? null,
lastVisitedAt: input.state.thread.lastVisitedAt,
titleRegeneration: input.state.thread.titleRegeneration ?? null,
deletedAt: input.state.thread.deletedAt,
};
}
@@ -0,0 +1,160 @@
import { type ChatAttachment, CommandId, type ThreadId } from "@t3tools/contracts";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import * as Option from "effect/Option";
import * as Stream from "effect/Stream";
import * as ProjectService from "../project/ProjectService.ts";
import * as TextGeneration from "../textGeneration/TextGeneration.ts";
import { ThreadManagementService } from "./ThreadManagementService.ts";
const MAX_REGENERATION_ATTACHMENTS = 4;
const MAX_THREAD_TITLE_CONTEXT_CHARS = 8_000;
const THREAD_TITLE_CONTEXT_TRUNCATION_MARKER = "[Earlier content truncated]\n\n";
/**
* Newest-first conversation digest for the title prompt: walk messages from
* the end, keep whole sections while they fit the char budget, and mark
* truncation once older content stops fitting. Ported from the v1 reactor's
* regeneration flow.
*/
export function formatThreadTitleContext(
messages: ReadonlyArray<{
readonly role: "user" | "assistant" | "system";
readonly text: string;
readonly attachments?: ReadonlyArray<ChatAttachment> | undefined;
}>,
): {
readonly message: string;
readonly attachments: ReadonlyArray<ChatAttachment>;
} {
let context = "";
let truncated = false;
const retainedAttachments: Array<ChatAttachment> = [];
for (const message of messages.toReversed()) {
if (message.role === "system") {
continue;
}
const text = message.text.trim();
const attachmentSummary = (message.attachments ?? [])
.map((attachment) => attachment.name)
.join(", ");
const contents = [
...(text.length > 0 ? [text] : []),
...(attachmentSummary.length > 0 ? [`[Attachments: ${attachmentSummary}]`] : []),
].join("\n");
if (contents.length === 0) {
continue;
}
const section = `${message.role.toUpperCase()}:\n${contents}`;
const separator = context.length > 0 ? "\n\n" : "";
const available = MAX_THREAD_TITLE_CONTEXT_CHARS - context.length - separator.length;
if (section.length > available) {
truncated = true;
break;
}
context = `${section}${separator}${context}`;
for (const attachment of message.attachments ?? []) {
if (retainedAttachments.length < MAX_REGENERATION_ATTACHMENTS) {
retainedAttachments.push(attachment);
}
}
}
return {
message: truncated ? `${THREAD_TITLE_CONTEXT_TRUNCATION_MARKER}${context}` : context,
attachments: retainedAttachments,
};
}
/**
* Reacts to thread.metadata-updated events that arm the titleRegeneration
* marker: generates a title from the thread's conversation and lands it via a
* follow-up metadata update (which clears the marker), or clears the marker
* explicitly when generation fails. Event-driven so every dispatch surface
* (ws, MCP, mobile) gets the same behavior.
*/
export const workerLive = Layer.effectDiscard(
Effect.gen(function* () {
const threads = yield* ThreadManagementService;
const projects = yield* ProjectService.ProjectService;
const textGeneration = yield* TextGeneration.TextGeneration;
const handledRequestIds = new Set<string>();
const regenerate = Effect.fn("ThreadTitleRegenerationService.regenerate")(function* (
threadId: ThreadId,
requestId: CommandId,
) {
const projection = yield* threads.getThreadProjection(threadId);
if (projection.thread.titleRegeneration?.requestId !== requestId) {
return;
}
const project = yield* projects.getById(projection.thread.projectId);
if (Option.isNone(project)) {
return;
}
const context = formatThreadTitleContext(
projection.messages.filter((message) => !message.streaming),
);
if (context.message.length === 0) {
yield* threads.dispatch({
type: "thread.metadata.update",
commandId: CommandId.make(`${requestId}:title-clear`),
threadId,
regenerateTitle: false,
});
return;
}
const result = yield* textGeneration.generateThreadTitle({
cwd: projection.thread.worktreePath ?? Option.getOrThrow(project).workspaceRoot,
message: context.message,
attachments: context.attachments,
modelSelection: projection.thread.modelSelection,
});
yield* threads.dispatch({
type: "thread.metadata.update",
commandId: CommandId.make(`${requestId}:title`),
threadId,
title: result.title,
});
});
yield* threads.streamDomainEvents.pipe(
Stream.runForEach((event) => {
if (event.type !== "thread.metadata-updated") {
return Effect.void;
}
const marker = event.payload.titleRegeneration;
if (marker === null || marker === undefined || handledRequestIds.has(marker.requestId)) {
return Effect.void;
}
handledRequestIds.add(marker.requestId);
return regenerate(event.threadId, marker.requestId).pipe(
Effect.catchCause((cause) =>
Effect.logWarning("Thread title regeneration failed", {
threadId: event.threadId,
requestId: marker.requestId,
cause,
}).pipe(
Effect.andThen(
threads
.dispatch({
type: "thread.metadata.update",
commandId: CommandId.make(`${marker.requestId}:title-clear`),
threadId: event.threadId,
regenerateTitle: false,
})
.pipe(Effect.ignore),
),
),
),
Effect.forkDetach,
Effect.asVoid,
);
}),
Effect.forkScoped,
);
}),
);
@@ -27,6 +27,7 @@ import { layer as projectionMaintenanceLayer } from "./ProjectionMaintenance.ts"
import { layerFromProviderInstanceRegistry as providerAdapterRegistryLayerFromProviderInstances } from "./ProviderAdapterRegistry.ts";
import { layer as providerContinuationRequestsLayer } from "./ProviderContinuationRequests.ts";
import { workerLive as providerContinuationWorkerLive } from "./ProviderContinuationService.ts";
import { workerLive as threadTitleRegenerationWorkerLive } from "./ThreadTitleRegenerationService.ts";
import { layer as providerEventIngestorLayer } from "./ProviderEventIngestor.ts";
import { layer as providerSessionManagerLayer } from "./ProviderSessionManager.ts";
import { layer as providerRuntimeRecoveryLayer } from "./ProviderRuntimeRecoveryService.ts";
@@ -243,6 +244,9 @@ const providerContinuationWorkerProvided = providerContinuationWorkerLive.pipe(
Layer.mergeAll(providerContinuationRequestsLayer, threadManagementProvided, idAllocatorLayer),
),
);
const threadTitleRegenerationWorkerProvided = threadTitleRegenerationWorkerLive.pipe(
Layer.provide(Layer.merge(threadManagementProvided, ProjectServiceLayerLive)),
);
export const OrchestrationV2LayerLive = Layer.mergeAll(
orchestratorProvided,
@@ -257,6 +261,7 @@ export const OrchestrationV2LayerLive = Layer.mergeAll(
export const OrchestrationV2ProductionLayerLive = Layer.mergeAll(
OrchestrationLayerLive,
OrchestrationV2LayerLive,
threadTitleRegenerationWorkerProvided,
ProjectServiceLayerLive,
threadLaunchProvided,
threadLifecycleProvided,
+20 -18
View File
@@ -47,15 +47,16 @@ import Migration0031 from "./Migrations/031_AuthAuthorizationScopes.ts";
import Migration0032 from "./Migrations/032_AuthPairingProofKeyThumbprint.ts";
import Migration0033 from "./Migrations/033_ProjectionThreadsSettled.ts";
import Migration0034 from "./Migrations/034_ProjectionThreadsSnoozed.ts";
import Migration0035 from "./Migrations/035_OrchestrationV2.ts";
import Migration0036 from "./Migrations/036_OrchestrationV2Subagents.ts";
import Migration0037 from "./Migrations/037_OrchestrationV2Foundation.ts";
import Migration0038 from "./Migrations/038_OrchestrationV2ProviderSessionBindings.ts";
import Migration0039 from "./Migrations/039_OrchestrationV2ThreadLaunchWorkflows.ts";
import Migration0040 from "./Migrations/040_ApplicationEventSource.ts";
import Migration0041 from "./Migrations/041_OrchestrationV2EffectCancellation.ts";
import Migration0042 from "./Migrations/042_ScheduledTasks.ts";
import Migration0043 from "./Migrations/043_LegacyV1ImportState.ts";
import Migration0035 from "./Migrations/035_ProjectionThreadTitleRegeneration.ts";
import Migration0036 from "./Migrations/036_OrchestrationV2.ts";
import Migration0037 from "./Migrations/037_OrchestrationV2Subagents.ts";
import Migration0038 from "./Migrations/038_OrchestrationV2Foundation.ts";
import Migration0039 from "./Migrations/039_OrchestrationV2ProviderSessionBindings.ts";
import Migration0040 from "./Migrations/040_OrchestrationV2ThreadLaunchWorkflows.ts";
import Migration0041 from "./Migrations/041_ApplicationEventSource.ts";
import Migration0042 from "./Migrations/042_OrchestrationV2EffectCancellation.ts";
import Migration0043 from "./Migrations/043_ScheduledTasks.ts";
import Migration0044 from "./Migrations/044_LegacyV1ImportState.ts";
/**
* Migration loader with all migrations defined inline.
@@ -102,15 +103,16 @@ export const migrationEntries = [
[32, "AuthPairingProofKeyThumbprint", Migration0032],
[33, "ProjectionThreadsSettled", Migration0033],
[34, "ProjectionThreadsSnoozed", Migration0034],
[35, "OrchestrationV2", Migration0035],
[36, "OrchestrationV2Subagents", Migration0036],
[37, "OrchestrationV2Foundation", Migration0037],
[38, "OrchestrationV2ProviderSessionBindings", Migration0038],
[39, "OrchestrationV2ThreadLaunchWorkflows", Migration0039],
[40, "ApplicationEventSource", Migration0040],
[41, "OrchestrationV2EffectCancellation", Migration0041],
[42, "ScheduledTasks", Migration0042],
[43, "LegacyV1ImportState", Migration0043],
[35, "ProjectionThreadTitleRegeneration", Migration0035],
[36, "OrchestrationV2", Migration0036],
[37, "OrchestrationV2Subagents", Migration0037],
[38, "OrchestrationV2Foundation", Migration0038],
[39, "OrchestrationV2ProviderSessionBindings", Migration0039],
[40, "OrchestrationV2ThreadLaunchWorkflows", Migration0040],
[41, "ApplicationEventSource", Migration0041],
[42, "OrchestrationV2EffectCancellation", Migration0042],
[43, "ScheduledTasks", Migration0043],
[44, "LegacyV1ImportState", Migration0044],
] as const;
export const migrationManifest = migrationEntries.map(([id, name]) => [id, name] as const);
@@ -8,7 +8,7 @@ import * as NodeSqliteClient from "../NodeSqliteClient.ts";
const layer = it.layer(Layer.mergeAll(NodeSqliteClient.layerMemory()));
layer("035_036_OrchestrationV2", (it) => {
layer("036_037_OrchestrationV2", (it) => {
it.effect("keeps released and private migration ids contiguous", () =>
Effect.sync(() => {
assert.deepStrictEqual(
@@ -22,7 +22,7 @@ layer("035_036_OrchestrationV2", (it) => {
Effect.gen(function* () {
const sql = yield* SqlClient.SqlClient;
yield* runMigrations({ toMigrationInclusive: 35 });
yield* runMigrations({ toMigrationInclusive: 37 });
const migrations = yield* sql<{
readonly migration_id: number;
@@ -30,20 +30,24 @@ layer("035_036_OrchestrationV2", (it) => {
}>`
SELECT migration_id, name
FROM effect_sql_migrations
WHERE migration_id IN (33, 34, 35)
WHERE migration_id IN (34, 35, 36, 37)
ORDER BY migration_id
`;
assert.deepStrictEqual(migrations, [
{
migration_id: 33,
name: "ProjectionThreadsSettled",
},
{
migration_id: 34,
name: "OrchestrationV2",
name: "ProjectionThreadsSnoozed",
},
{
migration_id: 35,
name: "ProjectionThreadTitleRegeneration",
},
{
migration_id: 36,
name: "OrchestrationV2",
},
{
migration_id: 37,
name: "OrchestrationV2Subagents",
},
]);
@@ -63,7 +67,7 @@ layer("035_036_OrchestrationV2", (it) => {
it.effect("backfills provider-session thread bindings in migration 036", () =>
Effect.gen(function* () {
const sql = yield* SqlClient.SqlClient;
yield* runMigrations({ toMigrationInclusive: 36 });
yield* runMigrations({ toMigrationInclusive: 38 });
yield* sql`
INSERT INTO orchestration_v2_projection_provider_sessions (
provider_session_id,
@@ -88,7 +92,7 @@ layer("035_036_OrchestrationV2", (it) => {
)
`;
yield* runMigrations({ toMigrationInclusive: 37 });
yield* runMigrations({ toMigrationInclusive: 39 });
const bindings = yield* sql<{
readonly provider_session_id: string;
@@ -109,7 +113,7 @@ layer("035_036_OrchestrationV2", (it) => {
it.effect("preserves turn items with colliding ordinals in migration 037", () =>
Effect.gen(function* () {
const sql = yield* SqlClient.SqlClient;
yield* runMigrations({ toMigrationInclusive: 36 });
yield* runMigrations({ toMigrationInclusive: 37 });
yield* sql`
INSERT INTO orchestration_v2_projection_runs (
run_id,
@@ -146,7 +150,7 @@ layer("035_036_OrchestrationV2", (it) => {
('turn-item:d', 'thread:two', NULL, 42, 'assistant_message', 'completed', '2026-01-01T00:00:00.000Z', '{}')
`;
yield* runMigrations({ toMigrationInclusive: 37 });
yield* runMigrations({ toMigrationInclusive: 38 });
const positions = yield* sql<{
readonly thread_id: string;
@@ -171,14 +175,14 @@ it.effect("upgrades a database already at released main migration 034", () =>
Effect.gen(function* () {
const sql = yield* SqlClient.SqlClient;
yield* runMigrations({ toMigrationInclusive: 34 });
yield* runMigrations({ toMigrationInclusive: 35 });
const snoozeColumns = yield* sql<{ readonly name: string }>`
PRAGMA table_info(projection_threads)
`;
assert.ok(snoozeColumns.some((column) => column.name === "snoozed_until"));
assert.ok(snoozeColumns.some((column) => column.name === "snoozed_at"));
yield* runMigrations({ toMigrationInclusive: 43 });
yield* runMigrations({ toMigrationInclusive: 44 });
const migrations = yield* sql<{
readonly migration_id: number;
@@ -186,22 +190,23 @@ it.effect("upgrades a database already at released main migration 034", () =>
}>`
SELECT migration_id, name
FROM effect_sql_migrations
WHERE migration_id BETWEEN 34 AND 43
WHERE migration_id BETWEEN 34 AND 44
ORDER BY migration_id
`;
assert.deepStrictEqual(
migrations.map(({ migration_id, name }) => [migration_id, name]),
[
[34, "ProjectionThreadsSnoozed"],
[35, "OrchestrationV2"],
[36, "OrchestrationV2Subagents"],
[37, "OrchestrationV2Foundation"],
[38, "OrchestrationV2ProviderSessionBindings"],
[39, "OrchestrationV2ThreadLaunchWorkflows"],
[40, "ApplicationEventSource"],
[41, "OrchestrationV2EffectCancellation"],
[42, "ScheduledTasks"],
[43, "LegacyV1ImportState"],
[35, "ProjectionThreadTitleRegeneration"],
[36, "OrchestrationV2"],
[37, "OrchestrationV2Subagents"],
[38, "OrchestrationV2Foundation"],
[39, "OrchestrationV2ProviderSessionBindings"],
[40, "OrchestrationV2ThreadLaunchWorkflows"],
[41, "ApplicationEventSource"],
[42, "OrchestrationV2EffectCancellation"],
[43, "ScheduledTasks"],
[44, "LegacyV1ImportState"],
],
);
@@ -8,7 +8,7 @@ import * as NodeSqliteClient from "../NodeSqliteClient.ts";
it.effect("backfills the V2 event driver from payload before the legacy provider column", () =>
Effect.gen(function* () {
const sql = yield* SqlClient.SqlClient;
yield* runMigrations({ toMigrationInclusive: 36 });
yield* runMigrations({ toMigrationInclusive: 37 });
yield* sql`
INSERT INTO orchestration_v2_events (
@@ -37,7 +37,7 @@ it.effect("backfills the V2 event driver from payload before the legacy provider
)
`;
yield* runMigrations({ toMigrationInclusive: 37 });
yield* runMigrations({ toMigrationInclusive: 38 });
const events = yield* sql<{
readonly event_id: string;
@@ -12,7 +12,7 @@ layer("039_ApplicationEventSource", (it) => {
it.effect("moves V2 events and current project state behind one global sequence", () =>
Effect.gen(function* () {
const sql = yield* SqlClient.SqlClient;
yield* runMigrations({ toMigrationInclusive: 38 });
yield* runMigrations({ toMigrationInclusive: 40 });
yield* sql`
INSERT INTO orchestration_v2_events (
@@ -84,7 +84,7 @@ layer("039_ApplicationEventSource", (it) => {
)
`;
yield* runMigrations({ toMigrationInclusive: 39 });
yield* runMigrations({ toMigrationInclusive: 41 });
const events = yield* sql<{
readonly sequence: number;
@@ -12,7 +12,7 @@ layer("040_OrchestrationV2EffectCancellation", (it) => {
it.effect("preserves existing effects and adds the cancelled terminal status", () =>
Effect.gen(function* () {
const sql = yield* SqlClient.SqlClient;
yield* runMigrations({ toMigrationInclusive: 39 });
yield* runMigrations({ toMigrationInclusive: 41 });
yield* sql`
INSERT INTO orchestration_v2_effect_outbox (
effect_id,
@@ -47,7 +47,7 @@ layer("040_OrchestrationV2EffectCancellation", (it) => {
)
`;
yield* runMigrations({ toMigrationInclusive: 40 });
yield* runMigrations({ toMigrationInclusive: 42 });
yield* sql`
UPDATE orchestration_v2_effect_outbox
SET
@@ -84,6 +84,8 @@ export interface UpdateThreadMetadataInput extends ThreadCommandInput {
readonly modelSelection?: ModelSelection;
readonly branch?: string | null;
readonly worktreePath?: string | null;
/** Kick off an async title regeneration for the thread. */
readonly regenerateTitle?: boolean;
}
export interface SetThreadRuntimeModeInput extends ThreadCommandInput {
@@ -418,7 +420,8 @@ export const updateThreadMetadata = Effect.fn("EnvironmentCommands.updateThreadM
if (
input.title !== undefined ||
input.branch !== undefined ||
input.worktreePath !== undefined
input.worktreePath !== undefined ||
input.regenerateTitle !== undefined
) {
result = yield* dispatch({
type: "thread.metadata.update",
@@ -427,6 +430,7 @@ export const updateThreadMetadata = Effect.fn("EnvironmentCommands.updateThreadM
...(input.title === undefined ? {} : { title: input.title }),
...(input.branch === undefined ? {} : { branch: input.branch }),
...(input.worktreePath === undefined ? {} : { worktreePath: input.worktreePath }),
...(input.regenerateTitle === undefined ? {} : { regenerateTitle: input.regenerateTitle }),
});
}
if (input.modelSelection !== undefined) {
@@ -101,6 +101,8 @@ export interface EnvironmentThreadShell {
* local visited state they keep.
*/
readonly lastVisitedAt?: string | null;
/** Pending title regeneration marker; null when no request is in flight. */
readonly titleRegeneration?: { readonly requestId: string; readonly startedAt: string } | null;
readonly deletedAt: string | null;
readonly source: OrchestrationV2ThreadShell;
}
@@ -198,6 +200,13 @@ export function presentThreadShell(
...(thread.lastVisitedAt === undefined
? {}
: { lastVisitedAt: nullableIso(thread.lastVisitedAt) }),
titleRegeneration:
thread.titleRegeneration == null
? null
: {
requestId: thread.titleRegeneration.requestId,
startedAt: iso(thread.titleRegeneration.startedAt),
},
deletedAt: nullableIso(thread.deletedAt),
source: thread,
};
+28
View File
@@ -326,6 +326,15 @@ export const OrchestrationV2AppThread = Schema.Struct({
lastVisitedAt: Schema.NullOr(Schema.DateTimeUtc).pipe(
Schema.withDecodingDefault(Effect.succeed(null)),
),
/** In-flight title regeneration marker; cleared when a new title lands. */
titleRegeneration: Schema.optional(
Schema.NullOr(
Schema.Struct({
requestId: CommandId,
startedAt: Schema.DateTimeUtc,
}),
),
),
deletedAt: Schema.NullOr(Schema.DateTimeUtc),
});
export type OrchestrationV2AppThread = typeof OrchestrationV2AppThread.Type;
@@ -1222,6 +1231,15 @@ export const OrchestrationV2ThreadShell = Schema.Struct({
* back to their local visited state when the field is absent.
*/
lastVisitedAt: Schema.optional(Schema.NullOr(Schema.DateTimeUtc)),
/** In-flight title regeneration marker; null/absent when no request is pending. */
titleRegeneration: Schema.optional(
Schema.NullOr(
Schema.Struct({
requestId: CommandId,
startedAt: Schema.DateTimeUtc,
}),
),
),
deletedAt: Schema.NullOr(Schema.DateTimeUtc),
});
export type OrchestrationV2ThreadShell = typeof OrchestrationV2ThreadShell.Type;
@@ -1296,6 +1314,14 @@ export const OrchestrationV2AppThreadJson = OrchestrationV2AppThread.mapFields((
lastVisitedAt: Schema.NullOr(Schema.DateTimeUtcFromString).pipe(
Schema.withDecodingDefault(Effect.succeed(null)),
),
titleRegeneration: Schema.optional(
Schema.NullOr(
Schema.Struct({
requestId: CommandId,
startedAt: Schema.DateTimeUtcFromString,
}),
),
),
deletedAt: Schema.NullOr(Schema.DateTimeUtcFromString),
}));
export type OrchestrationV2AppThreadJson = typeof OrchestrationV2AppThreadJson.Type;
@@ -1903,6 +1929,8 @@ export const OrchestrationV2Command = Schema.Union([
commandId: CommandId,
threadId: ThreadId,
title: Schema.optional(TrimmedNonEmptyString),
/** Kick off (true) or abandon (false) an async title regeneration. */
regenerateTitle: Schema.optional(Schema.Boolean),
branch: Schema.optional(Schema.NullOr(TrimmedNonEmptyString)),
worktreePath: Schema.optional(Schema.NullOr(TrimmedNonEmptyString)),
expectedWorktreePath: Schema.optional(Schema.NullOr(TrimmedNonEmptyString)),