pi-condense 2.4.0 → 2.4.1
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 +3 -1
- package/package.json +4 -4
- package/src/summarizer-wiring.test.ts +2 -1
- package/src/summarizer.ts +11 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,7 +7,9 @@ Published to npm as [`pi-condense`](https://www.npmjs.com/package/pi-condense) (
|
|
|
7
7
|
Pushing a `vX.Y.Z` tag triggers `.github/workflows/release.yml`, which runs the tests and
|
|
8
8
|
publishes via OIDC trusted publishing. See `.agents/skills/release/SKILL.md`.
|
|
9
9
|
|
|
10
|
-
## [
|
|
10
|
+
## [2.4.1] - 2026-07-30
|
|
11
|
+
|
|
12
|
+
- **Fix 421 Misdirected Request for GitHub Copilot business/enterprise seats.** The summarizer called pi-ai's `stream()` with the static model definition, whose shipped `baseUrl` pins the individual Copilot host (`api.individual.githubcopilot.com`); business/enterprise tokens are rejected there with `421 Misdirected Request`, so any `github-copilot/*` `summarizerModel` failed on those seats. `runOnce` now mirrors the main agent loop (pi's `model-runtime`): it resolves provider auth via `ctx.modelRegistry.getProviderAuth(model.provider)` and, when the resolved auth carries a seat-specific `baseUrl`, rebases the model onto it before streaming. Also bumps `@earendil-works/*` devDependencies to `^0.83.0` (needed for `getProviderAuth` on the extension-facing `ModelRegistry`) and imports `stream` from `@earendil-works/pi-ai/compat` (its export moved off the root in current pi-ai).
|
|
11
13
|
|
|
12
14
|
## [2.4.0] - 2026-07-09
|
|
13
15
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-condense",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"description": "Pi coding-agent extension that summarizes completed tool-call batches, replaces raw outputs with short stubs, compresses closed tool-call chains, and recovers any original on demand via context_tree_query.",
|
|
5
5
|
"author": "Jacek Juraszek",
|
|
6
6
|
"license": "MIT",
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
"@sinclair/typebox": "*"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@earendil-works/pi-ai": "^0.
|
|
61
|
-
"@earendil-works/pi-coding-agent": "^0.
|
|
62
|
-
"@earendil-works/pi-tui": "^0.
|
|
60
|
+
"@earendil-works/pi-ai": "^0.83.0",
|
|
61
|
+
"@earendil-works/pi-coding-agent": "^0.83.0",
|
|
62
|
+
"@earendil-works/pi-tui": "^0.83.0",
|
|
63
63
|
"@sinclair/typebox": "^0.34.49"
|
|
64
64
|
}
|
|
65
65
|
}
|
|
@@ -5,7 +5,7 @@ import { describe, it, expect, mock } from "bun:test";
|
|
|
5
5
|
let streamImpl: (model: any, input?: any, opts?: any) => any = () => {
|
|
6
6
|
throw new Error("streamImpl not set");
|
|
7
7
|
};
|
|
8
|
-
mock.module("@earendil-works/pi-ai", () => ({
|
|
8
|
+
mock.module("@earendil-works/pi-ai/compat", () => ({
|
|
9
9
|
stream: (...args: any[]) => streamImpl(...args),
|
|
10
10
|
}));
|
|
11
11
|
|
|
@@ -111,6 +111,7 @@ function makeCtx(notes: Note[], sessionModel: any = SESSION, primaryModel: any =
|
|
|
111
111
|
modelRegistry: {
|
|
112
112
|
find: () => primaryModel,
|
|
113
113
|
getApiKeyAndHeaders: async () => ({ ok: true, apiKey: "k", headers: {} }),
|
|
114
|
+
getProviderAuth: async () => undefined,
|
|
114
115
|
},
|
|
115
116
|
ui: { notify: (msg: string, level: string) => notes.push({ msg, level }) },
|
|
116
117
|
} as any;
|
package/src/summarizer.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { stream } from "@earendil-works/pi-ai";
|
|
1
|
+
import { stream } from "@earendil-works/pi-ai/compat";
|
|
2
2
|
import type { AssistantMessage } from "@earendil-works/pi-ai";
|
|
3
3
|
import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
4
4
|
import type {
|
|
@@ -151,10 +151,19 @@ async function runOnce(
|
|
|
151
151
|
return { kind: "auth", message: authMessage };
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
+
// Mirror the main loop (model-runtime stream): auth resolution can carry a
|
|
155
|
+
// seat-specific baseUrl (e.g. GitHub Copilot business/enterprise endpoints).
|
|
156
|
+
// The shipped model data pins the individual host, which 421s other seats,
|
|
157
|
+
// so the resolved auth baseUrl must win over the static model baseUrl.
|
|
158
|
+
const providerAuth = await ctx.modelRegistry.getProviderAuth(model.provider);
|
|
159
|
+
const effectiveModel = providerAuth?.auth.baseUrl
|
|
160
|
+
? { ...model, baseUrl: providerAuth.auth.baseUrl }
|
|
161
|
+
: model;
|
|
162
|
+
|
|
154
163
|
// Pass the combined signal so the underlying fetch is cancelled immediately
|
|
155
164
|
// either when the user presses Esc, or when an idle/ceiling timeout fires.
|
|
156
165
|
const responseStream = stream(
|
|
157
|
-
|
|
166
|
+
effectiveModel,
|
|
158
167
|
{
|
|
159
168
|
messages: [
|
|
160
169
|
{
|