mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-22 17:22:47 +00:00
* fix(muse): load models whose effort tiers carry descriptions
Muse 1.4.2 sends reasoningEffortVariants as described tiers
({ tier, description? }) and the complete effort list on variants, as
the bundled MSP types declare. The catalog schema had the two shapes
swapped, so any model with a described tier failed the whole model/list
parse: the model picker stayed empty and agent creation failed.
Parse both fields as declared, offer the efforts from variants, and
show Muse's tier descriptions on the matching options.
* fix(muse): leave effort descriptions out until the pickers show them
* fix(muse): keep unused catalog metadata outside validation
Described effort tiers are presentation metadata, not selectable efforts. Validating their shape blocks both discovery and session startup even though Paseo never consumes them. Normalize the complete variants list at the wire boundary and cover session readiness and selecting max.
* fix(muse): align consumed session and event wire fields
---------
Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: Mohamed Boudra <boudra.moha@gmail.com>
61 lines
1.9 KiB
TypeScript
61 lines
1.9 KiB
TypeScript
import type { z } from "zod";
|
|
import type {
|
|
ProviderInput,
|
|
ProviderLaunch,
|
|
ProviderSessionSummary,
|
|
} from "@getpaseo/plugin/server/provider";
|
|
import { MspConnection } from "./connection.js";
|
|
import { sessionListSchema } from "./wire.js";
|
|
|
|
export class Sessions {
|
|
private readonly hosts = new Set<MspConnection>();
|
|
async list(
|
|
launch: ProviderLaunch,
|
|
input: Extract<ProviderInput, { type: "sessions" }>,
|
|
): Promise<ProviderSessionSummary[]> {
|
|
const host = new MspConnection({ launch });
|
|
this.hosts.add(host);
|
|
try {
|
|
await host.initialize();
|
|
const summaries: ProviderSessionSummary[] = [];
|
|
let cursor: string | null = null;
|
|
do {
|
|
const page: z.infer<typeof sessionListSchema> = await host.request(
|
|
"session/list",
|
|
{ workspaceRoot: input.cwd, limit: Math.min(input.limit ?? 50, 200), cursor },
|
|
sessionListSchema,
|
|
);
|
|
for (const session of page.sessions) {
|
|
if (session.workspaceRoot === null) continue;
|
|
if (
|
|
input.query &&
|
|
!(session.title ?? "").toLowerCase().includes(input.query.toLowerCase())
|
|
)
|
|
continue;
|
|
summaries.push({
|
|
cwd: session.workspaceRoot,
|
|
title: session.title,
|
|
updatedAt: session.updatedAt,
|
|
persistence: {
|
|
version: 1,
|
|
data: {
|
|
sessionId: session.sessionId,
|
|
...(session.modelId === null ? {} : { model: session.modelId }),
|
|
},
|
|
},
|
|
});
|
|
if (input.limit && summaries.length >= input.limit) return summaries;
|
|
}
|
|
cursor = page.nextCursor;
|
|
} while (cursor !== null);
|
|
return summaries;
|
|
} finally {
|
|
await host.close();
|
|
this.hosts.delete(host);
|
|
}
|
|
}
|
|
async close(): Promise<void> {
|
|
await Promise.all([...this.hosts].map((host) => host.close()));
|
|
}
|
|
}
|