pi-claude-agent-sdk 0.8.0 → 0.8.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/README.md +1 -1
- package/package.json +1 -1
- package/src/config.ts +1 -1
- package/src/index.ts +9 -9
package/README.md
CHANGED
|
@@ -45,7 +45,7 @@ Config: `~/.pi/agent/claude-bridge.json` (global) or the project Pi config direc
|
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
`provider`:
|
|
48
|
-
- `plan` (default `"
|
|
48
|
+
- `plan` (default `"max"`) — Max (or Team Premium/Enterprise). Set to `"pro"` on a Pro plan so Opus 4.6 stays at 200K context. If it's unset, the first interactive session points this out once, then records `startupNoticeShown` (the date, `YYYY-MM-DD`) in the global config so it doesn't nag again.
|
|
49
49
|
- `longContextExtraUsage` — set to `true` to enable 1M models that cost money through Extra Usage. It enables Sonnet 4.6 with 1M on every plan and Opus 4.6 with 1M on Pro. Not needed for Opus 4.7 or 4.8.
|
|
50
50
|
- `appendSystemPrompt` — append pi's project context files (global and ancestor `AGENTS.md` / `CLAUDE.md`) and skills (default `true`)
|
|
51
51
|
- `settingSources` — CC filesystem settings to load; only applied when `appendSystemPrompt: false`
|
package/package.json
CHANGED
package/src/config.ts
CHANGED
|
@@ -19,7 +19,7 @@ export interface Config {
|
|
|
19
19
|
strictMcpConfig?: boolean;
|
|
20
20
|
autoMemoryEnabled?: boolean;
|
|
21
21
|
pathToClaudeCodeExecutable?: string;
|
|
22
|
-
// Subscription plan tier.
|
|
22
|
+
// Subscription plan tier. Defaults to "max". Set to "pro" to keep Opus 4.6 at 200K.
|
|
23
23
|
plan?: "pro" | "max";
|
|
24
24
|
// Set to true to opt into metered 1M context usage ("extra usage" in
|
|
25
25
|
// Anthropic billing). Enables Sonnet 4.6 [1m] on every plan and Opus 4.6
|
package/src/index.ts
CHANGED
|
@@ -121,7 +121,7 @@ const ACTIVE_STREAM_SIMPLE_KEY = Symbol.for("claude-bridge:activeStreamSimple");
|
|
|
121
121
|
// MODELS is buildModels(getModels("anthropic")) — projection kept in models.js.
|
|
122
122
|
const MODELS = buildModels(getModels("anthropic"));
|
|
123
123
|
let providerSettings: NonNullable<Config["provider"]> = {};
|
|
124
|
-
let longContextSettings: LongContextSettings = { plan: "
|
|
124
|
+
let longContextSettings: LongContextSettings = { plan: "max", longContextExtraUsage: false };
|
|
125
125
|
|
|
126
126
|
// --- Error handling ---
|
|
127
127
|
|
|
@@ -677,10 +677,10 @@ let piMode: ExtensionContext["mode"] | null = null;
|
|
|
677
677
|
let piModelRegistry: AnthropicAuthRegistry | null = null;
|
|
678
678
|
const activeQueryContexts = new Set<QueryContext>();
|
|
679
679
|
|
|
680
|
-
// `plan` is the one setting whose default
|
|
681
|
-
//
|
|
682
|
-
// rather than session_start: the notice persists a flag to the global
|
|
683
|
-
// and firing it on startup would write that file for every pi session that
|
|
680
|
+
// `plan` is the one setting whose default can cost a Pro user something (Opus
|
|
681
|
+
// 4.6 at 1M when they only have 200K), so announce it once. Deferred to the first
|
|
682
|
+
// provider query rather than session_start: the notice persists a flag to the global
|
|
683
|
+
// config, and firing it on startup would write that file for every pi session that
|
|
684
684
|
// merely has this extension installed.
|
|
685
685
|
let planNoticePending = false;
|
|
686
686
|
|
|
@@ -691,7 +691,7 @@ function showPlanNoticeOnce(): void {
|
|
|
691
691
|
planNoticePending = false;
|
|
692
692
|
const path = markStartupNoticeShown();
|
|
693
693
|
piUI?.notify(
|
|
694
|
-
`
|
|
694
|
+
`pi-claude-agent-sdk: assuming a Max plan. On Pro, set provider.plan to "pro" in ${path} so Opus 4.6 stays at 200K context.`,
|
|
695
695
|
"info",
|
|
696
696
|
);
|
|
697
697
|
}
|
|
@@ -1235,7 +1235,7 @@ async function deliverToolResults(
|
|
|
1235
1235
|
}
|
|
1236
1236
|
if (c.pendingToolCalls.size > 0) {
|
|
1237
1237
|
debug(`WARNING: ${c.pendingToolCalls.size} MCP handlers still waiting after delivering ${results.length} results`);
|
|
1238
|
-
piUI?.notify(`
|
|
1238
|
+
piUI?.notify(`pi-claude-agent-sdk: ${c.pendingToolCalls.size} tool handler(s) still waiting — provider may be stuck`, "warning");
|
|
1239
1239
|
}
|
|
1240
1240
|
}
|
|
1241
1241
|
|
|
@@ -1567,7 +1567,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
1567
1567
|
providerSettings = config.provider ?? {};
|
|
1568
1568
|
// We need these settings to know if we're eligible for 1M context on certain models
|
|
1569
1569
|
longContextSettings = {
|
|
1570
|
-
plan: providerSettings.plan ?? "
|
|
1570
|
+
plan: providerSettings.plan ?? "max",
|
|
1571
1571
|
longContextExtraUsage: providerSettings.longContextExtraUsage ?? false,
|
|
1572
1572
|
};
|
|
1573
1573
|
const registeredModels = applyLongContext(MODELS, longContextSettings);
|
|
@@ -1631,7 +1631,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
1631
1631
|
const msg = errorMessage(err);
|
|
1632
1632
|
debug("session_before_compact: takeover failed; cancelling to avoid native compact fallback", err);
|
|
1633
1633
|
ctx.ui?.notify?.(
|
|
1634
|
-
`
|
|
1634
|
+
`pi-claude-agent-sdk compact failed (${msg}); cancelled to avoid known hang. Retry, switch model, or reduce context.`,
|
|
1635
1635
|
"error",
|
|
1636
1636
|
);
|
|
1637
1637
|
return { cancel: true };
|