pi-posthorse 0.10.19 → 0.10.20
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/package.json +1 -1
- package/src/guidance.ts +3 -1
package/package.json
CHANGED
package/src/guidance.ts
CHANGED
|
@@ -24,7 +24,9 @@ export function registerGuidance(pi: ExtensionAPI, policy: SnapshotReader): void
|
|
|
24
24
|
if (promptOptions?.forceSystemPrompt !== undefined) {
|
|
25
25
|
// ponytail: Pi applies forced prompts after this hook; keep request-local guidance
|
|
26
26
|
// until the host projects forced text before context_with_system.
|
|
27
|
-
|
|
27
|
+
// After a compaction a second system message (the tool update) can follow the first.
|
|
28
|
+
const conversation = event.messages.findIndex((message) => message.role !== "system");
|
|
29
|
+
event.messages.splice(conversation === -1 ? event.messages.length : conversation, 0, {
|
|
28
30
|
role: "custom",
|
|
29
31
|
customType: "posthorse-guidance",
|
|
30
32
|
content: guidance,
|