Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
0f9db06
feat(settings): start each destination at the top
yuxino Sep 21, 2026
0319347
fix(settings): resolve PR 813 integration conflicts
yuxino Sep 21, 2026
cb31f44
fix(settings): preserve scenarios after queue fix integration
yuxino Sep 21, 2026
8bacb7d
chore(settings): refresh scroll reset candidate against main
yuxino Sep 22, 2026
c1aae7f
chore(settings): integrate current upstream for scroll navigation
yuxino Sep 22, 2026
efb3ba5
chore(pr-813): integrate latest upstream main
yuxino Sep 22, 2026
aea9b91
fix(catalog): resolve proxy-prefixed model ids and thinking suffixes
aurorax-neo Sep 22, 2026
05224f9
fix(agent-runtime): ignore a stream delta that omits its string field
vastsa Sep 22, 2026
3310830
Merge pull request #888 from vastsa/fix/pi-ai-frame-missing-string-field
vastsa Sep 22, 2026
4e483b6
docs(readme): use the multi-agent mockup as the README hero image
vastsa Sep 22, 2026
77d6ccf
Merge pull request #889 from vastsa/docs/readme-hero-mockup
vastsa Sep 22, 2026
b69576f
docs(site): redesign the documentation site around real product UI
vastsa Sep 22, 2026
43397d0
Merge pull request #890 from vastsa/feat/docs-site-redesign
vastsa Sep 22, 2026
4af14f1
docs(readme): swap the hero for the shots.so mockup
vastsa Sep 22, 2026
b37c4cf
Merge pull request #891 from vastsa/docs/readme-hero-shots
vastsa Sep 22, 2026
0185286
docs(site): swap the homepage hero to the unframed workspace shot
vastsa Sep 22, 2026
26dc656
Merge pull request #892 from vastsa/feat/docs-hero-shot
vastsa Sep 22, 2026
ceb23ce
docs(site): rebuild the landing page in a keynote register
vastsa Sep 22, 2026
0df41c1
Merge pull request #893 from vastsa/feat/docs-landing-readme
vastsa Sep 22, 2026
9f25fa2
fix(settings): clear the image model when nothing remains selectable
vastsa Sep 22, 2026
1a6a36e
Merge pull request #895 from vastsa/fix/image-model-empty-selection
vastsa Sep 22, 2026
07b9174
fix(settings): position search before paint and leave plugin pages
vastsa Sep 22, 2026
2159e9d
Merge remote-tracking branch 'origin/main' into fix/settings-scroll-s…
vastsa Sep 22, 2026
0a6d9d1
fix(config-sync): recover WebDAV setup from nested directories and st…
vastsa Sep 22, 2026
005935a
Merge pull request #898 from vastsa/fix/config-sync-webdav-recovery
vastsa Sep 22, 2026
a036aaa
fix(providers): fold fullwidth header values instead of failing the r…
vastsa Sep 22, 2026
21af7d6
fix(providers): format the header fold and take decision D621
vastsa Sep 22, 2026
dc5e1fb
Merge pull request #896 from vastsa/fix/provider-header-latin1
vastsa Sep 22, 2026
d866368
fix(config-sync): keep the vault-password error code visible
vastsa Sep 22, 2026
6ad892d
Merge pull request #899 from vastsa/fix/config-sync-password-error
vastsa Sep 22, 2026
92029e8
fix(agent-runtime): declare required on every object tool schema
vastsa Sep 22, 2026
3b3b944
fix(pi-ai): plumb non-empty reasoning replay through getCompat
vastsa Sep 22, 2026
6c99c02
Merge pull request #900 from vastsa/fix/tool-schema-required
vastsa Sep 22, 2026
e490011
fix(oauth): load vendor account models from each vendor
vastsa Sep 22, 2026
410ad75
Merge pull request #901 from vastsa/fix/vendor-live-model-lists
vastsa Sep 22, 2026
0b71fae
chore(agent-runtime): sync Pi SDK to 0.87.0
vastsa Sep 22, 2026
ed6f60e
Merge pull request #902 from vastsa/chore/sync-pi-087-compat
vastsa Sep 22, 2026
57ab9ac
feat(settings): gate cloud sync behind developer mode
vastsa Sep 22, 2026
d930aae
test(settings): update experimental badge contract
vastsa Sep 22, 2026
c6709b7
Merge pull request #903 from vastsa/feat/dev-only-cloud-backup-setting
vastsa Sep 22, 2026
7e71a01
fix(chat): show why a vendor session cannot launch
vastsa Sep 22, 2026
ad30184
test(chat): follow the extracted transcript visibility check
vastsa Sep 22, 2026
2685888
Merge pull request #905 from vastsa/fix/chat-blank-model-error
vastsa Sep 22, 2026
9eaab83
fix(renderer): preserve chat state and recover from crashes
vastsa Sep 22, 2026
caf5c1a
fix(catalog): resolve proxy-prefixed model ids and thinking suffixes
aurorax-neo Sep 22, 2026
09455bf
fix(catalog): confine proxy aliases to provider-scoped metadata
aurorax-neo Sep 23, 2026
3f0ccfc
chore: retain original pull request branch ancestry
aurorax-neo Sep 23, 2026
1527b19
fix(docs): sync Chinese E2E traceability
vastsa Sep 23, 2026
4e09fe5
Merge pull request #915 from vastsa/fix/sync-cicd-20260923
vastsa Sep 23, 2026
fa205a9
chore(catalog): integrate PR 912 with latest main
vastsa Sep 23, 2026
b6c10c6
Merge pull request #912 from aurorax-neo/fix/catalog-model-id-proxy-m…
vastsa Sep 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion apps/desktop/electron/main/bootstrap/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import {
} from "../work-panel-window";
import { readWindowState, writeWindowState } from "../window-preferences";
import { suppressLinuxFramelessSystemMenu } from "../frameless-system-menu";
import { recoverRendererAfterGone } from "../renderer-recovery";

function windowsIconPath(): string | undefined {
if (process.platform !== "win32") return undefined;
Expand Down Expand Up @@ -468,12 +469,36 @@ export async function createWindow({
void safeOpenExternal(url).catch(() => undefined);
return { action: "deny" };
});
let windowCloseAccepted = false;
window.webContents.on("did-start-loading", () => {
windowState.notificationViewingSessionId = null;
if (windowState.mainWindow === window) resetMenuRendererReady(window);
});
window.webContents.on("render-process-gone", () => {
window.webContents.on("render-process-gone", (_event, details) => {
windowState.notificationViewingSessionId = null;
recoverRendererAfterGone(details, {
isCurrentWindow: windowState.mainWindow === window,
quitting: windowState.quitting,
windowCloseAccepted,
windowDestroyed: window.isDestroyed(),
webContentsDestroyed: window.webContents.isDestroyed(),
reload: () => window.webContents.reload(),
log: (rendererDetails, reloaded) => {
logger.app(
"diagnostics",
rendererDetails.reason === "clean-exit" ? "info" : "warn",
"renderer process exited",
{
event: "rendererProcessGone",
data: {
reason: rendererDetails.reason,
exitCode: rendererDetails.exitCode,
reloaded,
},
},
);
},
});
});

// Devtools shortcut, gated on developer mode. Frameless windows get no
Expand Down Expand Up @@ -886,6 +911,7 @@ export async function createWindow({
windowState.quitting ||
windowsAllowedToClose.has(window)
) {
windowCloseAccepted = true;
return;
}
event.preventDefault();
Expand Down
5 changes: 2 additions & 3 deletions apps/desktop/electron/main/ipc/provider-ipc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,9 +398,8 @@ export function registerProviderIpc({
}
};

// A signed-in vendor account has no API key. Copilot and the static
// vendors are listed from pi-ai. xAI instead reads GET /v1/models with
// the account token inside VendorOAuth.listModels.
// A signed-in vendor account has no API key. VendorOAuth.listModels
// reads that account's model endpoint; pi-ai is only the fallback.
if (req.source !== "cache" && provider?.authKind === OAUTH_AUTH_KIND) {
try {
const options = await vendorOAuth.listModels(provider.id);
Expand Down
118 changes: 72 additions & 46 deletions apps/desktop/electron/main/models-dev-catalog.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { readFile } from "node:fs/promises";
import { modelIdsMatch } from "@pi-desktop/shared";
import { MODEL_VENDOR_PREFIXES, catalogModelIdsMatch, stripVariantSuffix } from "@pi-desktop/shared";
import type {
ModelCost,
ModelCostTier,
Expand Down Expand Up @@ -501,28 +501,6 @@ function normalizedModelId(value: string): string {
return value.trim().toLowerCase();
}

const MODEL_VENDOR_PREFIXES = new Set([
"anthropic",
"amazon",
"aws",
"cohere",
"deepseek",
"deepseek-ai",
"gemini",
"google",
"meta",
"minimax",
"mistral",
"moonshot",
"moonshotai",
"openai",
"qwen",
"z-ai",
"zai",
"zhipuai",
"x-ai",
"xai",
]);

function modelVendorPrefixes(model: ModelsDevModel): string[] {
const prefixes = new Set<string>();
Expand Down Expand Up @@ -813,30 +791,70 @@ class ModelsDevLookupIndex {
}

candidates(requested: string): readonly IndexedModel[] {
return this.byModelId.get(requested) ?? EMPTY_CANDIDATES;
const keys = lookupCandidateKeys(requested);
if (keys.length === 0) return EMPTY_CANDIDATES;
if (keys.length === 1) {
return this.byModelId.get(keys[0]) ?? EMPTY_CANDIDATES;
}
const result: IndexedModel[] = [];
const seen = new Set<IndexedModel>();
for (const key of keys) {
const bucket = this.byModelId.get(key);
if (!bucket) continue;
for (const entry of bucket) {
if (!seen.has(entry)) {
seen.add(entry);
result.push(entry);
}
}
}
return result;
}
}

/** The normalized id, the `@region`-less base, and every vendor-prefixed form
* `modelIdsMatch` treats as equivalent, so a query finds all matching catalog
* models through the index without a full scan. */
function registrationKeys(modelId: string): string[] {
/** Index only aliases the matcher can accept: exact IDs, full slash-path
* leaves, known-vendor dash/dot prefixes, and the supported suffix variants.
* The matcher remains the final authority (including known-vendor conflicts). */
function candidateKeys(modelId: string): string[] {
const normalized = normalizedModelId(modelId);
if (!normalized) return [];
const keys = new Set<string>();
const raw = modelId.trim();
keys.add(normalizedModelId(raw));
const at = raw.indexOf("@");
if (at > 0) keys.add(normalizedModelId(raw.slice(0, at)));
for (const separator of ["/", "-", "."] as const) {
for (const prefix of MODEL_VENDOR_PREFIXES) {
const head = `${prefix}${separator}`;
if (raw.startsWith(head) && raw.length > head.length) {
keys.add(normalizedModelId(raw.slice(head.length)));
const at = normalized.indexOf("@");
const base = at > 0 ? normalized.slice(0, at) : normalized;

const add = (value: string) => {
if (!value) return;
keys.add(value);
const slash = value.lastIndexOf("/");
if (slash >= 0 && slash < value.length - 1) keys.add(value.slice(slash + 1));
for (const separator of ["-", "."] as const) {
for (const vendor of MODEL_VENDOR_PREFIXES) {
const head = `${vendor}${separator}`;
if (value.startsWith(head) && value.length > head.length) {
keys.add(value.slice(head.length));
}
}
}
};

// Strip a suffix only after the region, just as catalogModelIdsMatch does. Add
// aliases from both sides so a suffixed catalog ID or request can find its peer.
for (const value of new Set([normalized, base, stripVariantSuffix(base)])) {
add(value);
const slash = value.lastIndexOf("/");
if (slash >= 0 && slash < value.length - 1) add(value.slice(slash + 1));
}
return [...keys];
}

function registrationKeys(modelId: string): string[] {
return candidateKeys(modelId);
}

function lookupCandidateKeys(requested: string): string[] {
return candidateKeys(requested);
}

const EMPTY_CANDIDATES: readonly IndexedModel[] = [];


Expand Down Expand Up @@ -951,21 +969,27 @@ export class ModelsDevCatalog {
}

private providerFor(input: { vendorKey?: string; baseUrl?: string }): ModelsDevProvider | undefined {
const byApi = [...this.providers.values()].find((provider) =>
const candidates = new Set(providerKeyCandidates(input.vendorKey));
const apiProviders = [...this.providers.values()].filter((provider) =>
apiMatches(input.baseUrl, provider.api),
);
if (byApi) return byApi;
const candidates = new Set(providerKeyCandidates(input.vendorKey));
for (const provider of this.providers.values()) {
if (candidates.has(normalizedProviderKey(provider.providerKey))) return provider;
if (apiProviders.length > 0) {
return apiProviders.find((provider) =>
candidates.has(normalizedProviderKey(provider.providerKey)),
) ?? apiProviders[0];
}
const knownKey = Object.entries(KNOWN_PROVIDER_BASE_URLS).find(([, urls]) =>
urls.some((url) => apiMatches(input.baseUrl, url)),
)?.[0];
if (!knownKey) return undefined;
const knownCandidates = new Set(providerKeyCandidates(knownKey));
if (knownKey) {
const knownCandidates = new Set(providerKeyCandidates(knownKey));
const knownProvider = [...this.providers.values()].find((provider) =>
knownCandidates.has(normalizedProviderKey(provider.providerKey)),
);
if (knownProvider) return knownProvider;
}
return [...this.providers.values()].find((provider) =>
knownCandidates.has(normalizedProviderKey(provider.providerKey)),
candidates.has(normalizedProviderKey(provider.providerKey)),
);
}

Expand All @@ -992,7 +1016,9 @@ export class ModelsDevCatalog {
}
const candidates: Array<{ model: ModelsDevModel; score: number }> = [];
for (const { model, provider } of [...preferred, ...rest]) {
if (!modelIdsMatch(model.modelId, requested)) continue;
// A known endpoint must not inherit another provider's capabilities.
if (preferredProvider && provider !== preferredProvider) continue;
if (!catalogModelIdsMatch(model.modelId, requested)) continue;
let score = model.modelId.toLowerCase() === requested ? 20 : 10;
if (provider === preferredProvider) score += 100;
if (apiMatches(input.baseUrl, provider.api)) score += 80;
Expand Down
Loading
Loading