The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 22, 07:00 UTC
perf(server): skip redundant claude session naming (#28910)
maria committed
Nov 2, 2026 at 20:46 UTC
cbd3e149a130f1d99d2d067c77b9889d64e28755
2 files changed
+12
apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts
+8
@@ -2601,6 +2601,7 @@ describe("ClaudeAdapterV2 MCP credential channel", () => {
2601
...ClaudeAdapterV2.makeClaudeQueryOptions({
2602
modelSelection: CLAUDE_TEST_MODEL_SELECTION,
2603
nativeThreadId: "native-thread-claude-mcp-channel",
2604
+ title: "Existing T3 title",
2605
resume: false,
2606
cwd: null,
2607
environment: { PATH: "/usr/bin" },
@@ -2655,7 +2656,12 @@ describe("ClaudeAdapterV2 MCP credential channel", () => {
2656
subtype: "mcp_set_servers",
2657
servers: { "t3-code": t3McpServer },
2658
});
2659
+ assert.deepInclude(
2660
+ cli.controlRequests.find((request) => Reflect.get(request, "subtype") === "initialize"),
2661
+ { title: "Existing T3 title" },
2662
+ );
2663
const spawned = JSON.stringify(cli.spawns);
2664
+ assert.notInclude(spawned, "--title");
2665
assert.notInclude(spawned, "--mcp-config");
2666
assert.notInclude(spawned, "dummy-mcp-credential");
2667
}),
@@ -2745,6 +2751,7 @@ describe("ClaudeAdapterV2 native session identity", () => {
2751
assert.equal(openedQueries.length, 1);
2752
assert.equal(openedQueries[0]?.options.resume, "native-session-identity");
2753
assert.equal(openedQueries[0]?.options.sessionId, undefined);
2754
+ assert.equal(openedQueries[0]?.options.title, "Claude attachment test");
2755
}),
2756
);
2757
@@ -2753,6 +2760,7 @@ describe("ClaudeAdapterV2 native session identity", () => {
2760
const openedQueries = yield* openTurnWithOrdinal(4, false);
2761
assert.equal(openedQueries[0]?.options.sessionId, "native-session-identity");
2762
assert.equal(openedQueries[0]?.options.resume, undefined);
2763
+ assert.equal(openedQueries[0]?.options.title, "Claude attachment test");
2764
}),
2765
);
2766
});
apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts
+4
@@ -1468,6 +1468,7 @@ const subagentDeviceInstructions: HookCallback = () =>
1468
export function makeClaudeQueryOptions(input: {
1469
readonly modelSelection: ModelSelection;
1470
readonly nativeThreadId: string;
1471
+ readonly title?: string;
1472
readonly resume: boolean;
1473
readonly resumeSessionAt?: string;
1474
readonly cwd: string | null;
@@ -1548,6 +1549,8 @@ export function makeClaudeQueryOptions(input: {
1549
const deviceInstructions = input.mcpServers !== undefined && input.deviceToolsAvailable === true;
1550
const options: ClaudeAgentSdkQueryOptions = {
1551
model: compiledSelection.apiModelId,
1552
+ // T3 names threads; a supplied title skips Claude's redundant naming request.
1553
+ ...(input.title === undefined ? {} : { title: input.title }),
1554
tools: claudeAgentSdkQueryToolsForSdk(selectedTools),
1555
permissionMode:
1556
(launchArgPermissionMode as PermissionMode | null | undefined) ??
@@ -10349,6 +10352,7 @@ export const makeClaudeAdapterV2 = Effect.fn("makeClaudeAdapterV2")(function* (
10352
const queryOptions = makeClaudeQueryOptions({
10353
modelSelection: turnInput.modelSelection,
10354
nativeThreadId,
10355
+ title: turnInput.appThread.title,
10356
resume: shouldResume,
10357
...(resumeSessionAt === undefined ? {} : { resumeSessionAt }),
10358
cwd: turnInput.runtimePolicy.cwd,