pi-prompt-template-model 0.2.0 → 0.2.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.
- package/CHANGELOG.md +6 -0
- package/index.ts +6 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.2.1] - 2026-01-31
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Thinking level now correctly restored after commands that switch model without a `thinking` field. Previously, running a prompt template that only specified `model` would reset thinking to "off" instead of restoring the original level (e.g., "high").
|
|
10
|
+
|
|
5
11
|
## [0.2.0] - 2025-01-31
|
|
6
12
|
|
|
7
13
|
### Added
|
package/index.ts
CHANGED
|
@@ -549,8 +549,9 @@ export default function promptModelExtension(pi: ExtensionAPI) {
|
|
|
549
549
|
return;
|
|
550
550
|
}
|
|
551
551
|
|
|
552
|
-
// Capture current
|
|
552
|
+
// Capture current state before any switching (needed for restore)
|
|
553
553
|
const savedModel = ctx.model;
|
|
554
|
+
const savedThinking = pi.getThinkingLevel();
|
|
554
555
|
|
|
555
556
|
// Resolve and switch to the first available model from the list
|
|
556
557
|
const result = await resolveAndSwitch(currentPrompt.models, ctx);
|
|
@@ -558,17 +559,15 @@ export default function promptModelExtension(pi: ExtensionAPI) {
|
|
|
558
559
|
|
|
559
560
|
if (!result.alreadyActive && currentPrompt.restore) {
|
|
560
561
|
previousModel = savedModel;
|
|
562
|
+
previousThinking = savedThinking;
|
|
561
563
|
}
|
|
562
564
|
|
|
563
565
|
// Set thinking level if specified
|
|
564
566
|
if (currentPrompt.thinking) {
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
if (currentPrompt.restore) {
|
|
568
|
-
previousThinking = currentThinking;
|
|
569
|
-
}
|
|
570
|
-
pi.setThinkingLevel(currentPrompt.thinking);
|
|
567
|
+
if (currentPrompt.restore && previousThinking === undefined && currentPrompt.thinking !== savedThinking) {
|
|
568
|
+
previousThinking = savedThinking;
|
|
571
569
|
}
|
|
570
|
+
pi.setThinkingLevel(currentPrompt.thinking);
|
|
572
571
|
}
|
|
573
572
|
|
|
574
573
|
// Set pending skill for before_agent_start handler
|