Skip to content

Commit 01547bb

Browse files
donjor-agent[bot]donjor
authored andcommitted
feat(server): thread groups live on the server with agent tools (#1840)
## Problem Sidebar thread groups live only in each browser's local storage. - **Agents:** cannot read or edit groups - **Launches:** children land outside the group - **Clients:** a second browser or device sees none ## Change Groups now live per environment on the server. - **Server:** `ThreadGroupsServiceFork` - Table: `fork_thread_groups` - **RPCs:** - `threadGroups.subscribeFork` - `threadGroups.mutateFork` - **Capability:** optional `threadGroupsFork` - Upstream web and mobile clients ignore it - **Reducer:** one, shared in contracts - **MCP tools:** - `t3_thread_group_list` - `t3_thread_group_update` - **Launch:** joins the caller's group by default - `group`: an existing `{groupId}`, or `"none"` - New groups: `t3_thread_group_update` - Batch launches place each accepted thread - **Web:** follows the server, optimistic edits - Pending edits replay over newer snapshots - Replies older than the held revision drop - **Collapsed state:** stays per client - **Legacy:** local groups import once - A failed import retries Known gap: launched threads still get `parentThreadId: null`; lineage is a separate follow-up. ## Scope and approval Fork-only feature, scoped by the maintainer in the T3 thread: per-environment groups, launch auto-join with opt-out, per-client collapse. ## Verification Isolated dev server on a seeded worktree `.t3` home. Client 1 is host Chrome; client 2 is Firefox in a QA VM over an SSH tunnel. 1. Agent (GPT-6-Astra via Codex) groups 3 threads 2. "Agent group" appears live on both clients 3. Agent launches a child with no `group` option 4. Child joins: "Agent group (4)" on both clients https://github.com/user-attachments/assets/80208be1-44dd-4918-84ce-e3f11fef4a00 **Host Chrome** ![c1-launch2.png](https://github.com/user-attachments/assets/23920100-e333-47a9-9791-c8b3c980e707) **VM Firefox** ![c2-launch2.png](https://github.com/user-attachments/assets/3236987b-8996-4add-a700-c2c3a55e4cc1) **Checks** - [x] `apps/server: vp run typecheck` → exit 0 - [x] `vp run fork:ci` → exit 0 - [x] `apps/server: vp run build:bundle` → exit 0 - [x] `apps/web: vp run build` → exit 0 - [x] MCP registration test fails on old params - [ ] `vp run check:changed` → exit 1 - 5005/5006 pass - Fails: GitManager "includes CLAUDE.md" - Cause: local global git config - Passes with `GIT_CONFIG_GLOBAL=/dev/null` Claude Opus 5.5 via Claude Code in T3 Code. ## Fork trailers Squashes: - 50aba4d feat(server): thread groups live on the server with agent tools (#1840) (#1840) - ef3cc72 fixup! feat(server): thread groups live on the server with agent tools (#1840) (#1840) - ad6dbd0 feat(server): thread groups live on the server with agent tools (#1840) (#1840) - 32d73f7 fixup! feat(server): thread groups live on the server with agent tools (#1840) (#1840) Fork-Domain: thread-ordering Fork-Tier: qol Co-authored-by: donjor <[email protected]>
1 parent 41187c6 commit 01547bb

50 files changed

Lines changed: 2002 additions & 543 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎apps/server/src/auth/RpcAuthorization.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ export const RPC_REQUIRED_SCOPES = {
167167
[WS_METHODS.agentSessionsScan]: AuthOrchestrationReadScope,
168168
[WS_METHODS.agentSessionsImport]: AuthOrchestrationOperateScope,
169169
[WS_METHODS.threadCheckoutMoveRequest]: AuthOrchestrationOperateScope, // fork-hook: zmux-estate/checkout-move-rpc-auth
170+
[WS_METHODS.threadGroupsSubscribeFork]: AuthOrchestrationReadScope, // fork-hook: thread-ordering/thread-groups-rpc-auth
171+
[WS_METHODS.threadGroupsMutateFork]: AuthOrchestrationOperateScope, // fork-hook: thread-ordering/thread-groups-rpc-auth
170172
[WS_METHODS.assetsCreateUrl]: AuthOrchestrationReadScope,
171173
[WS_METHODS.assetsPersistChatAttachments]: AuthOrchestrationOperateScope,
172174
[WS_METHODS.attachmentsCreateUploadUrl]: AuthOrchestrationOperateScope,

‎apps/server/src/environment/ServerEnvironment.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ export const make = Effect.gen(function* () {
224224
pullRequestChecks: true,
225225
threadIssues: true, // fork-hook: github-issues/server-environment-thread-issues-capability
226226
githubIssueStateChange: true, // fork-hook: github-issues/server-environment-state-change-capability
227+
threadGroupsFork: true, // fork-hook: thread-ordering/server-environment-thread-groups-capability
227228
inlineMessageContext: true,
228229
requiredWorktreeBootstrap: true,
229230
threadSettlement: true,

‎apps/server/src/mcp/McpHttpServer.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ import * as PullRequestsHandlers from "./toolkits/pullRequests/handlers.ts";
7070
import { PullRequestsToolkit } from "./toolkits/pullRequests/tools.ts";
7171
import { IssuesToolkitHandlersLiveFork } from "./toolkits/issues/handlers.fork.ts"; // fork-hook: github-issues/mcp-issues-toolkit-import
7272
import { IssuesToolkitFork } from "./toolkits/issues/tools.fork.ts"; // fork-hook: github-issues/mcp-issues-toolkit-import
73+
import { ThreadGroupsToolkitHandlersLiveFork } from "./toolkits/threadGroups/handlers.fork.ts"; // fork-hook: thread-ordering/mcp-thread-groups-toolkit-import
74+
import { ThreadGroupsToolkitFork } from "./toolkits/threadGroups/tools.fork.ts"; // fork-hook: thread-ordering/mcp-thread-groups-toolkit-import
7375
import * as DeviceHandlers from "./toolkits/device/handlers.ts";
7476
import {
7577
DeviceScreenshotTool,
@@ -1188,6 +1190,7 @@ export const layerTools = Layer.mergeAll(
11881190
layerWorktreeToolkitRegistration,
11891191
layerPullRequestsToolkit,
11901192
toolkitRegistration(IssuesToolkitFork, IssuesToolkitHandlersLiveFork), // fork-hook: github-issues/mcp-issues-toolkit
1193+
toolkitRegistration(ThreadGroupsToolkitFork, ThreadGroupsToolkitHandlersLiveFork), // fork-hook: thread-ordering/mcp-thread-groups-toolkit
11911194
layerDeviceToolkit,
11921195
layerHtmlToolkit,
11931196
);

‎apps/server/src/mcp/OrchestratorMcpService.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { delegatedRoundProgressFork } from "../orchestration-v2/delegatedRounds.fork.ts"; // fork-hook: delegated-rounds/mcp-progress-import
2+
import { LaunchedThreadPlacementFork } from "../orchestration-v2/ThreadGroupsService.fork.ts"; // fork-hook: thread-ordering/mcp-launch-group-import
23
import {
34
CommandId,
45
type RunId,
@@ -2673,6 +2674,7 @@ const make = Effect.gen(function* () {
26732674
),
26742675
),
26752676
);
2677+
yield* (yield* LaunchedThreadPlacementFork)(threadId); // fork-hook: thread-ordering/mcp-launch-group
26762678
// A receipt can appear after target resolution; use the committed thread's selection.
26772679
const resolvedModelSelection = (yield* threadManagement
26782680
.getThreadRecords(threadId, [])

‎apps/server/src/mcp/toolkits/orchestrator/handlers.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import * as McpToolAccess from "../../McpToolAccess.ts";
1111
import * as OrchestratorMcpService from "../../OrchestratorMcpService.ts";
1212
import * as ThreadMetadataMcpService from "../../ThreadMetadataMcpService.ts";
1313
import { threadWorkHandlersFork } from "./threadWork.fork.ts"; // fork-hook: device-auth/mcp-thread-work
14+
import { placeLaunchedThreadsFork, prepareLaunchGroupFork } from "../threadGroups/handlers.fork.ts"; // fork-hook: thread-ordering/mcp-launch-group-import
1415

1516
const handlers = {
1617
orchestrator_capabilities: McpToolAccess.reads((input) =>
@@ -143,7 +144,8 @@ const handlers = {
143144
Effect.gen(function* () {
144145
const scope = yield* McpInvocationContext.McpInvocationContext;
145146
const service = yield* OrchestratorMcpService.OrchestratorMcpService;
146-
return yield* service.createThreads(scope, input);
147+
const joinGroup = yield* prepareLaunchGroupFork(scope.thread?.threadId, input.group); // fork-hook: thread-ordering/mcp-launch-group
148+
return yield* service.createThreads(scope, input).pipe(placeLaunchedThreadsFork(joinGroup)); // fork-hook: thread-ordering/mcp-launch-group
147149
}),
148150
),
149151
t3_thread_list: McpToolAccess.reads((input) =>

‎apps/server/src/mcp/toolkits/project/handlers.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import * as McpInvocationContext from "../../McpInvocationContext.ts";
2525
import * as McpToolAccess from "../../McpToolAccess.ts";
2626
import { newCommandId, readCaller, resolveProjectId, unavailable } from "../../threadAccess.ts";
2727
import { ProjectToolkit } from "./tools.ts";
28+
import { placeLaunchedThreadsFork, prepareLaunchGroupFork } from "../threadGroups/handlers.fork.ts"; // fork-hook: thread-ordering/mcp-launch-group-import
2829

2930
function projectFailure(error: Project.ProjectServiceError) {
3031
if (error._tag === "ProjectOperationError") return unavailable();
@@ -195,6 +196,7 @@ export const layer = McpToolAccess.toLayer(ProjectToolkit, {
195196
Effect.orElseSucceed(() => runtimeMode),
196197
)
197198
: runtimeMode;
199+
const joinGroup = yield* prepareLaunchGroupFork(caller?.id, input.group); // fork-hook: thread-ordering/mcp-launch-group
198200
const result = yield* ThreadMessageIntake.launchThread({
199201
commandId,
200202
threadId,
@@ -235,6 +237,7 @@ export const layer = McpToolAccess.toLayer(ProjectToolkit, {
235237
}
236238
return unavailable();
237239
}),
240+
placeLaunchedThreadsFork(joinGroup), // fork-hook: thread-ordering/mcp-launch-group
238241
);
239242
const thread = result.projection.thread;
240243
const run = result.projection.runs.find((run) => run.userMessageId === messageId);

‎apps/server/src/mcp/toolkits/project/tools.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import * as ThreadManagementService from "../../../orchestration-v2/ThreadManage
3434
import * as SourceControlRepositoryService from "../../../sourceControl/SourceControlRepositoryService.ts";
3535
import * as GitVcsDriver from "../../../vcs/GitVcsDriver.ts";
3636
import * as McpInvocationContext from "../../McpInvocationContext.ts";
37+
import { ThreadLaunchGroupFork } from "@t3tools/contracts"; // fork-hook: thread-ordering/mcp-launch-group-import
3738

3839
const shared = {
3940
success: Project,
@@ -146,6 +147,7 @@ const ThreadLaunchTool = Tool.make("t3_thread_launch", {
146147
}),
147148
),
148149
attachments: Schema.optional(Schema.Array(McpAttachmentInput).check(Schema.isMaxLength(8))),
150+
group: Schema.optional(ThreadLaunchGroupFork), // fork-hook: thread-ordering/mcp-launch-group
149151
clientRequestId: Schema.optional(OrchestratorMcpClientRequestId),
150152
/** Set by a linked environment launching its agent's delegated task here; ignored otherwise. */
151153
delegatedFrom: Schema.optional(OrchestrationV2DelegatedFrom),
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
import * as NodeCrypto from "@effect/platform-node/NodeCrypto";
2+
import { assert, it } from "@effect/vitest";
3+
import { EnvironmentId, ProviderInstanceId, ThreadId } from "@t3tools/contracts";
4+
import * as NodeSqliteClient from "@t3tools/shared/nodeSqliteClient";
5+
import * as Effect from "effect/Effect";
6+
import * as Exit from "effect/Exit";
7+
import * as Layer from "effect/Layer";
8+
import * as Stream from "effect/Stream";
9+
import type { Tool } from "effect/ai";
10+
import { McpServer } from "effect/ai";
11+
12+
import * as ThreadGroups from "../../../orchestration-v2/ThreadGroupsService.fork.ts";
13+
import { ensureForkSchema } from "../../../persistence/ForkSchema.ts";
14+
import * as McpHttpServer from "../../McpHttpServer.ts";
15+
import * as McpInvocationContext from "../../McpInvocationContext.ts";
16+
import * as McpToolAccess from "../../McpToolAccess.ts";
17+
import * as McpToolAccessTestkit from "../../McpToolAccess.testkit.ts";
18+
import { prepareLaunchGroupFork, ThreadGroupsToolkitHandlersLiveFork } from "./handlers.fork.ts";
19+
import { ThreadGroupsToolkitFork } from "./tools.fork.ts";
20+
21+
const orchestrator = ThreadId.make("orchestrator");
22+
const first = ThreadId.make("first");
23+
const second = ThreadId.make("second");
24+
25+
const invocation: McpInvocationContext.McpInvocationScope = {
26+
environmentId: EnvironmentId.make("environment-1"),
27+
requestNamespace: "provider-session:provider-session-1",
28+
thread: {
29+
threadId: orchestrator,
30+
providerSessionId: "provider-session-1",
31+
providerInstanceId: ProviderInstanceId.make("codex"),
32+
},
33+
client: undefined,
34+
capabilities: new Set(["orchestration"]),
35+
issuedAt: 1,
36+
};
37+
38+
// Every thread is live and titled by its id; each test gets a fresh database.
39+
const services = ThreadGroups.layer.pipe(
40+
Layer.provide(Layer.effectDiscard(ensureForkSchema())),
41+
Layer.provideMerge(
42+
Layer.mergeAll(
43+
NodeSqliteClient.layer({ filename: ":memory:" }),
44+
NodeCrypto.layer,
45+
McpToolAccessTestkit.liveThreadsLayer,
46+
),
47+
),
48+
);
49+
50+
const call = <Name extends keyof typeof ThreadGroupsToolkitFork.tools>(
51+
name: Name,
52+
params: Tool.Parameters<(typeof ThreadGroupsToolkitFork.tools)[Name]>,
53+
) =>
54+
ThreadGroupsToolkitFork.pipe(
55+
Effect.flatMap((toolkit) => toolkit.handle(name, params as never)),
56+
Stream.unwrap,
57+
Stream.runCollect,
58+
Effect.map(
59+
(chunk) => chunk.at(-1)!.result as Tool.Success<(typeof ThreadGroupsToolkitFork.tools)[Name]>,
60+
),
61+
Effect.provide(McpToolAccess.HandlersLayer.layer(ThreadGroupsToolkitHandlersLiveFork)),
62+
Effect.provideService(McpInvocationContext.McpInvocationContext, invocation),
63+
);
64+
65+
const startGroup = ThreadGroups.ThreadGroupsServiceFork.pipe(
66+
Effect.flatMap((groups) =>
67+
groups.mutate({
68+
type: "set-membership",
69+
threadIds: [orchestrator, first],
70+
target: { type: "new", groupId: "g1", title: "Work", asParent: true },
71+
}),
72+
),
73+
);
74+
75+
it.effect("agents move threads into the caller's group and list it by name", () =>
76+
Effect.gen(function* () {
77+
yield* startGroup;
78+
yield* call("t3_thread_group_update", {
79+
edit: {
80+
type: "set-membership",
81+
threadIds: [second],
82+
target: { type: "existing", groupId: "g1" },
83+
},
84+
});
85+
assert.deepStrictEqual(yield* call("t3_thread_group_list", {}), {
86+
groups: [
87+
{
88+
id: "g1",
89+
title: "Work",
90+
parentThreadId: orchestrator,
91+
threads: [orchestrator, first, second].map((threadId) => ({ threadId, title: threadId })),
92+
},
93+
],
94+
callerGroupId: "g1",
95+
});
96+
}).pipe(Effect.provide(services)),
97+
);
98+
99+
it.effect("launches join the caller's group by default and refuse an unknown group", () =>
100+
Effect.gen(function* () {
101+
yield* startGroup;
102+
const groups = yield* ThreadGroups.ThreadGroupsServiceFork;
103+
const ungrouped = yield* prepareLaunchGroupFork(orchestrator, "none");
104+
yield* ungrouped(second);
105+
assert.strictEqual(yield* groups.groupOf(second), undefined);
106+
107+
const joinCaller = yield* prepareLaunchGroupFork(orchestrator, undefined);
108+
yield* joinCaller(second);
109+
assert.deepStrictEqual((yield* groups.groupOf(second))?.threadIds, [
110+
orchestrator,
111+
first,
112+
second,
113+
]);
114+
// The thread already exists, so a group removed mid-launch must not fail it.
115+
yield* groups.mutate({ type: "remove", groupId: "g1" });
116+
yield* joinCaller(first);
117+
assert.strictEqual(yield* groups.groupOf(first), undefined);
118+
119+
const unknown = yield* prepareLaunchGroupFork(orchestrator, { groupId: "gone" }).pipe(
120+
Effect.exit,
121+
);
122+
assert.ok(Exit.isFailure(unknown));
123+
}).pipe(Effect.provide(services)),
124+
);
125+
126+
// MCP refuses a tool whose parameters lack an object root, crashing startup.
127+
it.effect("registers with an MCP server", () =>
128+
Effect.void.pipe(
129+
Effect.provide(
130+
McpHttpServer.toolkitRegistration(
131+
ThreadGroupsToolkitFork,
132+
ThreadGroupsToolkitHandlersLiveFork,
133+
).pipe(Layer.provideMerge(McpServer.McpServer.layer), Layer.provideMerge(services)),
134+
),
135+
),
136+
);
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
// Fork-owned handlers for the thread group MCP tools (thread-ordering), plus
2+
// the launch hook that places agent-launched threads. Both act through
3+
// `ThreadGroupsServiceFork`, so every client sees the change live.
4+
import {
5+
isThreadGroupErrorFork,
6+
OrchestratorMcpFailure,
7+
type ThreadId,
8+
type ThreadLaunchGroupFork,
9+
} from "@t3tools/contracts";
10+
import * as Effect from "effect/Effect";
11+
import * as Option from "effect/Option";
12+
13+
import * as ThreadGroups from "../../../orchestration-v2/ThreadGroupsService.fork.ts";
14+
import * as McpToolAccess from "../../McpToolAccess.ts";
15+
import { readCaller, unavailable } from "../../threadAccess.ts";
16+
import { ThreadGroupsToolkitFork } from "./tools.fork.ts";
17+
18+
export const ThreadGroupsToolkitHandlersLiveFork = McpToolAccess.toLayer(ThreadGroupsToolkitFork, {
19+
t3_thread_group_list: McpToolAccess.reads(() =>
20+
Effect.gen(function* () {
21+
const { caller } = yield* readCaller();
22+
const groups = yield* ThreadGroups.ThreadGroupsServiceFork;
23+
return yield* groups.list(caller?.id).pipe(Effect.mapError(unavailable));
24+
}),
25+
),
26+
t3_thread_group_update: McpToolAccess.writesThreads(
27+
({ edit }) => (edit.type === "set-membership" ? edit.threadIds : []),
28+
({ edit }) =>
29+
Effect.gen(function* () {
30+
// Thread control, as for the other thread tools.
31+
const { caller } = yield* readCaller();
32+
const groups = yield* ThreadGroups.ThreadGroupsServiceFork;
33+
return yield* groups
34+
.edit(edit, caller?.id)
35+
.pipe(
36+
Effect.mapError((error) => (isThreadGroupErrorFork(error) ? error : unavailable())),
37+
);
38+
}),
39+
),
40+
});
41+
42+
/**
43+
* The launch tools' view of `prepareLaunch`. The service is read from the
44+
* handler's build context rather than declared on the upstream launch tools,
45+
* whose tests build without it.
46+
*/
47+
export const prepareLaunchGroupFork = Effect.fn("ThreadGroupsToolkitFork.prepareLaunchGroup")(
48+
function* (callerThreadId: ThreadId | undefined, group: ThreadLaunchGroupFork | undefined) {
49+
const service = Option.getOrUndefined(
50+
yield* Effect.serviceOption(ThreadGroups.ThreadGroupsServiceFork),
51+
);
52+
if (service === undefined) {
53+
if (typeof group !== "object") return (_threadId: ThreadId) => Effect.void;
54+
return yield* new OrchestratorMcpFailure({
55+
code: "invalid_request",
56+
message: "This environment has no thread groups. No thread was created.",
57+
});
58+
}
59+
return yield* service.prepareLaunch(callerThreadId, group).pipe(
60+
Effect.mapError(
61+
(error) =>
62+
new OrchestratorMcpFailure({
63+
code: "invalid_request",
64+
message: `${error.message} No thread was created; t3_thread_group_list lists the groups.`,
65+
}),
66+
),
67+
);
68+
},
69+
);
70+
71+
/** Runs a batch launch so each thread it accepts joins as it is accepted. */
72+
export const placeLaunchedThreadsFork =
73+
(join: (threadId: ThreadId) => Effect.Effect<void>) =>
74+
<A, E, R>(launch: Effect.Effect<A, E, R>) =>
75+
Effect.provideService(launch, ThreadGroups.LaunchedThreadPlacementFork, join);
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// Fork-owned MCP tools for the environment's sidebar thread groups
2+
// (thread-ordering). `McpHttpServer.ts` registers them through the marked
3+
// `thread-ordering/mcp-thread-groups-toolkit` hook.
4+
import {
5+
OrchestratorMcpFailure,
6+
ThreadGroupEditFork,
7+
ThreadGroupErrorFork,
8+
ThreadGroupsDescribedFork,
9+
} from "@t3tools/contracts";
10+
import * as Schema from "effect/Schema";
11+
import * as Tool from "effect/ai/Tool";
12+
import * as Toolkit from "effect/ai/Toolkit";
13+
14+
import * as ThreadManagementService from "../../../orchestration-v2/ThreadManagementService.ts";
15+
import * as ThreadGroups from "../../../orchestration-v2/ThreadGroupsService.fork.ts";
16+
import * as McpInvocationContext from "../../McpInvocationContext.ts";
17+
18+
const dependencies = [
19+
McpInvocationContext.McpInvocationContext,
20+
ThreadManagementService.ThreadManagementService,
21+
ThreadGroups.ThreadGroupsServiceFork,
22+
];
23+
24+
const ThreadGroupListTool = Tool.make("t3_thread_group_list", {
25+
description:
26+
"List the sidebar thread groups in this environment: each group's id, title, parent thread, and member threads, plus the calling thread's group. Groups are visual only; they do not change how threads run.",
27+
success: ThreadGroupsDescribedFork,
28+
failure: OrchestratorMcpFailure,
29+
dependencies,
30+
})
31+
.annotate(Tool.Title, "List thread groups")
32+
.annotate(Tool.Readonly, true)
33+
.annotate(Tool.Destructive, false)
34+
.annotate(Tool.Idempotent, true)
35+
.annotate(Tool.OpenWorld, false);
36+
37+
const ThreadGroupUpdateTool = Tool.make("t3_thread_group_update", {
38+
description:
39+
'Change the sidebar thread groups every client of this environment shows. Pass one change as edit. type="set-membership" moves threadIds into target {type:"existing",groupId}, a {type:"new",title} group of at least two threads, or out of any group with {type:"none"}; asParent makes the first thread the group\'s parent, shown first with the rest under it. type="rename" retitles a group, "set-parent" sets or clears (null) its parent, "remove" dissolves it without touching its threads. A thread belongs to at most one group, and a group left with fewer than two threads dissolves. Returns every group after the change.',
40+
// MCP needs an object root, so the edit union sits under one key.
41+
parameters: Schema.Struct({ edit: ThreadGroupEditFork }),
42+
success: ThreadGroupsDescribedFork,
43+
failure: Schema.Union([OrchestratorMcpFailure, ThreadGroupErrorFork]),
44+
dependencies,
45+
})
46+
.annotate(Tool.Title, "Update thread groups")
47+
.annotate(Tool.Readonly, false)
48+
.annotate(Tool.Destructive, false)
49+
.annotate(Tool.Idempotent, false)
50+
.annotate(Tool.OpenWorld, false);
51+
52+
export const ThreadGroupsToolkitFork = Toolkit.make(ThreadGroupListTool, ThreadGroupUpdateTool);

0 commit comments

Comments
 (0)