@bman654/clodex 2.11.0 → 2.11.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 +15 -12
- package/dist/cli.js +11 -5
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -245,8 +245,9 @@ A context window is a cost dial as much as a capacity number. OpenAI prices GPT-
|
|
|
245
245
|
and later prompts above **272,000 input tokens at 2x input and 1.5x output for the
|
|
246
246
|
full request**, which is why the Codex catalog reports a 272,000 window rather than
|
|
247
247
|
the model's ceiling. Newer families inherit the same boundary, so a model released
|
|
248
|
-
after this was written is covered without a clodex update. Clodex follows that: the
|
|
249
|
-
line, and a larger window is something you
|
|
248
|
+
after this was written is covered without a clodex update. Clodex follows that: the
|
|
249
|
+
default `standard` stop stays under the line, and a larger window is something you
|
|
250
|
+
ask for.
|
|
250
251
|
|
|
251
252
|
```sh
|
|
252
253
|
clodex models --context sol=max --save # this model's default, with a cost warning
|
|
@@ -254,19 +255,21 @@ clodex claude --context sol=max # this launch only, nothing saved
|
|
|
254
255
|
clodex models --context sol=default --save # back to the provider's tuned window
|
|
255
256
|
```
|
|
256
257
|
|
|
257
|
-
Each stop is reported with the numbers behind it: the raw window, the
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
258
|
+
Each stop is reported with the numbers behind it: the raw window, the effective
|
|
259
|
+
window a client should fill, and the account ceiling a larger stop can reach. A stop
|
|
260
|
+
above the ceiling is clamped and says so. When a request's own reported token count
|
|
261
|
+
crosses the boundary, clodex warns once per model for the life of the process,
|
|
262
|
+
because the client's token count and the provider's differ after translation and only
|
|
263
|
+
the provider's settles it.
|
|
263
264
|
|
|
264
265
|
Two things worth knowing about the numbers:
|
|
265
266
|
|
|
266
|
-
- **
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
267
|
+
- **Clodex reports the window the provider actually gives, and holds nothing back.**
|
|
268
|
+
Deciding how much of a window to leave free is the client's job — Claude Code
|
|
269
|
+
already reserves a fixed amount below whatever window it is told, and shrinking the
|
|
270
|
+
number first only costs usable context. A provider that declares a share of its own
|
|
271
|
+
is still honoured; clodex just never invents one. Use `--context` if you want a
|
|
272
|
+
smaller window than the provider offers.
|
|
270
273
|
- **The account ceiling moves.** It is server-side and per-account, and it has
|
|
271
274
|
changed by more than 2x within a single day in the past. `max` reads whatever the
|
|
272
275
|
catalog reports now and clamps to it, so a stale ceiling shrinks the stop rather
|
package/dist/cli.js
CHANGED
|
@@ -382,7 +382,7 @@ import { join } from "path";
|
|
|
382
382
|
// package.json
|
|
383
383
|
var package_default = {
|
|
384
384
|
name: "@bman654/clodex",
|
|
385
|
-
version: "2.11.
|
|
385
|
+
version: "2.11.1",
|
|
386
386
|
publishConfig: {
|
|
387
387
|
access: "public"
|
|
388
388
|
},
|
|
@@ -3121,7 +3121,6 @@ async function deleteProviderCredential(authRef, diag) {
|
|
|
3121
3121
|
}
|
|
3122
3122
|
|
|
3123
3123
|
// src/context-modes.ts
|
|
3124
|
-
var DEFAULT_EFFECTIVE_CONTEXT_PERCENT = 95;
|
|
3125
3124
|
function positiveInteger(value) {
|
|
3126
3125
|
return typeof value === "number" && Number.isSafeInteger(value) && value > 0 ? value : void 0;
|
|
3127
3126
|
}
|
|
@@ -5919,6 +5918,10 @@ function openAiPricingMetadata(id) {
|
|
|
5919
5918
|
pricingBoundaryNote: GPT_5_6_PRICING_NOTE
|
|
5920
5919
|
};
|
|
5921
5920
|
}
|
|
5921
|
+
var LEGACY_IMPOSED_CONTEXT_PERCENT = 95;
|
|
5922
|
+
function migratedEffectiveContextPercent(cached) {
|
|
5923
|
+
return cached === LEGACY_IMPOSED_CONTEXT_PERCENT ? void 0 : cached;
|
|
5924
|
+
}
|
|
5922
5925
|
function applyOAuthSeedContextMetadata(models) {
|
|
5923
5926
|
const seedById = new Map(buildOpenAiOAuthModels().map((model) => [model.id, model]));
|
|
5924
5927
|
return models.map((model) => {
|
|
@@ -5927,7 +5930,7 @@ function applyOAuthSeedContextMetadata(models) {
|
|
|
5927
5930
|
return {
|
|
5928
5931
|
...model,
|
|
5929
5932
|
maxContextWindow: model.maxContextWindow ?? seed?.maxContextWindow,
|
|
5930
|
-
effectiveContextPercent: model.effectiveContextPercent
|
|
5933
|
+
effectiveContextPercent: migratedEffectiveContextPercent(model.effectiveContextPercent),
|
|
5931
5934
|
pricingBoundary: model.pricingBoundary ?? seed?.pricingBoundary ?? pricing.pricingBoundary,
|
|
5932
5935
|
pricingBoundaryNote: model.pricingBoundaryNote ?? seed?.pricingBoundaryNote ?? pricing.pricingBoundaryNote,
|
|
5933
5936
|
maxOutputTokens: model.maxOutputTokens ?? seed?.maxOutputTokens,
|
|
@@ -5947,7 +5950,7 @@ function buildOpenAiOAuthModels() {
|
|
|
5947
5950
|
brand: deriveBrand(prefix),
|
|
5948
5951
|
contextWindow: resolveContextWindow(seed.id, seed.contextWindow),
|
|
5949
5952
|
maxContextWindow: seed.maxContextWindow,
|
|
5950
|
-
effectiveContextPercent: seed.effectiveContextPercent
|
|
5953
|
+
effectiveContextPercent: seed.effectiveContextPercent,
|
|
5951
5954
|
pricingBoundary: seed.pricingBoundary ?? pricing.pricingBoundary,
|
|
5952
5955
|
pricingBoundaryNote: seed.pricingBoundaryNote ?? pricing.pricingBoundaryNote,
|
|
5953
5956
|
maxOutputTokens: seed.maxOutputTokens,
|
|
@@ -15090,7 +15093,10 @@ function buildDynamicOAuthModel(entry, seedById, codexCatalog) {
|
|
|
15090
15093
|
brand: deriveBrand(prefix),
|
|
15091
15094
|
contextWindow: entry.context_window ?? resolveContextWindow(id),
|
|
15092
15095
|
maxContextWindow: entry.max_context_window,
|
|
15093
|
-
|
|
15096
|
+
// Absent means no reduction. clodex reports the window the provider actually
|
|
15097
|
+
// gives; deciding how much of it to leave free is the client's job, and Claude
|
|
15098
|
+
// Code already reserves a flat 33,000 tokens below whatever it is told.
|
|
15099
|
+
effectiveContextPercent: entry.effective_context_window_percent,
|
|
15094
15100
|
maxOutputTokens: entry.max_output_tokens,
|
|
15095
15101
|
...openAiPricingMetadata(id),
|
|
15096
15102
|
modelFormat: "openai",
|