pi-advisor-flow 0.15.1-dev.1 → 0.15.1-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -0
- package/dist/index.js +5 -2
- package/package.json +1 -1
- package/src/commands/activation.ts +2 -1
- package/src/model-auth.ts +6 -0
- package/src/model-stream.ts +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,7 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
|
|
|
8
8
|
|
|
9
9
|
### Fixed
|
|
10
10
|
|
|
11
|
+
- Advisor activation and legacy model streaming now accept providers authenticated with non-empty headers and no API key.
|
|
11
12
|
- Removed the withdrawn `5.1.0` changelog entry that caused Pi to show an extension update notice on every launch.
|
|
12
13
|
|
|
13
14
|
## 0.15.0 - 2026-11-13
|
package/dist/index.js
CHANGED
|
@@ -1220,6 +1220,9 @@ var saveGlobalOutcomeLogging = (enabled) => {
|
|
|
1220
1220
|
return path;
|
|
1221
1221
|
};
|
|
1222
1222
|
|
|
1223
|
+
// src/model-auth.ts
|
|
1224
|
+
var hasUsableModelAuth = (auth) => Boolean(auth.apiKey?.trim()) || Object.values(auth.headers ?? {}).some((value) => Boolean(value?.trim()));
|
|
1225
|
+
|
|
1223
1226
|
// src/tools/model-access.ts
|
|
1224
1227
|
var currentModelRef = (ctx) => {
|
|
1225
1228
|
const { model } = ctx;
|
|
@@ -2062,7 +2065,7 @@ var resolveConfiguredModel = async (ctx, ref, label) => {
|
|
|
2062
2065
|
if (!auth.ok) {
|
|
2063
2066
|
throw new Error(auth.error);
|
|
2064
2067
|
}
|
|
2065
|
-
if (!auth
|
|
2068
|
+
if (!hasUsableModelAuth(auth)) {
|
|
2066
2069
|
throw new Error(`No API key for ${ref}`);
|
|
2067
2070
|
}
|
|
2068
2071
|
return {
|
|
@@ -5538,7 +5541,7 @@ var resolveActivationModels = async (runtime, ctx, canContinue) => {
|
|
|
5538
5541
|
if (!canContinue()) {
|
|
5539
5542
|
return { cancelled: true };
|
|
5540
5543
|
}
|
|
5541
|
-
if (!(advisorAuth.ok && advisorAuth
|
|
5544
|
+
if (!(advisorAuth.ok && hasUsableModelAuth(advisorAuth))) {
|
|
5542
5545
|
return { error: `No API key for Advisor ${advisorRef}` };
|
|
5543
5546
|
}
|
|
5544
5547
|
}
|
package/package.json
CHANGED
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
setExecutorRef,
|
|
23
23
|
} from "../config/state.ts";
|
|
24
24
|
import { saveConfig } from "../config/storage.ts";
|
|
25
|
+
import { hasUsableModelAuth } from "../model-auth.ts";
|
|
25
26
|
import { sameModelAdvisorDisabled } from "../tools/model-access.ts";
|
|
26
27
|
import {
|
|
27
28
|
loadCommandConfig,
|
|
@@ -71,7 +72,7 @@ const resolveActivationModels = async (
|
|
|
71
72
|
return { cancelled: true };
|
|
72
73
|
}
|
|
73
74
|
|
|
74
|
-
if (!(advisorAuth.ok && advisorAuth
|
|
75
|
+
if (!(advisorAuth.ok && hasUsableModelAuth(advisorAuth))) {
|
|
75
76
|
return { error: `No API key for Advisor ${advisorRef}` };
|
|
76
77
|
}
|
|
77
78
|
}
|
package/src/model-stream.ts
CHANGED
|
@@ -11,6 +11,7 @@ import type {
|
|
|
11
11
|
import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
12
12
|
|
|
13
13
|
import { splitRef } from "./config/state.ts";
|
|
14
|
+
import { hasUsableModelAuth } from "./model-auth.ts";
|
|
14
15
|
|
|
15
16
|
export interface ResolvedConfiguredModel {
|
|
16
17
|
apiKey?: string;
|
|
@@ -64,7 +65,7 @@ export const resolveConfiguredModel = async (
|
|
|
64
65
|
throw new Error(auth.error);
|
|
65
66
|
}
|
|
66
67
|
|
|
67
|
-
if (!auth
|
|
68
|
+
if (!hasUsableModelAuth(auth)) {
|
|
68
69
|
throw new Error(`No API key for ${ref}`);
|
|
69
70
|
}
|
|
70
71
|
|