@vanillagreen/pi-claude-bridge 1.5.0 → 1.6.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 +11 -9
- package/bundle/index.js +10 -0
- package/package.json +1 -1
- package/src/models.ts +10 -0
package/README.md
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
# pi-claude-bridge
|
|
2
2
|
|
|
3
|
+
Works with OAuth subscription, no API key, no errors.
|
|
4
|
+
|
|
3
5
|

|
|
4
6
|

|
|
5
7
|
|
|
6
|
-
Run Claude Code as a Pi provider. Adds `claude-bridge/*` models to `/model`
|
|
8
|
+
Run Claude Code as a Pi provider. Adds `claude-bridge/*` models to `/model` while keeping Pi's tools and TUI.
|
|
7
9
|
|
|
8
|
-
Forked from [`elidickinson/pi-claude-bridge`](https://github.com/elidickinson/pi-claude-bridge).
|
|
10
|
+
Forked from [`elidickinson/pi-claude-bridge`](https://github.com/elidickinson/pi-claude-bridge). This fork removes the AskClaude tool and adds opt-in forwarding for Pi prompt context.
|
|
9
11
|
|
|
10
12
|
## Highlights
|
|
11
13
|
|
|
12
|
-
- `claude-bridge/claude-fable-5`, Opus 4.8, Opus 4.7, Sonnet, and Haiku in `/model`.
|
|
14
|
+
- `claude-bridge/claude-fable-5`, Sonnet 5, Opus 4.8, Opus 4.7, Sonnet 4.6, and Haiku in `/model`.
|
|
13
15
|
- Pi tool calls run on Pi; Claude Code handles reasoning.
|
|
14
16
|
- Tool-use turns block until Pi-delivered tool results reach Claude Code, including persistent subagent panes.
|
|
15
17
|
- Session continuity across normal turns, `/compact`, tree navigation, and abort recovery.
|
|
@@ -94,24 +96,24 @@ Keys may be bare model IDs (`claude-opus-4-8`), `claude-bridge/<id>`, or `*` for
|
|
|
94
96
|
|
|
95
97
|
### Fable 5 caveat
|
|
96
98
|
|
|
97
|
-
The bridge registers `claude-bridge/claude-fable-5` and `claude-bridge/claude-opus-4-8` even when Pi's Anthropic model registry has not shipped those entries yet. For Fable 5, the bridge asks Claude Code to use Opus 4.8 as the availability fallback and preserves Claude Code's content-safety fallback events so Pi labels rerouted turns as Opus 4.8. Content-safety fallback still depends on Claude Code's own Fable 5 support; use Claude Code 2.1.170 or newer, and set `ANTHROPIC_DEFAULT_FABLE_MODEL` / `ANTHROPIC_DEFAULT_OPUS_MODEL` yourself when routing provider-specific model IDs through Bedrock, Vertex, or Foundry.
|
|
99
|
+
The bridge registers `claude-bridge/claude-fable-5`, `claude-bridge/claude-sonnet-5`, and `claude-bridge/claude-opus-4-8` even when Pi's Anthropic model registry has not shipped those entries yet. For Fable 5, the bridge asks Claude Code to use Opus 4.8 as the availability fallback and preserves Claude Code's content-safety fallback events so Pi labels rerouted turns as Opus 4.8. Content-safety fallback still depends on Claude Code's own Fable 5 support; use Claude Code 2.1.170 or newer, and set `ANTHROPIC_DEFAULT_FABLE_MODEL` / `ANTHROPIC_DEFAULT_OPUS_MODEL` yourself when routing provider-specific model IDs through Bedrock, Vertex, or Foundry.
|
|
98
100
|
|
|
99
101
|
## Extra usage and rate limits
|
|
100
102
|
|
|
101
103
|
Claude Code's `/extra-usage` local command works through the Claude Agent SDK. In Pi, use `/claude-bridge:extra` to run that flow from claude-bridge. Persist automatic launch on extra-usage errors with **Allow extra usage helper** in `/extensions:settings`.
|
|
102
104
|
|
|
103
|
-
When Claude Code
|
|
105
|
+
When Claude Code reports a rate-limit reset time, the bridge shows one clear `[rate-limit]` warning with timezone context and avoids repeating the same error line. If `pi-qol` is installed, it can use the reset time to resume later.
|
|
104
106
|
|
|
105
107
|
Allowed-warning rate-limit events are filtered before user notification. The bridge normalizes unambiguous numeric utilization (`0 < value < 1` as fractional, `1 < value <= 100` as percent), suppresses low or unit-ambiguous values such as exact `1`, and only shows a neutral warning at 80%+ instead of claiming an unverified `% used` value. Check Claude Code `/usage` for exact allowed-warning utilization.
|
|
106
108
|
|
|
107
|
-
If Claude Code accepts a turn but produces no
|
|
109
|
+
If Claude Code accepts a turn but produces no visible output, the bridge returns a retryable assistant error with a backoff hint instead of leaving Pi stuck waiting. Tune the first-output timeout with `CLAUDE_BRIDGE_STREAM_IDLE_TIMEOUT` (bare numbers are seconds; suffixes `ms`, `s`, and `m` are accepted). Default: `90s`; set `0` to disable.
|
|
108
110
|
|
|
109
111
|
## Debugging
|
|
110
112
|
|
|
111
113
|
Set `CLAUDE_BRIDGE_DEBUG=1` to write bridge logs to `~/.pi/agent/claude-bridge.log` and per-query Claude Code CLI logs under `~/.pi/agent/cc-cli-logs/`.
|
|
112
114
|
|
|
113
|
-
|
|
115
|
+
Tool-result integrity problems are surfaced even when debug logging is off. Pi shows an error notification and writes a diagnostic file to `~/.pi/agent/claude-bridge-diag.log` so lost or mismatched tool output is visible.
|
|
114
116
|
|
|
115
|
-
|
|
117
|
+
Startup failures include the resolved Claude executable and working directory, which makes missing binaries and wrong launch directories easier to fix.
|
|
116
118
|
|
|
117
|
-
|
|
119
|
+
Contributor-facing stream, tool-result, and startup diagnostics are documented in [`DEVELOPMENT.md`](./DEVELOPMENT.md).
|
package/bundle/index.js
CHANGED
|
@@ -22239,6 +22239,7 @@ function convertPiMessages(messages, customToolNameToSdk) {
|
|
|
22239
22239
|
// src/models.ts
|
|
22240
22240
|
var FABLE_MODEL_ID = "claude-fable-5";
|
|
22241
22241
|
var FABLE_FALLBACK_MODEL_ID = "claude-opus-4-8";
|
|
22242
|
+
var SONNET_5_MODEL_ID = "claude-sonnet-5";
|
|
22242
22243
|
function fallbackModelForPrimaryModel(modelId) {
|
|
22243
22244
|
return modelId === FABLE_MODEL_ID ? FABLE_FALLBACK_MODEL_ID : void 0;
|
|
22244
22245
|
}
|
|
@@ -22247,6 +22248,7 @@ var MODEL_IDS_IN_ORDER = [
|
|
|
22247
22248
|
FABLE_FALLBACK_MODEL_ID,
|
|
22248
22249
|
"claude-opus-4-7",
|
|
22249
22250
|
"claude-opus-4-6",
|
|
22251
|
+
SONNET_5_MODEL_ID,
|
|
22250
22252
|
"claude-sonnet-4-6",
|
|
22251
22253
|
"claude-haiku-4-5"
|
|
22252
22254
|
];
|
|
@@ -22268,6 +22270,14 @@ var FALLBACK_MODELS = {
|
|
|
22268
22270
|
input: ["text", "image"],
|
|
22269
22271
|
contextWindow: 1e6,
|
|
22270
22272
|
maxTokens: 128e3
|
|
22273
|
+
},
|
|
22274
|
+
[SONNET_5_MODEL_ID]: {
|
|
22275
|
+
id: SONNET_5_MODEL_ID,
|
|
22276
|
+
name: "Claude Sonnet 5",
|
|
22277
|
+
reasoning: true,
|
|
22278
|
+
input: ["text", "image"],
|
|
22279
|
+
contextWindow: 1e6,
|
|
22280
|
+
maxTokens: 128e3
|
|
22271
22281
|
}
|
|
22272
22282
|
};
|
|
22273
22283
|
function buildModels(piAiModels) {
|
package/package.json
CHANGED
package/src/models.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
export const FABLE_MODEL_ID = "claude-fable-5";
|
|
6
6
|
export const FABLE_FALLBACK_MODEL_ID = "claude-opus-4-8";
|
|
7
|
+
export const SONNET_5_MODEL_ID = "claude-sonnet-5";
|
|
7
8
|
|
|
8
9
|
export function fallbackModelForPrimaryModel(modelId: string): string | undefined {
|
|
9
10
|
return modelId === FABLE_MODEL_ID ? FABLE_FALLBACK_MODEL_ID : undefined;
|
|
@@ -14,6 +15,7 @@ export const MODEL_IDS_IN_ORDER = [
|
|
|
14
15
|
FABLE_FALLBACK_MODEL_ID,
|
|
15
16
|
"claude-opus-4-7",
|
|
16
17
|
"claude-opus-4-6",
|
|
18
|
+
SONNET_5_MODEL_ID,
|
|
17
19
|
"claude-sonnet-4-6",
|
|
18
20
|
"claude-haiku-4-5",
|
|
19
21
|
];
|
|
@@ -47,6 +49,14 @@ const FALLBACK_MODELS: Record<string, BridgeModelMetadata> = {
|
|
|
47
49
|
contextWindow: 1000000,
|
|
48
50
|
maxTokens: 128000,
|
|
49
51
|
},
|
|
52
|
+
[SONNET_5_MODEL_ID]: {
|
|
53
|
+
id: SONNET_5_MODEL_ID,
|
|
54
|
+
name: "Claude Sonnet 5",
|
|
55
|
+
reasoning: true,
|
|
56
|
+
input: ["text", "image"],
|
|
57
|
+
contextWindow: 1000000,
|
|
58
|
+
maxTokens: 128000,
|
|
59
|
+
},
|
|
50
60
|
};
|
|
51
61
|
|
|
52
62
|
// Project pi-ai's model entries down to the fields pi's registerProvider expects,
|