@poncho-ai/harness 0.48.0 → 0.49.0
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/.turbo/turbo-build.log +5 -5
- package/CHANGELOG.md +20 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +4 -2
- package/package.json +1 -1
- package/src/config.ts +4 -0
- package/src/harness.ts +8 -2
- package/src/memory.ts +9 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @poncho-ai/harness@0.
|
|
2
|
+
> @poncho-ai/harness@0.49.0 build /home/runner/work/poncho-ai/poncho-ai/packages/harness
|
|
3
3
|
> node scripts/embed-docs.js && tsup src/index.ts --format esm --dts
|
|
4
4
|
|
|
5
5
|
[embed-docs] Generated poncho-docs.ts with 4 topics
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
[34mCLI[39m tsup v8.5.1
|
|
9
9
|
[34mCLI[39m Target: es2022
|
|
10
10
|
[34mESM[39m Build start
|
|
11
|
-
[32mESM[39m [1mdist/index.js [22m[32m528.41 KB[39m
|
|
12
11
|
[32mESM[39m [1mdist/isolate-VY35DGLM.js [22m[32m49.43 KB[39m
|
|
13
|
-
[32mESM[39m
|
|
12
|
+
[32mESM[39m [1mdist/index.js [22m[32m528.58 KB[39m
|
|
13
|
+
[32mESM[39m ⚡️ Build success in 197ms
|
|
14
14
|
[34mDTS[39m Build start
|
|
15
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m87.
|
|
15
|
+
[32mDTS[39m ⚡️ Build success in 5685ms
|
|
16
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m87.88 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @poncho-ai/harness
|
|
2
2
|
|
|
3
|
+
## 0.49.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#127](https://github.com/cesr/poncho-ai/pull/127) [`87b40d9`](https://github.com/cesr/poncho-ai/commit/87b40d9d6cebba4ac646598d154a767a1d2f3551) Thanks [@cesr](https://github.com/cesr)! - harness: stop truncating main memory by default
|
|
8
|
+
|
|
9
|
+
Main memory injected into the system prompt was hard-truncated at 4000
|
|
10
|
+
characters with a `...[truncated]` marker. Silently dropping the tail of
|
|
11
|
+
a user's memory every turn is a footgun, so the **default is now no
|
|
12
|
+
truncation** — the full memory is injected.
|
|
13
|
+
|
|
14
|
+
New `MemoryConfig.maxPromptChars` (also settable via
|
|
15
|
+
`storage.memory.maxPromptChars`) lets a consumer opt back _into_ a cap
|
|
16
|
+
for prompt-cost control: set a positive number and content beyond it is
|
|
17
|
+
sliced with the `...[truncated]` marker as before.
|
|
18
|
+
|
|
19
|
+
Behavior change: consumers that relied on the implicit 4000-char cap
|
|
20
|
+
will now see full memory in the prompt. To restore the old behavior set
|
|
21
|
+
`maxPromptChars: 4000`.
|
|
22
|
+
|
|
3
23
|
## 0.48.0
|
|
4
24
|
|
|
5
25
|
### Minor Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -341,6 +341,15 @@ interface MemoryConfig {
|
|
|
341
341
|
region?: string;
|
|
342
342
|
ttl?: number;
|
|
343
343
|
maxRecallConversations?: number;
|
|
344
|
+
/**
|
|
345
|
+
* Optional cap on the characters of main memory injected into the
|
|
346
|
+
* system prompt each turn. Default is **no cap** — the full memory is
|
|
347
|
+
* injected (silently truncating a user's memory every turn is a
|
|
348
|
+
* footgun). Set a positive number to opt into truncation for
|
|
349
|
+
* prompt-cost control; content beyond it is sliced with a
|
|
350
|
+
* `...[truncated]` marker.
|
|
351
|
+
*/
|
|
352
|
+
maxPromptChars?: number;
|
|
344
353
|
}
|
|
345
354
|
interface MemoryStore {
|
|
346
355
|
getMainMemory(): Promise<MainMemory>;
|
|
@@ -445,6 +454,7 @@ interface StorageConfig {
|
|
|
445
454
|
memory?: {
|
|
446
455
|
enabled?: boolean;
|
|
447
456
|
maxRecallConversations?: number;
|
|
457
|
+
maxPromptChars?: number;
|
|
448
458
|
};
|
|
449
459
|
limits?: {
|
|
450
460
|
maxFileSize?: number;
|
package/dist/index.js
CHANGED
|
@@ -544,7 +544,8 @@ var resolveMemoryConfig = (config) => {
|
|
|
544
544
|
table: config.storage.table,
|
|
545
545
|
region: config.storage.region,
|
|
546
546
|
ttl: resolveTtl(config.storage.ttl, "memory"),
|
|
547
|
-
maxRecallConversations: config.storage.memory?.maxRecallConversations ?? config.memory?.maxRecallConversations
|
|
547
|
+
maxRecallConversations: config.storage.memory?.maxRecallConversations ?? config.memory?.maxRecallConversations,
|
|
548
|
+
maxPromptChars: config.storage.memory?.maxPromptChars ?? config.memory?.maxPromptChars
|
|
548
549
|
};
|
|
549
550
|
}
|
|
550
551
|
return config?.memory;
|
|
@@ -10233,7 +10234,8 @@ Browser sessions (cookies, localStorage, login state) are automatically saved an
|
|
|
10233
10234
|
### Tabs and resources
|
|
10234
10235
|
Each conversation gets its own browser tab sharing a single browser instance. Call \`browser_close\` when done to free the tab. If you don't close it, the tab stays open and the user can continue interacting with it.` : "";
|
|
10235
10236
|
const mainMemory = await memoryPromise;
|
|
10236
|
-
const
|
|
10237
|
+
const memCap = this.memoryConfig?.maxPromptChars ?? 0;
|
|
10238
|
+
const boundedMainMemory = mainMemory && memCap > 0 && mainMemory.content.length > memCap ? `${mainMemory.content.slice(0, memCap)}
|
|
10237
10239
|
...[truncated]` : mainMemory?.content;
|
|
10238
10240
|
const memoryContext = boundedMainMemory && boundedMainMemory.trim().length > 0 ? `
|
|
10239
10241
|
## Persistent Memory
|
package/package.json
CHANGED
package/src/config.ts
CHANGED
|
@@ -21,6 +21,7 @@ export interface StorageConfig {
|
|
|
21
21
|
memory?: {
|
|
22
22
|
enabled?: boolean;
|
|
23
23
|
maxRecallConversations?: number;
|
|
24
|
+
maxPromptChars?: number;
|
|
24
25
|
};
|
|
25
26
|
limits?: {
|
|
26
27
|
maxFileSize?: number;
|
|
@@ -335,6 +336,9 @@ export const resolveMemoryConfig = (
|
|
|
335
336
|
maxRecallConversations:
|
|
336
337
|
config.storage.memory?.maxRecallConversations ??
|
|
337
338
|
config.memory?.maxRecallConversations,
|
|
339
|
+
maxPromptChars:
|
|
340
|
+
config.storage.memory?.maxPromptChars ??
|
|
341
|
+
config.memory?.maxPromptChars,
|
|
338
342
|
};
|
|
339
343
|
}
|
|
340
344
|
return config?.memory;
|
package/src/harness.ts
CHANGED
|
@@ -2184,9 +2184,15 @@ Browser sessions (cookies, localStorage, login state) are automatically saved an
|
|
|
2184
2184
|
Each conversation gets its own browser tab sharing a single browser instance. Call \`browser_close\` when done to free the tab. If you don't close it, the tab stays open and the user can continue interacting with it.`
|
|
2185
2185
|
: "";
|
|
2186
2186
|
const mainMemory = await memoryPromise;
|
|
2187
|
+
// Main memory is injected in full by default — silently dropping the
|
|
2188
|
+
// tail of a user's memory every turn is a footgun. Set
|
|
2189
|
+
// `maxPromptChars` to a positive number to opt into a cap (e.g. for
|
|
2190
|
+
// prompt-cost control); content beyond it is sliced with a
|
|
2191
|
+
// `...[truncated]` marker.
|
|
2192
|
+
const memCap = this.memoryConfig?.maxPromptChars ?? 0;
|
|
2187
2193
|
const boundedMainMemory =
|
|
2188
|
-
mainMemory && mainMemory.content.length >
|
|
2189
|
-
? `${mainMemory.content.slice(0,
|
|
2194
|
+
mainMemory && memCap > 0 && mainMemory.content.length > memCap
|
|
2195
|
+
? `${mainMemory.content.slice(0, memCap)}\n...[truncated]`
|
|
2190
2196
|
: mainMemory?.content;
|
|
2191
2197
|
const memoryContext =
|
|
2192
2198
|
boundedMainMemory && boundedMainMemory.trim().length > 0
|
package/src/memory.ts
CHANGED
|
@@ -15,6 +15,15 @@ export interface MemoryConfig {
|
|
|
15
15
|
region?: string;
|
|
16
16
|
ttl?: number;
|
|
17
17
|
maxRecallConversations?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Optional cap on the characters of main memory injected into the
|
|
20
|
+
* system prompt each turn. Default is **no cap** — the full memory is
|
|
21
|
+
* injected (silently truncating a user's memory every turn is a
|
|
22
|
+
* footgun). Set a positive number to opt into truncation for
|
|
23
|
+
* prompt-cost control; content beyond it is sliced with a
|
|
24
|
+
* `...[truncated]` marker.
|
|
25
|
+
*/
|
|
26
|
+
maxPromptChars?: number;
|
|
18
27
|
}
|
|
19
28
|
|
|
20
29
|
export interface MemoryStore {
|