@yagni-app/code-staging 0.3.5-staging.1167.1 → 1.0.0-staging.1174.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.
@@ -177,23 +177,23 @@ export function registerSilentTurnReminder(pi, deps = {}) {
177
177
  // Never break input handling.
178
178
  }
179
179
  });
180
- // The nudge itself rides an existing tool result. Never appended to a
181
- // user-facing tool's own result (a file_ticket/todo_write already IS
182
- // speaking), and fail-soft: a reminder must never break a tool call.
183
- pi.on("tool_result", async (event) => {
180
+ // The nudge rides the `context` event, which pi fires before each provider
181
+ // request (transformContext) on a throwaway copy of the message array. That
182
+ // makes it reach the model as the most recent message — and, unlike the old
183
+ // `tool_result` seam, it is never rendered to the user and never persisted
184
+ // to the session file. Appending (not replacing) preserves prior `context`
185
+ // handlers (e.g. gate.ts's mode-context filter), and fail-soft means a
186
+ // reminder must never break a turn.
187
+ pi.on("context", async (event) => {
184
188
  try {
185
- if (event.isError)
186
- return;
187
- if (event.toolName === "todo_write" || event.toolName === "file_ticket" || event.toolName === "update_ticket_status") {
188
- return;
189
- }
189
+ const messages = Array.isArray(event.messages) ? event.messages : [];
190
190
  if (!shouldRemind({
191
191
  msSinceSpoke: now() - lastSpokeAt,
192
192
  turnsSinceSpoke,
193
193
  msSinceLastNudge: lastNudgeAt === null ? null : now() - lastNudgeAt,
194
194
  intervalMs,
195
195
  })) {
196
- return;
196
+ return undefined;
197
197
  }
198
198
  nudgeCount += 1;
199
199
  lastNudgeAt = now();
@@ -203,14 +203,18 @@ export function registerSilentTurnReminder(pi, deps = {}) {
203
203
  secondsSinceSpoke: Math.round((now() - lastSpokeAt) / 1000),
204
204
  });
205
205
  return {
206
- content: [
207
- ...event.content,
208
- { type: "text", text: `\n\n${formatSilentReminder()}` },
206
+ messages: [
207
+ ...messages,
208
+ {
209
+ role: "user",
210
+ content: [{ type: "text", text: formatSilentReminder() }],
211
+ timestamp: now(),
212
+ },
209
213
  ],
210
214
  };
211
215
  }
212
216
  catch {
213
- return;
217
+ return undefined;
214
218
  }
215
219
  });
216
220
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yagni-app/code-staging",
3
- "version": "0.3.5-staging.1167.1",
3
+ "version": "1.0.0-staging.1174.1",
4
4
  "description": "YAGNI Code: a terminal coding agent that already knows your company. One YAGNI login routes the model and grounds the agent in your team's context.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "YAGNI, Inc. <jack@yagni.app> (https://yagni.app)",
@@ -40,5 +40,5 @@
40
40
  "turndown": "^7.2.4",
41
41
  "typebox": "^1.3.15"
42
42
  },
43
- "yagniSourceSha": "8f2143158f0169344f0adea9d1d292ca6e8b8f4c"
43
+ "yagniSourceSha": "6aea96149e19ec563f629898ed7be21311aa3d76"
44
44
  }