bermudis-pi-goodies 0.5.1 → 0.5.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.
package/README.md CHANGED
@@ -21,7 +21,7 @@ extensions. One entry point, ten independent features.
21
21
  After publishing the package to npm:
22
22
 
23
23
  ```bash
24
- pi install npm:bermudis-pi-goodies@0.5.1
24
+ pi install npm:bermudis-pi-goodies@0.5.2
25
25
  ```
26
26
 
27
27
  Remove any old `bermudis-pi-goodies.ts` symlink before reloading Pi. Each
package/model-thinking.ts CHANGED
@@ -218,11 +218,19 @@ export default function modelThinking(
218
218
  }
219
219
 
220
220
  pi.on("model_select", (event, ctx) => {
221
- apply(ctx, event.source === "restore");
221
+ // When Pi restores a model from session history (e.g. resume/fork), keep
222
+ // the thinking level that was active in that session instead of
223
+ // overwriting it with the per-model default.
224
+ if (event.source === "restore") return;
225
+ apply(ctx, false);
222
226
  });
223
227
 
224
- pi.on("session_start", (_event, ctx) => {
228
+ pi.on("session_start", (event, ctx) => {
225
229
  if (!ctx.model) return;
230
+ // Resumed or forked sessions already carry their last thinking level
231
+ // (restored by Pi from the session's branch). Don't clobber it with
232
+ // the per-model default; the default only applies to fresh sessions.
233
+ if (event.reason === "resume" || event.reason === "fork") return;
226
234
  apply(ctx, true);
227
235
  });
228
236
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bermudis-pi-goodies",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "private": false,
5
5
  "description": "A bundle of small, frequently-used Pi extensions.",
6
6
  "keywords": ["pi-package"],