@poncho-ai/harness 0.50.1 → 0.50.2

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.50.1 build /home/runner/work/poncho-ai/poncho-ai/packages/harness
2
+ > @poncho-ai/harness@0.50.2 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 530.75 KB
12
11
  ESM dist/isolate-BNQ6P3HI.js 51.41 KB
13
- ESM ⚡️ Build success in 224ms
12
+ ESM dist/index.js 530.76 KB
13
+ ESM ⚡️ Build success in 181ms
14
14
  DTS Build start
15
- DTS ⚡️ Build success in 6878ms
15
+ DTS ⚡️ Build success in 5658ms
16
16
  DTS dist/index.d.ts 89.28 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @poncho-ai/harness
2
2
 
3
+ ## 0.50.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#133](https://github.com/cesr/poncho-ai/pull/133) [`60e21c8`](https://github.com/cesr/poncho-ai/commit/60e21c8c18054d2824cf7364b71dabfd07574b48) Thanks [@cesr](https://github.com/cesr)! - harness: don't inject the "interrupted by a time limit" bridge when resuming from tool results
8
+
9
+ A taskless `run()` (continuation checkpoint, or `continueFromToolResult` —
10
+ e.g. resuming after an approval gate) injected a synthetic user message
11
+ telling the model its turn was "interrupted by a time limit ... continue
12
+ EXACTLY from where you left off, do not re-summarize." That bridge is only
13
+ appropriate when the model was actually cut off mid-response (the last
14
+ message is an `assistant` turn, which some providers also reject as a
15
+ conversation-ending message).
16
+
17
+ When the last message is a `tool` result — which is the case for every
18
+ `continueFromToolResult` resume — the conversation already ends in a
19
+ provider-valid user `tool_result` block and the model continues from the
20
+ results naturally. Injecting the bridge there was a bug: after a normal
21
+ approval resolution the model was told its turn had been killed by a time
22
+ limit, causing it to distrust and re-derive context (re-reading the VFS,
23
+ concluding it had "hallucinated" data it had legitimately loaded). The
24
+ bridge is now only added when the last message is an `assistant` turn, and
25
+ its wording no longer hard-codes "time limit" (max-steps checkpoints use
26
+ the same path).
27
+
3
28
  ## 0.50.1
4
29
 
5
30
  ### Patch Changes
package/dist/index.js CHANGED
@@ -10441,10 +10441,10 @@ ${this.skillFingerprint}`;
10441
10441
  }
10442
10442
  } else {
10443
10443
  const lastMsg = messages[messages.length - 1];
10444
- if (lastMsg && lastMsg.role !== "user") {
10444
+ if (lastMsg && lastMsg.role === "assistant") {
10445
10445
  messages.push({
10446
10446
  role: "user",
10447
- content: "[System: Your previous turn was interrupted by a time limit. Your partial response above is already visible to the user. Continue EXACTLY from where you left off \u2014 do NOT restart, re-summarize, or repeat any content you already produced. If you were mid-sentence or mid-table, continue that sentence or table. Proceed directly with the next action or output.]",
10447
+ content: "[System: Your previous turn was interrupted before you finished. Your partial response above is already visible to the user. Continue EXACTLY from where you left off \u2014 do NOT restart, re-summarize, or repeat any content you already produced. If you were mid-sentence or mid-table, continue that sentence or table. Proceed directly with the next action or output.]",
10448
10448
  metadata: { timestamp: now(), id: randomUUID5() }
10449
10449
  });
10450
10450
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poncho-ai/harness",
3
- "version": "0.50.1",
3
+ "version": "0.50.2",
4
4
  "description": "Agent execution runtime - conversation loop, tool dispatch, streaming",
5
5
  "repository": {
6
6
  "type": "git",
package/src/harness.ts CHANGED
@@ -2388,14 +2388,25 @@ Code is wrapped in an async IIFE — use \`return\` to return a value to the too
2388
2388
  });
2389
2389
  }
2390
2390
  } else {
2391
- // Continuation run (no explicit task). Some providers (Anthropic) require
2392
- // the conversation to end with a user message. Inject a transient signal
2393
- // that is sent to the LLM but never persisted to the conversation store.
2391
+ // Taskless run: either a genuine continuation checkpoint (the model
2392
+ // was cut off mid-response by a soft-deadline / max-steps boundary)
2393
+ // or a tool-result resume `continueFromToolResult`, e.g. after an
2394
+ // approval gate — whose last message is the tool results.
2395
+ //
2396
+ // Only the first case needs a bridge: ending on an assistant message
2397
+ // is invalid for some providers (Anthropic), and the model must be
2398
+ // told to continue rather than restart. A `tool` last message converts
2399
+ // to a user-role tool_result block, so the conversation already ends
2400
+ // "with a user message" and the model continues from the results
2401
+ // naturally. Injecting the bridge after tool results was a bug: it
2402
+ // told the model — after a normal approval resolution — that its turn
2403
+ // had been "interrupted by a time limit" and to not re-summarize,
2404
+ // which made it distrust and re-derive context it already had.
2394
2405
  const lastMsg = messages[messages.length - 1];
2395
- if (lastMsg && lastMsg.role !== "user") {
2406
+ if (lastMsg && lastMsg.role === "assistant") {
2396
2407
  messages.push({
2397
2408
  role: "user",
2398
- content: "[System: Your previous turn was interrupted by a time limit. Your partial response above is already visible to the user. Continue EXACTLY from where you left off — do NOT restart, re-summarize, or repeat any content you already produced. If you were mid-sentence or mid-table, continue that sentence or table. Proceed directly with the next action or output.]",
2409
+ content: "[System: Your previous turn was interrupted before you finished. Your partial response above is already visible to the user. Continue EXACTLY from where you left off — do NOT restart, re-summarize, or repeat any content you already produced. If you were mid-sentence or mid-table, continue that sentence or table. Proceed directly with the next action or output.]",
2399
2410
  metadata: { timestamp: now(), id: randomUUID() },
2400
2411
  });
2401
2412
  }