@poncho-ai/harness 0.28.1 → 0.28.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.28.1 build /home/runner/work/poncho-ai/poncho-ai/packages/harness
2
+ > @poncho-ai/harness@0.28.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,8 +8,8 @@
8
8
  CLI tsup v8.5.1
9
9
  CLI Target: es2022
10
10
  ESM Build start
11
- ESM dist/index.js 288.74 KB
12
- ESM ⚡️ Build success in 135ms
11
+ ESM dist/index.js 289.62 KB
12
+ ESM ⚡️ Build success in 213ms
13
13
  DTS Build start
14
- DTS ⚡️ Build success in 6964ms
14
+ DTS ⚡️ Build success in 7196ms
15
15
  DTS dist/index.d.ts 29.62 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @poncho-ai/harness
2
2
 
3
+ ## 0.28.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`98df42f`](https://github.com/cesr/poncho-ai/commit/98df42f79e0a376d0a864598557758bfa644039d) Thanks [@cesr](https://github.com/cesr)! - Fix serverless subagent and continuation reliability
8
+ - Use stable internal secret across serverless instances for callback auth
9
+ - Wrap continuation self-fetches in waitUntil to survive function shutdown
10
+ - Set runStatus during callback re-runs so clients detect active processing
11
+ - Add post-streaming soft deadline check to catch long model responses
12
+ - Client auto-recovers from abrupt stream termination and orphaned continuations
13
+ - Fix callback continuation losing \_continuationMessages when no pending results
14
+
3
15
  ## 0.28.1
4
16
 
5
17
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1604,6 +1604,8 @@ Remote storage keys are namespaced and versioned, for example \`poncho:v1:<agent
1604
1604
  | \`ANTHROPIC_API_KEY\` | Yes* | Claude API key |
1605
1605
  | \`OPENAI_API_KEY\` | No | OpenAI API key (if using OpenAI) |
1606
1606
  | \`PONCHO_AUTH_TOKEN\` | No | Unified auth token (Web UI passphrase + API Bearer token) |
1607
+ | \`PONCHO_INTERNAL_SECRET\` | No | Shared secret used by internal serverless callbacks (recommended for Vercel/Lambda) |
1608
+ | \`PONCHO_SELF_BASE_URL\` | No | Explicit base URL for internal self-callbacks when auto-detection is unavailable |
1607
1609
  | \`OTEL_EXPORTER_OTLP_ENDPOINT\` | No | Telemetry destination |
1608
1610
  | \`LATITUDE_API_KEY\` | No | Latitude dashboard integration |
1609
1611
  | \`LATITUDE_PROJECT_ID\` | No | Latitude project identifier for capture traces |
@@ -6347,6 +6349,22 @@ ${textContent}` };
6347
6349
  yield emitCancellation();
6348
6350
  return;
6349
6351
  }
6352
+ if (softDeadlineMs > 0 && now() - start > softDeadlineMs) {
6353
+ const result_ = {
6354
+ status: "completed",
6355
+ response: responseText + fullText,
6356
+ steps: step,
6357
+ tokens: { input: totalInputTokens, output: totalOutputTokens, cached: totalCachedTokens },
6358
+ duration: now() - start,
6359
+ continuation: true,
6360
+ continuationMessages: [...messages],
6361
+ maxSteps,
6362
+ contextTokens: latestContextTokens + toolOutputEstimateSinceModel,
6363
+ contextWindow
6364
+ };
6365
+ yield pushEvent({ type: "run:completed", runId, result: result_ });
6366
+ return;
6367
+ }
6350
6368
  const finishReason = await result.finishReason;
6351
6369
  if (finishReason === "error") {
6352
6370
  yield pushEvent({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poncho-ai/harness",
3
- "version": "0.28.1",
3
+ "version": "0.28.2",
4
4
  "description": "Agent execution runtime - conversation loop, tool dispatch, streaming",
5
5
  "repository": {
6
6
  "type": "git",
package/src/harness.ts CHANGED
@@ -2030,6 +2030,25 @@ ${boundedMainMemory.trim()}`
2030
2030
  return;
2031
2031
  }
2032
2032
 
2033
+ // Post-streaming soft deadline: if the model stream took long enough to
2034
+ // push past the soft deadline, checkpoint now before tool execution.
2035
+ if (softDeadlineMs > 0 && now() - start > softDeadlineMs) {
2036
+ const result_: RunResult = {
2037
+ status: "completed",
2038
+ response: responseText + fullText,
2039
+ steps: step,
2040
+ tokens: { input: totalInputTokens, output: totalOutputTokens, cached: totalCachedTokens },
2041
+ duration: now() - start,
2042
+ continuation: true,
2043
+ continuationMessages: [...messages],
2044
+ maxSteps,
2045
+ contextTokens: latestContextTokens + toolOutputEstimateSinceModel,
2046
+ contextWindow,
2047
+ };
2048
+ yield pushEvent({ type: "run:completed", runId, result: result_ });
2049
+ return;
2050
+ }
2051
+
2033
2052
  // Check finish reason for error / abnormal completions.
2034
2053
  const finishReason = await result.finishReason;
2035
2054