pennyrouter 0.2.11 → 0.2.12
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 +3 -1
- package/src/launch.js +2 -1
- package/src/launch.test.js +2 -0
package/package.json
CHANGED
|
@@ -36,7 +36,9 @@ const LEGACY_PENNY_LABELS = [
|
|
|
36
36
|
"Penny Opus", "Penny Sonnet", "Penny Haiku", "Penny Fable",
|
|
37
37
|
];
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
// Used both for globally-installed Claude Code and `penny claude`, whose isolated
|
|
40
|
+
// launch environment otherwise bypasses ~/.claude/settings.json entirely.
|
|
41
|
+
export function writeClaudeCodeModelPresentation(env) {
|
|
40
42
|
for (const [slot, { name, description }] of Object.entries(CLAUDE_CODE_MODEL_PRESENTATION)) {
|
|
41
43
|
const prefix = `ANTHROPIC_DEFAULT_${slot.toUpperCase()}_MODEL`;
|
|
42
44
|
env[`${prefix}_NAME`] = name;
|
package/src/launch.js
CHANGED
|
@@ -13,7 +13,7 @@ import { fileURLToPath } from "node:url";
|
|
|
13
13
|
import { basename, dirname, join, resolve } from "node:path";
|
|
14
14
|
|
|
15
15
|
import { configureClaudeCodeStatusline } from "./statusline.js";
|
|
16
|
-
import { upgradeClaudeCodeModelValue } from "./harnesses/claude-code.js";
|
|
16
|
+
import { upgradeClaudeCodeModelValue, writeClaudeCodeModelPresentation } from "./harnesses/claude-code.js";
|
|
17
17
|
import { atomicWrite, homeDir, readJsonFile, readText } from "./state.js";
|
|
18
18
|
|
|
19
19
|
const CONFIG_VERSION = 1;
|
|
@@ -438,6 +438,7 @@ export function buildPennyInvocation(harness, args, config) {
|
|
|
438
438
|
if (models.sonnet) env.ANTHROPIC_DEFAULT_SONNET_MODEL = upgradeClaudeCodeModelValue(models.sonnet);
|
|
439
439
|
if (models.opus) env.ANTHROPIC_DEFAULT_OPUS_MODEL = upgradeClaudeCodeModelValue(models.opus);
|
|
440
440
|
if (models.fable) env.ANTHROPIC_DEFAULT_FABLE_MODEL = upgradeClaudeCodeModelValue(models.fable);
|
|
441
|
+
writeClaudeCodeModelPresentation(env);
|
|
441
442
|
// Per-model limits must come from Claude Code's recognized native model ids. This
|
|
442
443
|
// global override would incorrectly give Haiku the 1M window.
|
|
443
444
|
delete env.CLAUDE_CODE_MAX_CONTEXT_TOKENS;
|
package/src/launch.test.js
CHANGED
|
@@ -105,6 +105,8 @@ async function main() {
|
|
|
105
105
|
assert.equal(claude.env.ANTHROPIC_BASE_URL, "https://gateway.example/");
|
|
106
106
|
assert.equal(claude.env.ANTHROPIC_DEFAULT_OPUS_MODEL, "claude-opus-5");
|
|
107
107
|
assert.equal(claude.env.ANTHROPIC_DEFAULT_HAIKU_MODEL, "claude-haiku-4-5-20251001");
|
|
108
|
+
assert.equal(claude.env.ANTHROPIC_DEFAULT_HAIKU_MODEL_NAME, "Haiku 4.5 (PennyRouter)");
|
|
109
|
+
assert.equal(claude.env.ANTHROPIC_DEFAULT_HAIKU_MODEL_DESCRIPTION, "Fast, economical Claude model · 200K context");
|
|
108
110
|
assert.equal(claude.env.CLAUDE_CODE_MAX_CONTEXT_TOKENS, undefined);
|
|
109
111
|
|
|
110
112
|
const codex = buildPennyInvocation("codex", ["resume", "--last"], config);
|