@poncho-ai/harness 0.36.1 → 0.36.3
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 +4 -4
- package/CHANGELOG.md +18 -0
- package/dist/index.js +22 -12
- package/package.json +1 -1
- package/src/storage/postgres-engine.ts +1 -0
- package/src/storage/sql-dialect.ts +19 -10
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @poncho-ai/harness@0.36.
|
|
2
|
+
> @poncho-ai/harness@0.36.3 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[32m387.70 KB[39m
|
|
11
12
|
[32mESM[39m [1mdist/isolate-TCWTUVG4.js [22m[32m47.34 KB[39m
|
|
12
|
-
[32mESM[39m
|
|
13
|
-
[32mESM[39m ⚡️ Build success in 209ms
|
|
13
|
+
[32mESM[39m ⚡️ Build success in 202ms
|
|
14
14
|
[34mDTS[39m Build start
|
|
15
|
-
[32mDTS[39m ⚡️ Build success in
|
|
15
|
+
[32mDTS[39m ⚡️ Build success in 6580ms
|
|
16
16
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m56.62 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @poncho-ai/harness
|
|
2
2
|
|
|
3
|
+
## 0.36.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`abb7ec3`](https://github.com/cesr/poncho-ai/commit/abb7ec3c65503f6feaf133f5d2488dc25152a1a8) Thanks [@cesr](https://github.com/cesr)! - fix: messaging conversations not persisting in SQL storage engines
|
|
8
|
+
|
|
9
|
+
The messaging runner creates conversations with a deterministic ID and calls
|
|
10
|
+
`update()` to persist them. But `update()` was a plain UPDATE that silently
|
|
11
|
+
matched zero rows for new conversations, so messages were never saved.
|
|
12
|
+
Changed `update()` to an upsert (INSERT ... ON CONFLICT DO UPDATE) so
|
|
13
|
+
conversations are created on first write and updated on subsequent ones.
|
|
14
|
+
|
|
15
|
+
## 0.36.2
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [`04ebc73`](https://github.com/cesr/poncho-ai/commit/04ebc737914ee24b6f76b42016948c372d6a52d0) Thanks [@cesr](https://github.com/cesr)! - fix: disable prepared statements in PostgreSQL driver for compatibility with transaction-mode connection poolers (Supabase, PgBouncer)
|
|
20
|
+
|
|
3
21
|
## 0.36.1
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -3342,6 +3342,7 @@ var SqlStorageEngine = class {
|
|
|
3342
3342
|
},
|
|
3343
3343
|
update: async (conversation) => {
|
|
3344
3344
|
conversation.updatedAt = Date.now();
|
|
3345
|
+
if (!conversation.createdAt) conversation.createdAt = conversation.updatedAt;
|
|
3345
3346
|
const archive = conversation._toolResultArchive;
|
|
3346
3347
|
const harnessMessages = conversation._harnessMessages;
|
|
3347
3348
|
const continuationMessages = conversation._continuationMessages;
|
|
@@ -3354,26 +3355,34 @@ var SqlStorageEngine = class {
|
|
|
3354
3355
|
const harnessJson = harnessMessages ? JSON.stringify(harnessMessages) : null;
|
|
3355
3356
|
const continuationJson = continuationMessages ? JSON.stringify(continuationMessages) : null;
|
|
3356
3357
|
const msgCount = conversation.messages?.length ?? 0;
|
|
3358
|
+
const tid = normalizeTenant2(conversation.tenantId);
|
|
3359
|
+
const now2 = new Date(conversation.updatedAt).toISOString();
|
|
3360
|
+
const created = new Date(conversation.createdAt).toISOString();
|
|
3357
3361
|
await this.executor.run(
|
|
3358
3362
|
rewrite(
|
|
3359
|
-
`
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
+
`INSERT INTO conversations (id, agent_id, tenant_id, owner_id, title, data, message_count, created_at, updated_at,
|
|
3364
|
+
tool_result_archive, harness_messages, continuation_messages)
|
|
3365
|
+
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)
|
|
3366
|
+
${this.dialect.upsert(["id", "agent_id"])}
|
|
3367
|
+
data = excluded.data, title = excluded.title, message_count = excluded.message_count,
|
|
3368
|
+
updated_at = excluded.updated_at, tenant_id = excluded.tenant_id, owner_id = excluded.owner_id,
|
|
3369
|
+
tool_result_archive = excluded.tool_result_archive, harness_messages = excluded.harness_messages,
|
|
3370
|
+
continuation_messages = excluded.continuation_messages`,
|
|
3363
3371
|
this.dialect
|
|
3364
3372
|
),
|
|
3365
3373
|
[
|
|
3366
|
-
|
|
3374
|
+
conversation.conversationId,
|
|
3375
|
+
this.agentId,
|
|
3376
|
+
tid,
|
|
3377
|
+
conversation.ownerId,
|
|
3367
3378
|
conversation.title,
|
|
3379
|
+
data,
|
|
3368
3380
|
msgCount,
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
conversation.ownerId,
|
|
3381
|
+
created,
|
|
3382
|
+
now2,
|
|
3372
3383
|
archiveJson,
|
|
3373
3384
|
harnessJson,
|
|
3374
|
-
continuationJson
|
|
3375
|
-
conversation.conversationId,
|
|
3376
|
-
this.agentId
|
|
3385
|
+
continuationJson
|
|
3377
3386
|
]
|
|
3378
3387
|
);
|
|
3379
3388
|
},
|
|
@@ -4011,7 +4020,8 @@ var PostgresEngine = class extends SqlStorageEngine {
|
|
|
4011
4020
|
const postgres = (await import("postgres")).default;
|
|
4012
4021
|
this.sql = postgres(url, {
|
|
4013
4022
|
onnotice: () => {
|
|
4014
|
-
}
|
|
4023
|
+
},
|
|
4024
|
+
prepare: false
|
|
4015
4025
|
});
|
|
4016
4026
|
}
|
|
4017
4027
|
async initialize() {
|
package/package.json
CHANGED
|
@@ -279,6 +279,7 @@ export abstract class SqlStorageEngine implements StorageEngine {
|
|
|
279
279
|
|
|
280
280
|
update: async (conversation: Conversation): Promise<void> => {
|
|
281
281
|
conversation.updatedAt = Date.now();
|
|
282
|
+
if (!conversation.createdAt) conversation.createdAt = conversation.updatedAt;
|
|
282
283
|
// Strip heavy internal fields from the data blob — stored in separate columns
|
|
283
284
|
const archive = conversation._toolResultArchive;
|
|
284
285
|
const harnessMessages = conversation._harnessMessages;
|
|
@@ -292,26 +293,34 @@ export abstract class SqlStorageEngine implements StorageEngine {
|
|
|
292
293
|
const harnessJson = harnessMessages ? JSON.stringify(harnessMessages) : null;
|
|
293
294
|
const continuationJson = continuationMessages ? JSON.stringify(continuationMessages) : null;
|
|
294
295
|
const msgCount = conversation.messages?.length ?? 0;
|
|
296
|
+
const tid = normalizeTenant(conversation.tenantId);
|
|
297
|
+
const now = new Date(conversation.updatedAt).toISOString();
|
|
298
|
+
const created = new Date(conversation.createdAt).toISOString();
|
|
295
299
|
await this.executor.run(
|
|
296
300
|
rewrite(
|
|
297
|
-
`
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
+
`INSERT INTO conversations (id, agent_id, tenant_id, owner_id, title, data, message_count, created_at, updated_at,
|
|
302
|
+
tool_result_archive, harness_messages, continuation_messages)
|
|
303
|
+
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)
|
|
304
|
+
${this.dialect.upsert(["id", "agent_id"])}
|
|
305
|
+
data = excluded.data, title = excluded.title, message_count = excluded.message_count,
|
|
306
|
+
updated_at = excluded.updated_at, tenant_id = excluded.tenant_id, owner_id = excluded.owner_id,
|
|
307
|
+
tool_result_archive = excluded.tool_result_archive, harness_messages = excluded.harness_messages,
|
|
308
|
+
continuation_messages = excluded.continuation_messages`,
|
|
301
309
|
this.dialect,
|
|
302
310
|
),
|
|
303
311
|
[
|
|
304
|
-
|
|
312
|
+
conversation.conversationId,
|
|
313
|
+
this.agentId,
|
|
314
|
+
tid,
|
|
315
|
+
conversation.ownerId,
|
|
305
316
|
conversation.title,
|
|
317
|
+
data,
|
|
306
318
|
msgCount,
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
conversation.ownerId,
|
|
319
|
+
created,
|
|
320
|
+
now,
|
|
310
321
|
archiveJson,
|
|
311
322
|
harnessJson,
|
|
312
323
|
continuationJson,
|
|
313
|
-
conversation.conversationId,
|
|
314
|
-
this.agentId,
|
|
315
324
|
],
|
|
316
325
|
);
|
|
317
326
|
},
|