@devries-cameron20 / t3code-1 / commits / a773dc38ac
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(server): t3_thread_organize rejects unknown arguments instead of archiving the caller (#26718)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Julius Marminge committed Oct 29, 2026 at 20:43 UTC a773dc38ac75177b6cd133d27df00ca0a83f9480
2 files changed +43
apps/server/src/mcp/toolkits/core.test.ts
+42
@@ -350,6 +350,48 @@ it.effect("records only failed calls of tools that hand off no work", () => {
350 );
351 });
352
353 +it.effect("rejects an unknown organize target instead of archiving the calling thread", () => {
354 + const dispatched: Array<unknown> = [];
355 + return Effect.gen(function* () {
356 + const server = yield* McpServer.McpServer;
357 + const outcome = yield* server
358 + .callTool({
359 + name: "t3_thread_organize",
360 + arguments: { action: "archive", threadIds: ["other-thread"] },
361 + })
362 + .pipe(
363 + Effect.provideService(McpInvocationContext.McpInvocationContext, scope),
364 + Effect.provideService(McpSchema.McpServerClient, client),
365 + Effect.result,
366 + );
367 + expect(dispatched).toEqual([]);
368 + expect(outcome).toMatchObject({
369 + _tag: "Failure",
370 + failure: { message: expect.stringContaining("Expected no excess property") },
371 + });
372 + }).pipe(
373 + Effect.provide(
374 + layerThreadToolkit.pipe(
375 + Layer.provideMerge(McpServer.McpServer.layer),
376 + Layer.provide(NodeCrypto.layer),
377 + Layer.provide(
378 + Layer.mock(ThreadManagement.ThreadManagementService)({
379 + getThreadShell: (id) => Effect.succeed(McpToolAccessTestkit.liveThreadShell(id)),
380 + getProjectThreadRecords: ({ threadId: id }) =>
381 + Effect.succeed(
382 + McpToolAccessTestkit.idleThreadProjection(McpToolAccessTestkit.liveThreadShell(id)),
383 + ),
384 + dispatch: (command) => {
385 + dispatched.push(command);
386 + return Effect.succeed({ sequence: 1 } as never);
387 + },
388 + }),
389 + ),
390 + ),
391 + ),
392 + );
393 +});
394 +
395 it.effect("keeps unexpected handler defects private through the production registration", () =>
396 Effect.gen(function* () {
397 const server = yield* McpServer.McpServer;
apps/server/src/mcp/toolkits/thread/tools.ts
+1
@@ -61,6 +61,7 @@ const ThreadOrganizeTool = Tool.make("t3_thread_organize", {
61 ],
62 })
63 .annotate(Tool.Title, "Organize a thread")
64 + .annotate(Tool.Strict, true)
65 .annotate(Tool.Destructive, true);
66
67 const commandTool = {