@poncho-ai/harness 0.43.0 → 0.43.1

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @poncho-ai/harness@0.43.0 build /home/runner/work/poncho-ai/poncho-ai/packages/harness
2
+ > @poncho-ai/harness@0.43.1 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
  CLI tsup v8.5.1
9
9
  CLI Target: es2022
10
10
  ESM Build start
11
+ ESM dist/index.js 506.50 KB
11
12
  ESM dist/isolate-VY35DGLM.js 49.43 KB
12
- ESM dist/index.js 506.40 KB
13
- ESM ⚡️ Build success in 222ms
13
+ ESM ⚡️ Build success in 164ms
14
14
  DTS Build start
15
- DTS ⚡️ Build success in 6907ms
15
+ DTS ⚡️ Build success in 6912ms
16
16
  DTS dist/index.d.ts 80.85 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @poncho-ai/harness
2
2
 
3
+ ## 0.43.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`134fae7`](https://github.com/cesr/poncho-ai/commit/134fae7eb4f3658b8d2dc0a5e560b0bcad094679) Thanks [@cesr](https://github.com/cesr)! - fix(harness): conversations.search now works on Postgres
8
+
9
+ The SQL for `engine.conversations.search()` matched `data LIKE $3`, but
10
+ `data` is a `jsonb` column in Postgres — `jsonb LIKE text` raises
11
+ `operator does not exist: jsonb ~~ unknown` (Postgres error 42883), so
12
+ every search call against a Postgres-backed engine 500'd at runtime.
13
+
14
+ Cast `data` to text in the Postgres branch (`data::text LIKE $3`).
15
+ SQLite stores `data` as TEXT-of-JSON, so no cast there.
16
+
17
+ Discovered while wiring `GET /me/conversations/search` in PonchOS.
18
+
3
19
  ## 0.43.0
4
20
 
5
21
  ### Minor Changes
package/dist/index.js CHANGED
@@ -3701,11 +3701,12 @@ var SqlStorageEngine = class {
3701
3701
  const filterTenant = tenantId !== void 0;
3702
3702
  const pattern = `%${query}%`;
3703
3703
  const params = [this.agentId, pattern, pattern];
3704
+ const dataMatch = this.dialect.tag === "postgresql" ? "data::text LIKE $3" : "data LIKE $3";
3704
3705
  let sql = `SELECT id, title, updated_at, created_at, owner_id, tenant_id,
3705
3706
  message_count, parent_conversation_id, parent_message_id,
3706
3707
  has_pending_approvals, channel_meta
3707
3708
  FROM conversations
3708
- WHERE agent_id = $1 AND (title LIKE $2 OR data LIKE $3)`;
3709
+ WHERE agent_id = $1 AND (title LIKE $2 OR ${dataMatch})`;
3709
3710
  if (filterTenant) {
3710
3711
  sql += ` AND tenant_id = $4`;
3711
3712
  params.push(tid);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poncho-ai/harness",
3
- "version": "0.43.0",
3
+ "version": "0.43.1",
4
4
  "description": "Agent execution runtime - conversation loop, tool dispatch, streaming",
5
5
  "repository": {
6
6
  "type": "git",
@@ -572,11 +572,16 @@ export abstract class SqlStorageEngine implements StorageEngine {
572
572
  const pattern = `%${query}%`;
573
573
  // SQLite uses positional ? so we can't reuse $2, need separate params
574
574
  const params: unknown[] = [this.agentId, pattern, pattern];
575
+ // Postgres rejects `jsonb LIKE text` — cast `data` to text in
576
+ // Postgres so the LIKE applies to its JSON serialization. SQLite's
577
+ // `data` column is TEXT (raw JSON string) so no cast needed.
578
+ const dataMatch =
579
+ this.dialect.tag === "postgresql" ? "data::text LIKE $3" : "data LIKE $3";
575
580
  let sql = `SELECT id, title, updated_at, created_at, owner_id, tenant_id,
576
581
  message_count, parent_conversation_id, parent_message_id,
577
582
  has_pending_approvals, channel_meta
578
583
  FROM conversations
579
- WHERE agent_id = $1 AND (title LIKE $2 OR data LIKE $3)`;
584
+ WHERE agent_id = $1 AND (title LIKE $2 OR ${dataMatch})`;
580
585
  if (filterTenant) {
581
586
  sql += ` AND tenant_id = $4`;
582
587
  params.push(tid);