Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions src/main/agent/agent-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1798,6 +1798,7 @@ ${hints.join('\n')}
modelBaseUrl: piModel.baseUrl,
effectiveCwd,
apiKey,
subagent: configStore.getAll().subagent,
});
const skillPaths = await this.resolveSkillPaths(session.id);
const skillsSignature = JSON.stringify(skillPaths);
Expand Down Expand Up @@ -1838,6 +1839,7 @@ ${hints.join('\n')}
prompt,
existingMessages,
isColdStart: !cachedSession,
sandboxIsolated: useSandboxIsolation,
})
: { promptPrefix: undefined, customTools: [] };

Expand Down
2 changes: 2 additions & 0 deletions src/main/agent/pi-model-resolution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export interface PiModelLookupOptions {
rawProvider?: string;
customBaseUrl?: string;
customProtocol?: string;
restrictToProvider?: boolean;
}

export interface PiModelLookupCandidate {
Expand Down Expand Up @@ -405,6 +406,7 @@ export function resolvePiRegistryModel(
options: PiModelLookupOptions = {}
): Model<Api> | undefined {
for (const candidate of buildPiModelLookupCandidates(modelString, options)) {
if (options.restrictToProvider && candidate.provider !== options.configProvider) continue;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const model = (getModel as (...args: unknown[]) => Model<Api> | undefined)(
candidate.provider as PiRegistryProvider,
Expand Down
3 changes: 3 additions & 0 deletions src/main/agent/pi-session-runtime.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { createHash } from 'node:crypto';
import type { SubagentConfig } from '../../shared/subagent-config';

export interface PiSessionRuntimeSignatureInput {
configProvider?: string;
Expand All @@ -8,6 +9,7 @@ export interface PiSessionRuntimeSignatureInput {
modelBaseUrl?: string;
effectiveCwd?: string;
apiKey?: string;
subagent?: SubagentConfig;
}

function normalizeText(value: string | undefined): string {
Expand All @@ -31,5 +33,6 @@ export function buildPiSessionRuntimeSignature(input: PiSessionRuntimeSignatureI
modelBaseUrl: normalizeText(input.modelBaseUrl).replace(/\/+$/, ''),
effectiveCwd: normalizeText(input.effectiveCwd),
apiKeyFingerprint: fingerprintSecret(input.apiKey),
subagent: input.subagent,
});
}
Loading
Loading