@poncho-ai/sdk 1.15.1 → 1.15.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/sdk@1.15.1 build /home/runner/work/poncho-ai/poncho-ai/packages/sdk
2
+ > @poncho-ai/sdk@1.15.2 build /home/runner/work/poncho-ai/poncho-ai/packages/sdk
3
3
  > tsup src/index.ts --format esm --dts
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -8,7 +8,7 @@
8
8
  CLI Target: es2022
9
9
  ESM Build start
10
10
  ESM dist/index.js 17.24 KB
11
- ESM ⚡️ Build success in 18ms
11
+ ESM ⚡️ Build success in 21ms
12
12
  DTS Build start
13
- DTS ⚡️ Build success in 1324ms
14
- DTS dist/index.d.ts 31.79 KB
13
+ DTS ⚡️ Build success in 1365ms
14
+ DTS dist/index.d.ts 32.36 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @poncho-ai/sdk
2
2
 
3
+ ## 1.15.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`3a25676`](https://github.com/cesr/poncho-ai/commit/3a2567666e1bc8d6650818db76d07765c0250264) Thanks [@cesr](https://github.com/cesr)! - Add a per-run `model` override to `RunInput` (and forward it from `runConversationTurn`'s opts). The override is captured once at run start and wins over the agent definition's `model.name` for every step of the run.
8
+
9
+ Previously the only way to vary the model per run kind on a shared harness was mutating `parsedAgent.frontmatter.model.name` before each run — but the harness re-reads that field at the start of every step, so a concurrent run's mutation flipped an in-flight run's model mid-turn. Besides being the wrong model, the switch invalidated the run's entire Anthropic prompt cache (caches are per-model), observed in production as the same ~104k-token prefix being cache-written twice back-to-back, once per model. Callers should pass `model` in the run input instead of mutating frontmatter.
10
+
3
11
  ## 1.15.1
4
12
 
5
13
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -771,6 +771,17 @@ interface RunInput {
771
771
  * will hit the cache before the 5-min TTL expires.
772
772
  */
773
773
  disablePromptCache?: boolean;
774
+ /**
775
+ * Model name override for this run, captured once at run start. Takes
776
+ * precedence over the agent definition's `model.name` for every step of
777
+ * the run. Use this instead of mutating the parsed agent's frontmatter
778
+ * when one harness instance serves runs that need different models
779
+ * (e.g. user turns vs cron jobs) — a frontmatter mutation made while
780
+ * another run is in flight changes that run's model mid-turn, and the
781
+ * model switch invalidates its entire Anthropic prompt cache (caches
782
+ * are per-model).
783
+ */
784
+ model?: string;
774
785
  /** Scope this run to a specific tenant. */
775
786
  tenantId?: string;
776
787
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poncho-ai/sdk",
3
- "version": "1.15.1",
3
+ "version": "1.15.2",
4
4
  "description": "Core types and utilities for building Poncho skills",
5
5
  "repository": {
6
6
  "type": "git",
package/src/index.ts CHANGED
@@ -152,6 +152,17 @@ export interface RunInput {
152
152
  * will hit the cache before the 5-min TTL expires.
153
153
  */
154
154
  disablePromptCache?: boolean;
155
+ /**
156
+ * Model name override for this run, captured once at run start. Takes
157
+ * precedence over the agent definition's `model.name` for every step of
158
+ * the run. Use this instead of mutating the parsed agent's frontmatter
159
+ * when one harness instance serves runs that need different models
160
+ * (e.g. user turns vs cron jobs) — a frontmatter mutation made while
161
+ * another run is in flight changes that run's model mid-turn, and the
162
+ * model switch invalidates its entire Anthropic prompt cache (caches
163
+ * are per-model).
164
+ */
165
+ model?: string;
155
166
  /** Scope this run to a specific tenant. */
156
167
  tenantId?: string;
157
168
  /**