pennyrouter 0.2.18 → 0.2.19
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/package.json +1 -1
- package/src/harnesses/claude-code.js +11 -7
- package/src/launch.test.js +5 -2
package/package.json
CHANGED
|
@@ -4,15 +4,19 @@ import { configureClaudeCodeStatusline, restoreClaudeCodeStatusline } from "../s
|
|
|
4
4
|
const CONFIG_PATH = "~/.claude/settings.json";
|
|
5
5
|
const LEGACY_MODEL_LABEL = "PennyRouter Bundle";
|
|
6
6
|
const CONNECTOR_SETTING = "disableClaudeAiConnectors";
|
|
7
|
-
// The slot values remain genuine Anthropic ids so Claude Code recognizes
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
7
|
+
// The slot values remain genuine Anthropic ids so Claude Code recognizes them and sends the
|
|
8
|
+
// native id on the wire. Claude Code separately supports *_MODEL_NAME and *_MODEL_DESCRIPTION
|
|
9
|
+
// for the picker, so Penny can present a friendly alias without sacrificing model recognition.
|
|
10
|
+
//
|
|
11
|
+
// The 1M-context variant is a `[1m]` suffix on the id — Claude Code does NOT infer a 1M window
|
|
12
|
+
// from a bare id, so a bare `claude-sonnet-5` gets 200K and auto-compacts around 150K. The
|
|
13
|
+
// suffix rides the wire; the gateway strips it for the upstream model and turns it into the
|
|
14
|
+
// `context-1m` beta header. Haiku has no 1M variant, so it stays bare.
|
|
11
15
|
export const CLAUDE_CODE_MODELS = {
|
|
12
16
|
haiku: "claude-haiku-4-5-20251001",
|
|
13
|
-
sonnet: "claude-sonnet-5",
|
|
14
|
-
opus: "claude-opus-5",
|
|
15
|
-
fable: "claude-fable-5",
|
|
17
|
+
sonnet: "claude-sonnet-5[1m]",
|
|
18
|
+
opus: "claude-opus-5[1m]",
|
|
19
|
+
fable: "claude-fable-5[1m]",
|
|
16
20
|
custom: "Penny Custom", // -> dynamic (PennyRouter cost-routing)
|
|
17
21
|
};
|
|
18
22
|
const CLAUDE_CODE_MODEL_PRESENTATION = {
|
package/src/launch.test.js
CHANGED
|
@@ -103,7 +103,10 @@ async function main() {
|
|
|
103
103
|
assert.ok(!claude.args.includes("--plugin-dir"));
|
|
104
104
|
assert.equal(claude.env.ANTHROPIC_AUTH_TOKEN, "pr-super-secret");
|
|
105
105
|
assert.equal(claude.env.ANTHROPIC_BASE_URL, "https://gateway.example/");
|
|
106
|
-
|
|
106
|
+
// 1M-capable slots carry the `[1m]` suffix; Haiku has no 1M variant and stays bare.
|
|
107
|
+
// Per-slot suffixes, not the global CLAUDE_CODE_MAX_CONTEXT_TOKENS override, which
|
|
108
|
+
// would wrongly hand Haiku a 1M window too.
|
|
109
|
+
assert.equal(claude.env.ANTHROPIC_DEFAULT_OPUS_MODEL, "claude-opus-5[1m]");
|
|
107
110
|
assert.equal(claude.env.ANTHROPIC_DEFAULT_HAIKU_MODEL, "claude-haiku-4-5-20251001");
|
|
108
111
|
assert.equal(claude.env.ANTHROPIC_DEFAULT_HAIKU_MODEL_NAME, "Haiku 4.5 (PennyRouter)");
|
|
109
112
|
assert.equal(claude.env.ANTHROPIC_DEFAULT_HAIKU_MODEL_DESCRIPTION, "Fast, economical Claude model · 200K context");
|
|
@@ -128,7 +131,7 @@ async function main() {
|
|
|
128
131
|
});
|
|
129
132
|
const persistedClaude = JSON.parse(fs.readFileSync(path.join(home, ".claude", "settings.json"), "utf8"));
|
|
130
133
|
assert.equal(persistedClaude.env.ANTHROPIC_DEFAULT_HAIKU_MODEL, "claude-haiku-4-5-20251001");
|
|
131
|
-
assert.equal(persistedClaude.env.ANTHROPIC_DEFAULT_SONNET_MODEL, "claude-sonnet-5");
|
|
134
|
+
assert.equal(persistedClaude.env.ANTHROPIC_DEFAULT_SONNET_MODEL, "claude-sonnet-5[1m]");
|
|
132
135
|
assert.equal("CLAUDE_CODE_MAX_CONTEXT_TOKENS" in persistedClaude.env, false);
|
|
133
136
|
|
|
134
137
|
await removePennyHarness("claude-code");
|