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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/guidance.ts +3 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-posthorse",
3
- "version": "0.10.19",
3
+ "version": "0.10.20",
4
4
  "type": "module",
5
5
  "description": "Posthorse: fresh context, same journey. No-summary context rollover for Pi, with sparse budget reminders, handoffs, notes, and history.",
6
6
  "keywords": [
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
- event.messages.splice(1, 0, {
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,