Skip to content

Commit f0c6fcc

Browse files
Merge origin/main into fix/issue-26450
2 parents 68ad612 + 5211acf commit f0c6fcc

18 files changed

Lines changed: 442 additions & 306 deletions

File tree

‎.github/workflows/release-desktop.yml‎

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,29 @@ jobs:
163163
env:
164164
pnpm_config_cache_dir: ${{ runner.temp }}/pnpm-metadata
165165

166+
# The CLI archive and the staged app install without a lockfile, so they
167+
# ask the registry about every package and fetch platform packages the
168+
# workspace store lacks. They share this registry metadata and store. A
169+
# new week starts cold, which bounds how stale cached ranges can get.
170+
- name: Resolve staged install cache
171+
id: stage_pnpm
172+
shell: bash
173+
run: |
174+
echo "dir=$RUNNER_TEMP/desktop-stage-pnpm" >> "$GITHUB_OUTPUT"
175+
echo "prefix=desktop-stage-pnpm-v2-${{ inputs.platform }}-${{ inputs.arch }}-$(date -u +%G-%V)-" >> "$GITHUB_OUTPUT"
176+
177+
- name: Restore staged install cache
178+
id: stage_pnpm_cache
179+
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
180+
with:
181+
path: ${{ steps.stage_pnpm.outputs.dir }}
182+
key: ${{ steps.stage_pnpm.outputs.prefix }}${{ github.run_id }}-${{ github.run_attempt }}
183+
restore-keys: ${{ steps.stage_pnpm.outputs.prefix }}
184+
185+
- name: Mark staged install cache
186+
shell: bash
187+
run: mkdir -p "${{ steps.stage_pnpm.outputs.dir }}" && touch "$RUNNER_TEMP/desktop-stage-pnpm.marker"
188+
166189
- name: Cache resource monitor
167190
id: resource_monitor_cache
168191
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
@@ -371,6 +394,9 @@ jobs:
371394
if: inputs.cli_archive
372395
shell: bash
373396
env:
397+
pnpm_config_cache_dir: ${{ steps.stage_pnpm.outputs.dir }}/cache
398+
pnpm_config_store_dir: ${{ steps.stage_pnpm.outputs.dir }}/store
399+
pnpm_config_prefer_offline: "true"
374400
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
375401
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
376402
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
@@ -490,7 +516,10 @@ jobs:
490516
- name: Build desktop artifact
491517
shell: bash
492518
env:
493-
pnpm_config_cache_dir: ${{ runner.temp }}/pnpm-metadata
519+
# pnpm only goes to the registry for packages or versions the cache lacks.
520+
pnpm_config_cache_dir: ${{ steps.stage_pnpm.outputs.dir }}/cache
521+
pnpm_config_store_dir: ${{ steps.stage_pnpm.outputs.dir }}/store
522+
pnpm_config_prefer_offline: "true"
494523
T3CODE_DESKTOP_REUSE_RESOURCE_MONITOR: true
495524
T3CODE_DESKTOP_REUSE_LINUX_CAPTURE_HELPERS: ${{ steps.capture_helper_cache.outputs.cache-hit == 'true' }}
496525
CSC_LINK: ${{ secrets.CSC_LINK }}
@@ -575,6 +604,23 @@ jobs:
575604
576605
vp run dist:desktop:artifact "${args[@]}"
577606
607+
# Warm installs only touch the store index, so new content means a fetch.
608+
- name: Check staged install cache for new content
609+
id: stage_pnpm_changed
610+
shell: bash
611+
run: |
612+
dir="${{ steps.stage_pnpm.outputs.dir }}"
613+
new=$(find "$dir/cache/v12" "$dir/store/v11/files" -type f -newer "$RUNNER_TEMP/desktop-stage-pnpm.marker" 2>/dev/null | wc -l | tr -d ' ')
614+
echo "Staged installs added $new cached files."
615+
echo "changed=$([[ "$new" -gt 0 ]] && echo true || echo false)" >> "$GITHUB_OUTPUT"
616+
617+
- name: Save staged install cache
618+
if: steps.stage_pnpm_changed.outputs.changed == 'true'
619+
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
620+
with:
621+
path: ${{ steps.stage_pnpm.outputs.dir }}
622+
key: ${{ steps.stage_pnpm_cache.outputs.cache-primary-key }}
623+
578624
# A build can package fine and still not open (a missing module in the
579625
# backend or the bundle). This launches the app from the shipped
580626
# AppImage or DMG.

‎apps/desktop/src/settings/DesktopClientSettings.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ const clientSettings: ClientSettings = {
6363
sidebarProjectSortOrder: "manual",
6464
sidebarThreadSortOrder: "created_at",
6565
boringSidebarEnabled: false,
66+
boringSidebarMultilineRows: false,
6667
legacySidebarEnabled: false,
6768
sidebarWorkingShelfEnabled: false,
6869
loadBalancingEnabled: false,

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

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,6 +1431,16 @@ describe("OrchestratorMcpService provider resolution", () => {
14311431
models: ["oc/m12", "oc/m01", "oc/m03", "oc/m04", "oc/m05", "oc/m06", "oc/m07", "oc/m08"],
14321432
omitted: 3,
14331433
});
1434+
// A word naming the provider matches all its models, so legacy ones stay out.
1435+
assert.deepEqual(listing(yield* capabilitiesWith("Codex")), [
1436+
{ id: codexInstanceId, models: ["gpt-6", "gpt-4", "gpt-3", "my-alpha"], omitted: 1 },
1437+
{ id: opencodeInstanceId, models: [], omitted: 0 },
1438+
]);
1439+
assert.deepEqual(listing(yield* capabilitiesWith("codex gpt 5"))[0], {
1440+
id: codexInstanceId,
1441+
models: ["gpt-5"],
1442+
omitted: 0,
1443+
});
14341444
}),
14351445
);
14361446

@@ -2694,6 +2704,71 @@ describe("OrchestratorMcpService thread lookup", () => {
26942704
);
26952705
});
26962706

2707+
describe("OrchestratorMcpService thread list", () => {
2708+
const client: McpInvocationScope = {
2709+
environmentId: EnvironmentId.make("environment:thread-list"),
2710+
requestNamespace: "client:thread-list",
2711+
thread: undefined,
2712+
client: { sessionId: "thread-list", label: "Claude Code", access: "full-access" },
2713+
capabilities: new Set(["orchestration"]),
2714+
issuedAt: 1,
2715+
};
2716+
const shell = (id: string, projectId: string, snoozed: boolean) => ({
2717+
...liveThreadShell(ThreadId.make(id)),
2718+
projectId: ProjectId.make(projectId),
2719+
status: "completed" as const,
2720+
snoozedUntil: snoozed ? DateTime.makeUnsafe("2099-01-01T00:00:00Z") : null,
2721+
});
2722+
const shells = [
2723+
shell("thread:a-snoozed", "project:a", true),
2724+
shell("thread:a-awake", "project:a", false),
2725+
shell("thread:b-snoozed", "project:b", true),
2726+
];
2727+
const service = layerOrchestratorService.pipe(
2728+
Layer.provide(
2729+
Layer.mergeAll(
2730+
NodeServices.layer,
2731+
Layer.mock(ThreadManagementService.ThreadManagementService)({
2732+
listProjectThreads: (input) =>
2733+
Effect.succeed(
2734+
shells.filter(
2735+
(thread) => input.projectId === undefined || thread.projectId === input.projectId,
2736+
),
2737+
),
2738+
}),
2739+
ServerSettings.layerTest(),
2740+
Layer.mock(ProviderRegistry.ProviderRegistry)({ getProviders: Effect.succeed([]) }),
2741+
Layer.mock(ProviderAdapterRegistry.ProviderAdapterRegistryV2)({
2742+
list: () => Effect.succeed([]),
2743+
}),
2744+
Layer.mock(ProjectService.ProjectService)({}),
2745+
Layer.mock(SecretRequests.SecretRequests)({}),
2746+
Layer.mock(RemoteDelegation.RemoteDelegation)({}),
2747+
Layer.mock(ScheduledTaskService.ScheduledTaskService)({}),
2748+
),
2749+
),
2750+
);
2751+
2752+
it.effect("lists snoozed threads across every project with allProjects", () =>
2753+
Effect.gen(function* () {
2754+
const mcp = yield* OrchestratorMcpService.OrchestratorMcpService;
2755+
const listed = yield* mcp.listThreads(client, {
2756+
allProjects: true,
2757+
projectId: ProjectId.make("project:a"),
2758+
snoozed: true,
2759+
});
2760+
assert.equal(listed.projectId, null);
2761+
assert.deepStrictEqual(
2762+
listed.threads.map((thread) => [thread.threadId, thread.projectId]),
2763+
[
2764+
["thread:a-snoozed", "project:a"],
2765+
["thread:b-snoozed", "project:b"],
2766+
],
2767+
);
2768+
}).pipe(Effect.provide(service)),
2769+
);
2770+
});
2771+
26972772
describe("OrchestratorMcpService thread stop", () => {
26982773
const driver = ProviderDriverKind.make("codex");
26992774
const instanceId = ProviderInstanceId.make("codex");

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

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,9 @@ const FULL_CATALOG_DRIVERS: ReadonlySet<string> = new Set(["codex", "claudeAgent
287287
const LISTED_MODEL_LIMIT = 8;
288288

289289
/**
290-
* Picks the models orchestrator_capabilities shows for one provider. Hidden
291-
* models never appear. With search terms, lists matches; otherwise lists pinned
292-
* models (custom, favorite, the caller's own) plus the provider's non-legacy
290+
* Picks the models orchestrator_capabilities shows for one provider. Hidden models never
291+
* appear. Search words naming the provider are dropped; other words list matches. With no
292+
* words left, lists pinned models (custom, favorite, the caller's own) plus non-legacy
293293
* models, or only the first few in the user's model order for large catalogs.
294294
*/
295295
function listCapabilityModels(input: {
@@ -304,10 +304,13 @@ function listCapabilityModels(input: {
304304
const visible = input.provider.models
305305
.filter((model) => model.isCustom || !input.preferences?.hiddenModels.includes(model.slug))
306306
.toSorted((a, b) => (rank.get(a.slug) ?? rank.size) - (rank.get(b.slug) ?? rank.size));
307-
if (input.searchTerms.length > 0) {
307+
const { instanceId, driver, displayName } = input.provider;
308+
const providerText = `${instanceId} ${driver} ${displayName ?? ""}`.toLowerCase();
309+
const modelTerms = input.searchTerms.filter((term) => !providerText.includes(term));
310+
if (modelTerms.length > 0) {
308311
const matches = visible.filter((model) => {
309312
const text = `${model.slug} ${model.name} ${model.subProvider ?? ""}`.toLowerCase();
310-
return input.searchTerms.every((term) => text.includes(term));
313+
return modelTerms.every((term) => text.includes(term));
311314
});
312315
const listed = matches.slice(0, LISTED_MODEL_LIMIT);
313316
return { listed, omitted: matches.length - listed.length };
@@ -755,6 +758,7 @@ function listItemFromShell(
755758
): OrchestratorMcpThreadListItem {
756759
return {
757760
threadId: shell.id,
761+
projectId: shell.projectId,
758762
title: shell.title,
759763
link: formatThreadLink({ environmentId, threadId: shell.id }),
760764
createdBy: shell.createdBy,
@@ -2764,10 +2768,12 @@ const make = Effect.gen(function* () {
27642768
),
27652769
listThreads: Effect.fn("OrchestratorMcpService.listThreads")(function* (scope, input) {
27662770
const { parent } = yield* loadCaller(scope);
2767-
const projectId = yield* resolveProjectTarget(parent, input.projectId);
2771+
const projectId = input.allProjects
2772+
? null
2773+
: yield* resolveProjectTarget(parent, input.projectId);
27682774
const projectThreads = yield* threadManagement
27692775
.listProjectThreads({
2770-
projectId,
2776+
projectId: projectId ?? undefined,
27712777
includeSubagents: input.includeSubagents !== false,
27722778
})
27732779
.pipe(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ const CreateThreadsTool = Tool.make("create_threads", {
222222

223223
const ThreadListTool = Tool.make("t3_thread_list", {
224224
description:
225-
"List threads in a project, newest first. Omit `projectId` for yours. Filter by status, title, settled, or snoozed. Page with the cursor.",
225+
"List threads newest first, in one project or with `allProjects`. Page with `cursor`.",
226226
parameters: OrchestratorMcpThreadListInput,
227227
success: OrchestratorMcpThreadListResult,
228228
failure: OrchestratorMcpFailure,

‎apps/server/src/orchestration-v2/ThreadManagementService.ts‎

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -279,12 +279,14 @@ export class ThreadManagementProjectionLoadError extends Schema.TaggedError<Thre
279279
export class ThreadManagementProjectThreadsListError extends Schema.TaggedError<ThreadManagementProjectThreadsListError>()(
280280
"ThreadManagementProjectThreadsListError",
281281
{
282-
projectId: ProjectId,
282+
projectId: Schema.optional(ProjectId),
283283
cause: Schema.Defect(),
284284
},
285285
) {
286286
override get message(): string {
287-
return `Unable to list threads in project ${this.projectId}.`;
287+
return this.projectId === undefined
288+
? "Unable to list threads."
289+
: `Unable to list threads in project ${this.projectId}.`;
288290
}
289291
}
290292

@@ -404,8 +406,9 @@ export interface ThreadManagementServiceShape {
404406
Orchestrator.OrchestratorV2Error
405407
>;
406408
readonly getThreadShell: Orchestrator.OrchestratorV2["Service"]["getThreadShell"];
409+
/** Omit `projectId` to list every project's threads. */
407410
readonly listProjectThreads: (input: {
408-
readonly projectId: ProjectId;
411+
readonly projectId?: ProjectId | undefined;
409412
readonly includeSubagents: boolean;
410413
}) => Effect.Effect<ReadonlyArray<OrchestrationV2ThreadShell>, ThreadManagementError>;
411414
readonly sendToThread: (
@@ -736,27 +739,32 @@ const make = Effect.gen(function* () {
736739
);
737740

738741
const listProjectThreads: ThreadManagementServiceShape["listProjectThreads"] = (input) =>
739-
orchestrator.getShellSnapshot({ projectId: input.projectId, location: "active" }).pipe(
740-
Effect.mapError(
741-
(cause) =>
742-
new ThreadManagementProjectThreadsListError({
743-
projectId: input.projectId,
744-
cause,
745-
}),
746-
),
747-
Effect.map((snapshot) =>
748-
snapshot.threads
749-
.filter(
750-
(thread) =>
751-
input.includeSubagents || thread.lineage.relationshipToParent !== "subagent",
752-
)
753-
.toSorted(
754-
(left, right) =>
755-
DateTime.toEpochMillis(right.updatedAt) - DateTime.toEpochMillis(left.updatedAt) ||
756-
right.id.localeCompare(left.id),
757-
),
758-
),
759-
);
742+
orchestrator
743+
.getShellSnapshot({
744+
location: "active",
745+
...(input.projectId === undefined ? {} : { projectId: input.projectId }),
746+
})
747+
.pipe(
748+
Effect.mapError(
749+
(cause) =>
750+
new ThreadManagementProjectThreadsListError({
751+
projectId: input.projectId,
752+
cause,
753+
}),
754+
),
755+
Effect.map((snapshot) =>
756+
snapshot.threads
757+
.filter(
758+
(thread) =>
759+
input.includeSubagents || thread.lineage.relationshipToParent !== "subagent",
760+
)
761+
.toSorted(
762+
(left, right) =>
763+
DateTime.toEpochMillis(right.updatedAt) - DateTime.toEpochMillis(left.updatedAt) ||
764+
right.id.localeCompare(left.id),
765+
),
766+
),
767+
);
760768

761769
const sendToThread: ThreadManagementServiceShape["sendToThread"] = Effect.fn(
762770
"ThreadManagementService.sendToThread",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"claudeSystemAppendBytes": 5135,
33
"codexAdditionalContextBytes": 5687,
4-
"mcpToolListJsonBytes": 45861
4+
"mcpToolListJsonBytes": 45842
55
}

‎apps/web/src/components/Sidebar.tsx‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -962,6 +962,7 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve
962962
},
963963
});
964964
const boringSidebarEnabled = useBoringSidebarEnabled();
965+
const folderRowsMultiline = useClientSettings((settings) => settings.boringSidebarMultilineRows);
965966
const newThreadContext = useHandleNewThread();
966967
// Row callbacks capture only the handler; the rest of the context changes with the route.
967968
const { handleNewThread } = newThreadContext;
@@ -3168,7 +3169,13 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve
31683169
);
31693170
const isCard =
31703171
section === "active" || section === "pinned" || section === "working";
3171-
const rowVariant = folderRow ? "folder" : isCard ? "card" : "slim";
3172+
const rowVariant = folderRow
3173+
? folderRowsMultiline
3174+
? "folder-multiline"
3175+
: "folder"
3176+
: isCard
3177+
? "card"
3178+
: "slim";
31723179
return (
31733180
<SortableThreadRow
31743181
key={threadKey}

‎apps/web/src/components/chat/MarkdownExternalLink.tsx‎

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,19 @@ function leadingExternalLinkTextLength(text: string): number {
5454
return Math.min(text.length, 1);
5555
}
5656

57+
// Long words such as URLs can break after any character so they fit narrow
58+
// table columns. Short ones, like a PR number, stay whole.
5759
function breakableExternalLinkText(text: string): ReactNode[] {
58-
return Array.from(text, (character, index) => (
59-
<Fragment key={`${index}:${character}`}>
60-
{character}
61-
<wbr />
62-
</Fragment>
63-
));
60+
return Array.from(text.matchAll(/\s+|\S+/g), ({ 0: word, index: start }) =>
61+
word.length <= 16
62+
? word
63+
: Array.from(word, (character, offset) => (
64+
<Fragment key={`${start + offset}:${character}`}>
65+
{character}
66+
<wbr />
67+
</Fragment>
68+
)),
69+
);
6470
}
6571

6672
export function MarkdownExternalLinkContent({

0 commit comments

Comments
 (0)