koneck 2.25.66 → 2.25.67
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/context-limit.d.ts +28 -0
- package/dist/context-limit.d.ts.map +1 -1
- package/dist/context-limit.js +43 -0
- package/dist/context-limit.js.map +1 -1
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +55 -15
- package/dist/engine.js.map +1 -1
- package/dist/ink-chat.d.ts.map +1 -1
- package/dist/ink-chat.js +17 -6
- package/dist/ink-chat.js.map +1 -1
- package/dist/providers.d.ts +22 -0
- package/dist/providers.d.ts.map +1 -1
- package/dist/providers.js +12 -1
- package/dist/providers.js.map +1 -1
- package/dist/types.d.ts +17 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/ink-chat.js
CHANGED
|
@@ -2,12 +2,12 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import React, { useState, useEffect, useRef } from 'react';
|
|
3
3
|
import { Box, Static, Text, render, useApp, useInput, useStdin } from 'ink';
|
|
4
4
|
import { execa } from 'execa';
|
|
5
|
-
import { createAgentSession, buildClient, resolveAgentConcurrency, toolsUnsupportedNotice
|
|
5
|
+
import { createAgentSession, buildClient, resolveAgentConcurrency, toolsUnsupportedNotice } from './engine.js';
|
|
6
6
|
import { estimateCost, formatCost } from './pricing.js';
|
|
7
7
|
import { generateSessionId, saveSession, listSessions, loadSession, relativeAge, renameSession, forkSession, archiveSession, findSession, } from './session.js';
|
|
8
8
|
import { loadMemory } from './memory.js';
|
|
9
9
|
import { loadKoneckConfig, saveKoneckConfig, setConfigKey, configKeyDescriptions, CONFIG_FILE, CONFIG_SCHEMA, stepValue, displayValue } from './config-store.js';
|
|
10
|
-
import { PROVIDERS, resolveProvider, getApiKey, addUserProvider, userProvidersPath, needsNoCredential } from './providers.js';
|
|
10
|
+
import { PROVIDERS, resolveProvider, getApiKey, addUserProvider, userProvidersPath, needsNoCredential, servesLocally } from './providers.js';
|
|
11
11
|
import { resolveEndpoint, normaliseEndpoint, withEndpoint, savedEndpoints, shortSource, resolveModelChoice, withModel } from './endpoints.js';
|
|
12
12
|
import { loadProjectConfig, loadGlobalConfig } from './config.js';
|
|
13
13
|
import { listCheckpoints, revertCheckpoint, snapshotTree, filesTouchedBy } from './checkpoint.js';
|
|
@@ -810,6 +810,8 @@ function App({ config: initialConfig, clearFrame }) {
|
|
|
810
810
|
const incompleteRef = useRef(null);
|
|
811
811
|
/** The model already reported as unable to call tools, so the notice is not repeated. */
|
|
812
812
|
const toolsWarnedRef = useRef(null);
|
|
813
|
+
/** The crowded-window notice is about the setup, so it is said once per session. */
|
|
814
|
+
const crowdedWarnedRef = useRef(false);
|
|
813
815
|
/**
|
|
814
816
|
* The id to save under, mirrored in a ref.
|
|
815
817
|
*
|
|
@@ -1031,16 +1033,25 @@ function App({ config: initialConfig, clearFrame }) {
|
|
|
1031
1033
|
toolsWarnedRef.current = model;
|
|
1032
1034
|
addSystem(toolsUnsupportedNotice(model));
|
|
1033
1035
|
},
|
|
1036
|
+
onCrowdedWindow: (_fixed, _limit, advice) => {
|
|
1037
|
+
// Once per session: it is a property of the setup, not of the turn.
|
|
1038
|
+
if (crowdedWarnedRef.current)
|
|
1039
|
+
return;
|
|
1040
|
+
crowdedWarnedRef.current = true;
|
|
1041
|
+
addSystem(advice);
|
|
1042
|
+
},
|
|
1034
1043
|
onLooping: (copies) => {
|
|
1035
1044
|
// The loop itself is the symptom. On a local model the cause is almost always the window:
|
|
1036
1045
|
// Ollama serves 4096 tokens unless told otherwise, whatever the model was trained for, and
|
|
1037
1046
|
// a conversation that no longer fits is exactly what makes a model start repeating.
|
|
1038
|
-
|
|
1047
|
+
// Judged by the endpoint, not the provider's name: a LAN Ollama reached through a slot
|
|
1048
|
+
// called "omni" is still Ollama, and asking about the name missed exactly that setup.
|
|
1049
|
+
const local = servesLocally(cfg.provider, endpointFor(cfg.provider).url);
|
|
1039
1050
|
addSystem(`${cfg.model} repeated the same text ${copies} times, so the reply was cut short.` +
|
|
1040
1051
|
(local
|
|
1041
|
-
? `\n\nThis is usually the context window rather than the model. Ollama serves
|
|
1042
|
-
`tokens by default however large the model is — set ` +
|
|
1043
|
-
|
|
1052
|
+
? `\n\nThis is usually the context window rather than the model. Ollama serves 4,096 ` +
|
|
1053
|
+
`tokens by default however large the model is — set \`OLLAMA_CONTEXT_LENGTH=32768\` ` +
|
|
1054
|
+
`where Ollama runs, restart it, then \`/context\` to confirm.`
|
|
1044
1055
|
: ''));
|
|
1045
1056
|
},
|
|
1046
1057
|
onThinking: (text, totalChars) => {
|