@vincemakes/kiso-code 0.39.1 → 0.39.2

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/dist/config.js CHANGED
@@ -102,6 +102,19 @@ export function parseConfig(text, source) {
102
102
  fail(`models.${name}.promptCaching`, "expected a boolean");
103
103
  if (p.streamIdleMs !== undefined && (typeof p.streamIdleMs !== "number" || !Number.isFinite(p.streamIdleMs) || p.streamIdleMs < 0))
104
104
  fail(`models.${name}.streamIdleMs`, "expected a non-negative number of milliseconds (0 disables the stream watchdog)");
105
+ // 0.39.2: `contextWindow` was DECLARED on this type, VALIDATED at
106
+ // the top level, and CONSUMED by resolveContextWindow — which
107
+ // prefers it over the global figure, with a comment saying why —
108
+ // and it was never copied here. So it never reached anything: 70
109
+ // of 70 profiles that declared one lost it in this object
110
+ // literal. The cost was not the `ctx ?` on the status row but the
111
+ // compaction threshold, which fell through to the 200k default
112
+ // for every model the registry does not carry — a 1M-window model
113
+ // compacting as though it had a fifth of its window. The
114
+ // documented workaround for exactly that ("set contextWindow in
115
+ // your profile") had never done anything.
116
+ if (p.contextWindow !== undefined && (typeof p.contextWindow !== "number" || !Number.isFinite(p.contextWindow) || p.contextWindow <= 0))
117
+ fail(`models.${name}.contextWindow`, "expected a positive token count");
105
118
  models[name] = {
106
119
  kind: p.kind,
107
120
  model: p.model,
@@ -109,6 +122,7 @@ export function parseConfig(text, source) {
109
122
  ...(typeof p.baseUrl === "string" ? { baseUrl: p.baseUrl } : {}),
110
123
  ...(typeof p.promptCaching === "boolean" ? { promptCaching: p.promptCaching } : {}),
111
124
  ...(typeof p.streamIdleMs === "number" ? { streamIdleMs: p.streamIdleMs } : {}),
125
+ ...(typeof p.contextWindow === "number" ? { contextWindow: p.contextWindow } : {}),
112
126
  };
113
127
  }
114
128
  out.models = models;
package/dist/dispatch.js CHANGED
@@ -19,6 +19,17 @@ import { join } from "node:path";
19
19
  * — kiso never silently drops a level, and now it shows the ones it takes.
20
20
  * A model the registry does not know shows `unknown` (nothing is guessed);
21
21
  * it must not read `none`, which is a REAL level since the Responses rows. */
22
+ /** A context figure for a NOTICE, in the status row's own form.
23
+ *
24
+ * `displayCtxRatio` returns NaN as its honest "nobody states this model's
25
+ * window", and the status row renders that as `ctx ?`. The `/compact`
26
+ * recap multiplied it and interpolated the result, so the same unknown
27
+ * reached the screen as `ctx NaN% → NaN%`: one value with a contract, and
28
+ * a second consumer that had not read it. The `%` moves inside, because
29
+ * the unknown form does not carry one. */
30
+ function ctxPercent(ratio) {
31
+ return Number.isFinite(ratio) ? `${Math.round(ratio * 100)}%` : "?";
32
+ }
22
33
  function effortNote(p) {
23
34
  const reasoning = lookupModelMetadata(p.model, p.baseUrl)?.capabilities.reasoning ?? null;
24
35
  const effort = reasoning?.effort ?? null;
@@ -732,7 +743,7 @@ export function dispatch(line, ctx) {
732
743
  const compacting = (info) => {
733
744
  const text = (elapsed) => `▘ compacting · ${info.rounds} rounds · ~${kUnit(info.tokens)} tokens · ${Math.max(0, elapsed)}s`;
734
745
  compactStart = Date.now();
735
- ctxBefore = Math.round(ctx.estimateCtx() * 100);
746
+ ctxBefore = ctxPercent(ctx.estimateCtx());
736
747
  dock.setStatus(text(0), "esc to cancel");
737
748
  compactTimer = setInterval(() => {
738
749
  dock.setStatus(text(Math.round((Date.now() - compactStart) / 1000)), "esc to cancel");
@@ -745,6 +756,12 @@ export function dispatch(line, ctx) {
745
756
  const focus = trimmed.slice(8).trim();
746
757
  const result = await ctx.session.summarize({
747
758
  signal: abort.signal,
759
+ // 0.39.2: the gesture gets the measured output budget and
760
+ // thinking off where the registry can vouch for turning it
761
+ // off. A fixed 4,000 was failing live sessions with "the
762
+ // summary turn ended with max_tokens"; a complete checkpoint
763
+ // of the reported size measured 18,837.
764
+ manualBudget: true,
748
765
  ...(focus !== "" ? { focus } : {}),
749
766
  onStart: (info) => {
750
767
  compactInfo = info;
@@ -760,11 +777,11 @@ export function dispatch(line, ctx) {
760
777
  // rounds, the one summary, the savings, the ctx drop
761
778
  // (the estimate BEFORE vs AFTER — the same chars/4
762
779
  // proxy the status bar shows, marked ~), and the time.
763
- const ctxAfter = Math.round(ctx.estimateCtx() * 100);
780
+ const ctxAfter = ctxPercent(ctx.estimateCtx());
764
781
  const elapsed = compactStart > 0 ? settledLabel((Date.now() - compactStart) / 1000) : "?s";
765
782
  // a non-null result implies onStart ran — the "?" is
766
783
  // reachable only at the type level
767
- body.notice(`[/compact] ✦ compacted · ${compactInfo?.rounds ?? "?"} rounds → 1 summary · saved ~${kUnit(result.savedTokens)} · ctx ${ctxBefore ?? "?"}% → ${ctxAfter}% · ${elapsed}`);
784
+ body.notice(`[/compact] ✦ compacted · ${compactInfo?.rounds ?? "?"} rounds → 1 summary · saved ~${kUnit(result.savedTokens)} · ctx ${ctxBefore ?? "?"} → ${ctxAfter} · ${elapsed}`);
768
785
  // 0.39.1 — the boundary row, under the recap.
769
786
  //
770
787
  // `summarized` is appended OFF-LOOP: session.summarize()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vincemakes/kiso-code",
3
- "version": "0.39.1",
3
+ "version": "0.39.2",
4
4
  "description": "kiso-code \u2014 the coding agent on kiso, the durable runtime for AI agents: kiso chat / kiso resume / kiso sessions.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -18,20 +18,20 @@
18
18
  "test": "vitest run"
19
19
  },
20
20
  "dependencies": {
21
- "@vincemakes/kiso-ask-ext": "0.39.1",
22
- "@vincemakes/kiso-core": "0.39.1",
23
- "@vincemakes/kiso-evals": "0.39.1",
24
- "@vincemakes/kiso-mcp-ext": "0.39.1",
25
- "@vincemakes/kiso-provider-anthropic": "0.39.1",
26
- "@vincemakes/kiso-provider-openai": "0.39.1",
27
- "@vincemakes/kiso-provider-openai-responses": "0.39.1",
28
- "@vincemakes/kiso-runtime": "0.39.1",
29
- "@vincemakes/kiso-skills-ext": "0.39.1",
30
- "@vincemakes/kiso-subagent-ext": "0.39.1",
31
- "@vincemakes/kiso-task-ext": "0.39.1",
32
- "@vincemakes/kiso-tools-node": "0.39.1",
33
- "@vincemakes/kiso-tui": "0.39.1",
34
- "@vincemakes/kiso-tui-cells": "0.39.1"
21
+ "@vincemakes/kiso-ask-ext": "0.39.2",
22
+ "@vincemakes/kiso-core": "0.39.2",
23
+ "@vincemakes/kiso-evals": "0.39.2",
24
+ "@vincemakes/kiso-mcp-ext": "0.39.2",
25
+ "@vincemakes/kiso-provider-anthropic": "0.39.2",
26
+ "@vincemakes/kiso-provider-openai": "0.39.2",
27
+ "@vincemakes/kiso-provider-openai-responses": "0.39.2",
28
+ "@vincemakes/kiso-runtime": "0.39.2",
29
+ "@vincemakes/kiso-skills-ext": "0.39.2",
30
+ "@vincemakes/kiso-subagent-ext": "0.39.2",
31
+ "@vincemakes/kiso-task-ext": "0.39.2",
32
+ "@vincemakes/kiso-tools-node": "0.39.2",
33
+ "@vincemakes/kiso-tui": "0.39.2",
34
+ "@vincemakes/kiso-tui-cells": "0.39.2"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/node": "^26.1.2",