@cohortapp/agent-sdk 2.18.22 → 2.18.23
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.
|
@@ -228,7 +228,7 @@ export function buildNoticeSystemPrompt(o = {}) {
|
|
|
228
228
|
kind === "failure:retrying"
|
|
229
229
|
? "You are running it again right now. Say so."
|
|
230
230
|
: kind === "interrupted"
|
|
231
|
-
? "
|
|
231
|
+
? "The session running the work stopped and a new one took over; you have picked it back up. Say so. Do NOT say your machine restarted — the only thing observed is that the process was replaced."
|
|
232
232
|
: "You have stopped retrying and flagged it. Offer them the choice: narrow it, hand it to someone else, or leave it.";
|
|
233
233
|
return [
|
|
234
234
|
`You are ${who}, writing in a workplace chat. A piece of work someone is waiting on has gone wrong, and you are telling them — now, before they ask.`,
|
|
@@ -329,7 +329,21 @@ export function fallbackNotice(o = {}) {
|
|
|
329
329
|
const topic = quotableTopic(o.topic);
|
|
330
330
|
const about = topic ? `The work on "${topic}"` : `The work you asked for`;
|
|
331
331
|
if (o.kind === "interrupted") {
|
|
332
|
-
|
|
332
|
+
// SAYS WHAT WAS OBSERVED, NOT WHAT IT GUESSES. The trigger is narrow:
|
|
333
|
+
// assurance.mjs sweepObligations fires this when the obligation's recorded
|
|
334
|
+
// daemonPid differs from the running process AND that pid is gone — i.e.
|
|
335
|
+
// THE DAEMON PROCESS WAS REPLACED. That is not a machine restart. A daemon
|
|
336
|
+
// is replaced by a crash, a launchd respawn, an upgrade, or a deliberate
|
|
337
|
+
// kickstart — including the one lib/session/revive.mjs performs when a
|
|
338
|
+
// front door goes quiet, so this fix's own sibling would have made the
|
|
339
|
+
// seat announce a reboot that never happened.
|
|
340
|
+
//
|
|
341
|
+
// Naming a cause the layer did not observe is the defect that cost this
|
|
342
|
+
// fleet days: the seat's attention record used to guess "probably waiting
|
|
343
|
+
// on a first-run dialog" when the screen held a subscription-limit prompt,
|
|
344
|
+
// and everyone searched where the guess pointed. A person acts on what a
|
|
345
|
+
// colleague tells them, so a notice may only assert what it saw.
|
|
346
|
+
return `${about} was cut off part-way — the session running it stopped and a new one took over. I've picked it back up from where it stopped.`;
|
|
333
347
|
}
|
|
334
348
|
if (o.willRetry || o.kind === "failure:retrying") {
|
|
335
349
|
return `${about} broke before it finished: ${cause}. I'm running it again now.`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cohortapp/agent-sdk",
|
|
3
|
-
"version": "2.18.
|
|
3
|
+
"version": "2.18.23",
|
|
4
4
|
"description": "Cohort Agent SDK — autonomous AI colleague runtime. Deploy senior AI colleagues on dedicated Mac minis, wired to the Cohort operating surface.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -1324,7 +1324,13 @@ function isAmbientSurface(rec) {
|
|
|
1324
1324
|
|
|
1325
1325
|
/** A session interrupted by the daemon itself dying/restarting. */
|
|
1326
1326
|
export function composeInterrupted() {
|
|
1327
|
-
|
|
1327
|
+
// "(my end restarted)" claimed a machine reboot. What the trigger actually
|
|
1328
|
+
// observes (sweepObligations, below) is that the obligation's recorded
|
|
1329
|
+
// daemonPid is gone and a different process is running — the DAEMON was
|
|
1330
|
+
// replaced, which a crash, a launchd respawn, an upgrade or a deliberate
|
|
1331
|
+
// kickstart all do without the machine going anywhere. See the note in
|
|
1332
|
+
// lib/assurance/notice-voice.mjs#fallbackNotice.
|
|
1333
|
+
return `Heads up — my session on this was interrupted before it finished (the session running it was replaced). I've picked it back up; I'll come back with the answer.`;
|
|
1328
1334
|
}
|
|
1329
1335
|
|
|
1330
1336
|
// ---------------------------------------------------------------------------
|
|
@@ -2312,7 +2318,7 @@ async function _sweepObligations(a = {}) {
|
|
|
2312
2318
|
const interruptedNotice = await generateFailureNotice(
|
|
2313
2319
|
rec,
|
|
2314
2320
|
{
|
|
2315
|
-
failure: { human: "
|
|
2321
|
+
failure: { human: "the session running it was replaced part-way through" },
|
|
2316
2322
|
willRetry: false,
|
|
2317
2323
|
kind: NOTICE.INTERRUPTED,
|
|
2318
2324
|
mayWrite: claimWrittenVoice(rec, NOTICE.INTERRUPTED, now, a.deps && a.deps.roomNoticeImpl),
|