@aragon-agent/core 0.2.26 → 0.2.28
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.
|
@@ -292,7 +292,9 @@ export async function runAgentLoop(ctx) {
|
|
|
292
292
|
// 3. INSIDE the `while`, not before it. A run that starts under the
|
|
293
293
|
// threshold and crosses it at turn 12 is the normal case, and it is the
|
|
294
294
|
// case an `agent_end`-based design cannot serve at all (D-1).
|
|
295
|
-
await runCompaction(ctx, { trigger: 'pressure', lastUsage, turnIndex })
|
|
295
|
+
if (await runCompaction(ctx, { trigger: 'pressure', lastUsage, turnIndex })) {
|
|
296
|
+
lastUsage = undefined;
|
|
297
|
+
}
|
|
296
298
|
if (ctx.signal.aborted)
|
|
297
299
|
break;
|
|
298
300
|
// ----- Turn start -----
|
|
@@ -351,6 +353,8 @@ export async function runAgentLoop(ctx) {
|
|
|
351
353
|
throw err;
|
|
352
354
|
overflowRecovered = true;
|
|
353
355
|
const recovered = await runCompaction(ctx, { trigger: 'overflow', lastUsage, turnIndex });
|
|
356
|
+
if (recovered)
|
|
357
|
+
lastUsage = undefined;
|
|
354
358
|
if (!recovered)
|
|
355
359
|
throw err;
|
|
356
360
|
if (ctx.signal.aborted)
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import type { ModelInfo } from './types.js';
|
|
2
2
|
export type ContextWindowInfo = Pick<ModelInfo, 'contextWindow'> & {
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* `user` is produced ONLY by a host layer (the CLI's model-windows.json); no
|
|
5
|
+
* Core code path ever returns it. It is in the union because `ModelInfo`
|
|
6
|
+
* carries whatever the host resolved, and a source Core cannot even name is
|
|
7
|
+
* a host value silently laundered into `catalog`.
|
|
8
|
+
*/
|
|
9
|
+
contextWindowSource: 'api' | 'catalog' | 'fallback' | 'user';
|
|
4
10
|
};
|
|
5
11
|
/** Never interpret output-token limits as an input/context limit. */
|
|
6
12
|
export declare function reportedContextWindow(model: Record<string, unknown>): ContextWindowInfo;
|
package/dist/llm/types.d.ts
CHANGED
|
@@ -160,8 +160,12 @@ export interface ModelInfo {
|
|
|
160
160
|
name: string;
|
|
161
161
|
provider: string;
|
|
162
162
|
contextWindow: number;
|
|
163
|
-
/**
|
|
164
|
-
|
|
163
|
+
/**
|
|
164
|
+
* Provenance of the context limit; omitted by legacy/custom providers.
|
|
165
|
+
* `user` is set only by a host layer from user configuration (the CLI's
|
|
166
|
+
* model-windows.json); Core itself never produces it.
|
|
167
|
+
*/
|
|
168
|
+
contextWindowSource?: 'api' | 'catalog' | 'fallback' | 'user';
|
|
165
169
|
maxOutputTokens: number;
|
|
166
170
|
supportsThinking: boolean;
|
|
167
171
|
supportsTools: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aragon-agent/core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.28",
|
|
4
4
|
"description": "AragonAgent core engine — LLM provider adapters, streaming, tool registry/execution, steering, idle watchdog, and an optional isolated-vm sandbox.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "AragonAgent contributors",
|