instar 1.3.162 → 1.3.164
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/dist/commands/server.d.ts.map +1 -1
- package/dist/commands/server.js +14 -11
- package/dist/commands/server.js.map +1 -1
- package/dist/core/SessionRouter.d.ts +10 -0
- package/dist/core/SessionRouter.d.ts.map +1 -1
- package/dist/core/SessionRouter.js +4 -0
- package/dist/core/SessionRouter.js.map +1 -1
- package/dist/core/uncaughtExceptionPolicy.d.ts +8 -0
- package/dist/core/uncaughtExceptionPolicy.d.ts.map +1 -0
- package/dist/core/uncaughtExceptionPolicy.js +44 -0
- package/dist/core/uncaughtExceptionPolicy.js.map +1 -0
- package/dist/messaging/slack/SocketModeClient.d.ts.map +1 -1
- package/dist/messaging/slack/SocketModeClient.js +15 -3
- package/dist/messaging/slack/SocketModeClient.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +2 -2
- package/upgrades/1.3.163.md +24 -0
- package/upgrades/1.3.164.md +47 -0
- package/upgrades/side-effects/router-confirm-claim-on-place.md +96 -0
- package/upgrades/side-effects/slack-reconnect-crash-guard.md +40 -0
|
@@ -92,6 +92,16 @@ export interface SessionRouterDeps {
|
|
|
92
92
|
handleLocally: (msg: InboundMessage) => Promise<void>;
|
|
93
93
|
/** Instruct the chosen machine to spawn/resume the session. */
|
|
94
94
|
spawnOnMachine: (machineId: string, msg: InboundMessage) => Promise<void>;
|
|
95
|
+
/**
|
|
96
|
+
* Confirm a just-placed REMOTE session as the owner (status placing→active) once
|
|
97
|
+
* the spawn has been dispatched to it. Without this the ownership stays 'placing'
|
|
98
|
+
* forever and every later message for the session queues (bug #11). Best-effort —
|
|
99
|
+
* a confirm failure leaves the placement to recover via the normal fences.
|
|
100
|
+
* (The owner-side resume runs on the target; in the single-router topology the
|
|
101
|
+
* router holds the authoritative ownReg, so it confirms on the target's behalf —
|
|
102
|
+
* the FSM only permits a claim whose machineId equals the placed owner.)
|
|
103
|
+
*/
|
|
104
|
+
confirmClaim?: (sessionKey: string, machineId: string) => void;
|
|
95
105
|
queueMessage: (msg: InboundMessage, reason: string) => void;
|
|
96
106
|
raiseAttention: (title: string, body: string) => void;
|
|
97
107
|
markOwnerSuspect?: (machineId: string) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionRouter.d.ts","sourceRoot":"","sources":["../../src/core/SessionRouter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,cAAc,GAAG,IAAI,CAAC;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,QAAQ,GAAG,WAAW,GAAG,iBAAiB,CAAC;CACtD;AAED,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,cAAc,CAAC;CAChC;AAED,MAAM,MAAM,WAAW,GACnB,iBAAiB,GACjB,WAAW,GACX,SAAS,GACT,QAAQ,GACR,WAAW,GACX,qBAAqB,GACrB,mBAAmB,CAAC;AAExB,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,WAAW,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;2FACuF;IACvF,KAAK,EAAE,OAAO,CAAC;CAChB;AA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AElD,IAAI,EAAE,iBAAiB,EAAE,GAAG,GAAE,mBAA2C;IAKrF,qFAAqF;IACrF,KAAK,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;IAQjD,OAAO,CAAC,OAAO;YAID,WAAW;YAyBX,cAAc;YAuCd,aAAa;CAkD5B"}
|
|
@@ -172,6 +172,10 @@ export class SessionRouter {
|
|
|
172
172
|
return { action: fromDead ? 'owner-dead-replaced' : 'handled-locally', owner: decision.chosenMachine, detail: 'placed-self', acked: true };
|
|
173
173
|
}
|
|
174
174
|
await this.deps.spawnOnMachine(decision.chosenMachine, msg);
|
|
175
|
+
// Confirm the remote owner (placing → active). The 'place' above left the record
|
|
176
|
+
// transient; without this the session is owned-but-never-active and every later
|
|
177
|
+
// message routes to the placing/transferring branch → queued forever (bug #11).
|
|
178
|
+
this.deps.confirmClaim?.(msg.sessionKey, decision.chosenMachine);
|
|
175
179
|
return { action, owner: decision.chosenMachine, acked: true };
|
|
176
180
|
}
|
|
177
181
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionRouter.js","sourceRoot":"","sources":["../../src/core/SessionRouter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AA0CH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAqB,EAAE,aAA4B;IACnF,IAAI,OAAO,CAAC,MAAM,KAAK,WAAW,IAAI,OAAO,CAAC,MAAM,KAAK,WAAW;QAAE,OAAO,IAAI,CAAC;IAClF,MAAM,WAAW,GAAG,OAAO,CAAC,KAAK,IAAI,IAAI,IAAI,OAAO,CAAC,KAAK,KAAK,aAAa,CAAC;IAC7E,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS,IAAI,WAAW;QAAE,OAAO,IAAI,CAAC;IAC7D,IAAI,OAAO,CAAC,MAAM,KAAK,qBAAqB,IAAI,WAAW;QAAE,OAAO,IAAI,CAAC;IACzE,OAAO,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AAC,QAAQ,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC;QAC5D,iFAAiF;QACjF,gFAAgF;QAChF,gFAAgF;QAChF,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC;QACjE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,aAAa,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IAChE,CAAC;CACF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* True when an uncaught exception is a known isolated/recoverable error that the
|
|
3
|
+
* server should log-and-continue on, rather than crash. Matches on the error
|
|
4
|
+
* message (substring). Returns false for anything unrecognized (→ crash, the
|
|
5
|
+
* safe default).
|
|
6
|
+
*/
|
|
7
|
+
export declare function isNonFatalUncaught(err: unknown): boolean;
|
|
8
|
+
//# sourceMappingURL=uncaughtExceptionPolicy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uncaughtExceptionPolicy.d.ts","sourceRoot":"","sources":["../../src/core/uncaughtExceptionPolicy.ts"],"names":[],"mappings":"AAgCA;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAIxD"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Policy for which process-level uncaught exceptions are RECOVERABLE (log +
|
|
3
|
+
* continue) vs FATAL (close databases + exit).
|
|
4
|
+
*
|
|
5
|
+
* The server's `process.on('uncaughtException')` handler crashes by default —
|
|
6
|
+
* the safe thing for a truly-unknown exception. But a small set of exceptions
|
|
7
|
+
* are ISOLATED and recoverable: the failing operation has already unwound, the
|
|
8
|
+
* rest of the agent (databases, HTTP, the other messaging platforms) is intact,
|
|
9
|
+
* and the owning subsystem self-heals. For those, crashing the whole agent —
|
|
10
|
+
* which closes its SQLite databases and drops in-flight work — is strictly worse
|
|
11
|
+
* than logging and continuing.
|
|
12
|
+
*
|
|
13
|
+
* Extracted from server.ts so the decision boundary is unit-testable on both
|
|
14
|
+
* sides. Adding a pattern here is a deliberate assertion that the matching error
|
|
15
|
+
* is isolated + recoverable; keep the list tight.
|
|
16
|
+
*/
|
|
17
|
+
const NON_FATAL_UNCAUGHT_PATTERNS = [
|
|
18
|
+
// HTTP double-response races (common during tunnel reconnect storms). The
|
|
19
|
+
// affected request is already handled; the server keeps serving new requests.
|
|
20
|
+
'Cannot set headers after they are sent',
|
|
21
|
+
'write after end',
|
|
22
|
+
'ERR_HTTP_HEADERS_SENT',
|
|
23
|
+
'ERR_STREAM_WRITE_AFTER_END',
|
|
24
|
+
// Slack Socket Mode reconnect race: a WebSocket send on a still-connecting
|
|
25
|
+
// socket throws ("Sent before connected"). The SocketModeClient reconnects
|
|
26
|
+
// with backoff on its own, and Slack redelivers any unacked event — so an
|
|
27
|
+
// isolated Slack WS hiccup must not crash the whole agent (esp. on a laptop
|
|
28
|
+
// that sleeps/wakes often, where reconnects are frequent). The root cause is
|
|
29
|
+
// also guarded at the ack send site; this is the defense-in-depth backstop.
|
|
30
|
+
'Sent before connected',
|
|
31
|
+
];
|
|
32
|
+
/**
|
|
33
|
+
* True when an uncaught exception is a known isolated/recoverable error that the
|
|
34
|
+
* server should log-and-continue on, rather than crash. Matches on the error
|
|
35
|
+
* message (substring). Returns false for anything unrecognized (→ crash, the
|
|
36
|
+
* safe default).
|
|
37
|
+
*/
|
|
38
|
+
export function isNonFatalUncaught(err) {
|
|
39
|
+
const msg = err instanceof Error ? err.message : typeof err === 'string' ? err : '';
|
|
40
|
+
if (!msg)
|
|
41
|
+
return false;
|
|
42
|
+
return NON_FATAL_UNCAUGHT_PATTERNS.some((p) => msg.includes(p));
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=uncaughtExceptionPolicy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uncaughtExceptionPolicy.js","sourceRoot":"","sources":["../../src/core/uncaughtExceptionPolicy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,2BAA2B,GAAG;IAClC,0EAA0E;IAC1E,8EAA8E;IAC9E,wCAAwC;IACxC,iBAAiB;IACjB,uBAAuB;IACvB,4BAA4B;IAC5B,2EAA2E;IAC3E,2EAA2E;IAC3E,0EAA0E;IAC1E,4EAA4E;IAC5E,6EAA6E;IAC7E,4EAA4E;IAC5E,uBAAuB;CACxB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,GAAY;IAC7C,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IACpF,IAAI,CAAC,GAAG;QAAE,OAAO,KAAK,CAAC;IACvB,OAAO,2BAA2B,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SocketModeClient.d.ts","sourceRoot":"","sources":["../../../src/messaging/slack/SocketModeClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,cAAc,EAAiB,MAAM,qBAAqB,CAAC;AAUpE,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3E,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnE,WAAW,EAAE,MAAM,IAAI,CAAC;IAC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E,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnE,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CACrD;AAaD,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,SAAS,CAAiB;IAClC,OAAO,CAAC,QAAQ,CAAqB;IACrC,OAAO,CAAC,EAAE,CAA0B;IACpC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,iBAAiB,CAAK;IAC9B,OAAO,CAAC,cAAc,CAA8C;IACpE,OAAO,CAAC,WAAW,CAAK;IACxB,OAAO,CAAC,aAAa,CAA2B;IAChD,OAAO,CAAC,cAAc,CAAuB;gBAEjC,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,kBAAkB;IAKnE,IAAI,WAAW,IAAI,OAAO,CAEzB;IAEK,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAKxB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IASjC,8EAA8E;IACxE,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAiBhC,gFAAgF;IAChF,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;YAWnB,eAAe;IA4B7B,OAAO,CAAC,iBAAiB;YAuCX,iBAAiB;IAmD/B,OAAO,CAAC,iBAAiB;YA2BX,iBAAiB;IAe/B,OAAO,CAAC,eAAe;IAiCvB,OAAO,CAAC,eAAe;IAiBvB,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,WAAW;CAOpB"}
|
|
@@ -154,9 +154,21 @@ export class SocketModeClient {
|
|
|
154
154
|
this._handleDisconnect(reason);
|
|
155
155
|
return;
|
|
156
156
|
}
|
|
157
|
-
// Acknowledge immediately (must be within 3 seconds)
|
|
158
|
-
|
|
159
|
-
|
|
157
|
+
// Acknowledge immediately (must be within 3 seconds). Guard the send:
|
|
158
|
+
// during a reconnect race the socket can be mid-transition (CONNECTING /
|
|
159
|
+
// CLOSING), and an unguarded ws.send() on a non-OPEN socket throws — which,
|
|
160
|
+
// uncaught in this async message handler, crashed the whole server (the
|
|
161
|
+
// observed "Sent before connected" FATAL after a sleep/wake reconnect).
|
|
162
|
+
// Mirror queueOutbound's readyState guard + the liveness-probe try/catch.
|
|
163
|
+
if (envelope.envelope_id && this.ws && this.ws.readyState === WebSocket.OPEN) {
|
|
164
|
+
try {
|
|
165
|
+
this.ws.send(JSON.stringify({ envelope_id: envelope.envelope_id }));
|
|
166
|
+
}
|
|
167
|
+
catch (err) {
|
|
168
|
+
// Socket changed state between the check and the send (rare race) —
|
|
169
|
+
// log and move on; Slack will redeliver the unacked event.
|
|
170
|
+
console.warn(`[slack-socket] Ack send failed (socket mid-transition): ${err.message}`);
|
|
171
|
+
}
|
|
160
172
|
}
|
|
161
173
|
// Process event with exception guard (post-ack — Slack won't redeliver)
|
|
162
174
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SocketModeClient.js","sourceRoot":"","sources":["../../../src/messaging/slack/SocketModeClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAkB,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpE,4DAA4D;AAC5D,IAAI,OAAO,UAAU,CAAC,SAAS,KAAK,WAAW,EAAE,CAAC;IAChD,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC;IAC9B,2EAA2E;IAC3E,UAAU,CAAC,SAAS,GAAG,EAAE,CAAC,OAAO,CAAC;AACpC,CAAC;AAeD,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAC/B,MAAM,qBAAqB,GAAG,MAAM,CAAC,CAAG,oCAAoC;AAC5E,MAAM,eAAe,GAAG,OAAO,CAAC,CAAQ,6CAA6C;AAC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|
|
5
|
-
"instarVersion": "1.3.
|
|
4
|
+
"generatedAt": "2026-05-31T11:18:35.637Z",
|
|
5
|
+
"instarVersion": "1.3.164",
|
|
6
6
|
"entryCount": 193,
|
|
7
7
|
"entries": {
|
|
8
8
|
"hook:session-start": {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Upgrade Guide — vNEXT
|
|
2
|
+
|
|
3
|
+
<!-- assembled-by: assemble-next-md -->
|
|
4
|
+
<!-- bump: patch -->
|
|
5
|
+
|
|
6
|
+
## What to Tell Your User
|
|
7
|
+
|
|
8
|
+
If you run a Slack-connected agent on a laptop, it won't get knocked offline by a sleep/wake reconnect glitch anymore. A brief Slack hiccup is now logged and recovered from instead of crashing the whole agent, and any Slack message involved is re-delivered, so nothing is lost.
|
|
9
|
+
|
|
10
|
+
## Summary of New Capabilities
|
|
11
|
+
|
|
12
|
+
- The Slack Socket Mode client guards its event acknowledgement on the socket being open (with a try/catch), so a mid-reconnect send can't throw. The process-level crash handler's recoverable-error allowlist was extracted into a small testable module and now also covers the Slack reconnect race, so an isolated Slack WebSocket hiccup never crashes the agent or closes its databases.
|
|
13
|
+
|
|
14
|
+
## Evidence
|
|
15
|
+
|
|
16
|
+
- Found in the agent's own server log: a FATAL uncaught "Sent before connected" crash right after a sleep/wake Slack reconnect, closing the databases.
|
|
17
|
+
- Root traced to an unguarded WebSocket acknowledgement send in the Slack client (it checked the socket existed but not that it was open, and wasn't in a try/catch), throwing in an async handler that escaped the reconnect's error handling.
|
|
18
|
+
- Unit tests: the recoverable-error policy treats the Slack race + the existing HTTP races as recoverable and unknown/serious errors (mutex, sqlite-closed) as fatal; source assertions confirm the ack is guarded and the handler routes through the policy. Slack reconnect + heartbeat suites stay green. Independent adversarial review confirmed the extraction is behavior-preserving and the new suppression is safe.
|
|
19
|
+
|
|
20
|
+
## What Changed — A Slack reconnect after sleep/wake can no longer crash the whole agent
|
|
21
|
+
|
|
22
|
+
Agents that use Slack keep a live connection open, and reconnect it whenever the machine sleeps and wakes. A timing race during that reconnect could throw an error from deep inside the Slack connection (trying to acknowledge a message a split-second before the line was fully open). Because that error happened in a background handler, it bubbled all the way up and crashed the entire agent — closing its databases and dropping in-flight work — just because one Slack acknowledgement couldn't be sent. For a laptop agent that sleeps and wakes constantly, that was a recurring-outage risk.
|
|
23
|
+
|
|
24
|
+
Now there are two safety nets: the agent checks the connection is actually open before sending the acknowledgement (and Slack re-delivers anything it didn't hear back on, so nothing is lost), and the kind of isolated, self-healing Slack reconnect hiccup that caused the crash is now treated as recoverable — logged and shrugged off — instead of taking the whole agent down. Genuinely serious errors still crash-and-restart as before.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Upgrade Guide — vNEXT
|
|
2
|
+
|
|
3
|
+
<!-- assembled-by: assemble-next-md -->
|
|
4
|
+
<!-- bump: patch -->
|
|
5
|
+
|
|
6
|
+
## What to Tell Your User
|
|
7
|
+
|
|
8
|
+
If you run your agent on more than one machine and move a conversation between them, the
|
|
9
|
+
move now actually sticks — the receiving machine is confirmed as the new owner and your
|
|
10
|
+
following messages route to it, instead of the move quietly failing. This only applies
|
|
11
|
+
when the multi-machine session pool is on; single-machine agents are unaffected. Nothing
|
|
12
|
+
to configure. (Two related pieces are still in progress: ownership surviving a restart,
|
|
13
|
+
and the moved conversation being able to reply — tracked separately.)
|
|
14
|
+
|
|
15
|
+
## Summary of New Capabilities
|
|
16
|
+
|
|
17
|
+
- `SessionRouter` gains an optional `confirmClaim(sessionKey, machineId)` dep, invoked
|
|
18
|
+
after a successful remote `spawnOnMachine`, advancing the ownership record
|
|
19
|
+
`placing → active`. Self-placement (router keeps it) does not confirm.
|
|
20
|
+
- Wired in the server to the ownership-registry `claim` CAS.
|
|
21
|
+
|
|
22
|
+
## Evidence
|
|
23
|
+
|
|
24
|
+
- Found live on 2026-05-31: after a move, every later message logged
|
|
25
|
+
"route … action=queued owner=?" and was handled back on the origin — the ownership
|
|
26
|
+
state machine requires place→claim→active and the claim was never issued, so the
|
|
27
|
+
record stayed "placing".
|
|
28
|
+
- Unit, `tests/unit/SessionRouter.test.ts`: a remote placement now confirms the owner
|
|
29
|
+
(placing→active); a self-placement does not.
|
|
30
|
+
- Unit, `tests/unit/SessionOwnership.test.ts`: the place→claim→active transition.
|
|
31
|
+
- 47 SessionRouter + ownership + wiring tests pass; tsc --noEmit clean.
|
|
32
|
+
- Spec, `docs/specs/router-confirm-claim-on-place.md` plus the .eli16.md sibling.
|
|
33
|
+
- Side-effects, `upgrades/side-effects/router-confirm-claim-on-place.md`.
|
|
34
|
+
|
|
35
|
+
## What Changed — a moved conversation now finishes its handoff instead of getting stuck
|
|
36
|
+
|
|
37
|
+
Another step toward the multi-machine "move this conversation to my other machine"
|
|
38
|
+
feature. The handoff tracks ownership in two steps: the router assigns the conversation
|
|
39
|
+
to the target machine (status "placing"), then the new owner is confirmed (status
|
|
40
|
+
"active"). The confirm step was never being issued, so a moved conversation stayed in
|
|
41
|
+
"placing" limbo forever — and the router's rule of "hold messages while a handoff is in
|
|
42
|
+
progress" then held every later message, so the move silently failed.
|
|
43
|
+
|
|
44
|
+
This release has the router issue the confirm right after it hands the conversation to
|
|
45
|
+
the target machine, advancing ownership to "active". From then on the router correctly
|
|
46
|
+
forwards your messages to the new owner. The state machine only allows confirming the
|
|
47
|
+
exact machine the conversation was just assigned to, so this stays safe.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Side-Effects Review — Router confirms remote placement (bug #11)
|
|
2
|
+
|
|
3
|
+
**Version / slug:** `router-confirm-claim-on-place`
|
|
4
|
+
**Date:** `2026-05-31`
|
|
5
|
+
**Author:** `echo`
|
|
6
|
+
**Second-pass reviewer:** `not required`
|
|
7
|
+
|
|
8
|
+
## Summary of the change
|
|
9
|
+
|
|
10
|
+
`SessionRouter` gains an optional `confirmClaim(sessionKey, machineId)` dep, called in
|
|
11
|
+
`placeAndClaim` right after a successful `spawnOnMachine` on a REMOTE target. `server.ts`
|
|
12
|
+
wires it to `ownReg.cas({ type: 'claim', machineId }, …)`, advancing the ownership
|
|
13
|
+
record `placing → active`. Without it the record stayed `placing` and every later
|
|
14
|
+
message for the session queued (bug #11).
|
|
15
|
+
|
|
16
|
+
## Decision-point inventory
|
|
17
|
+
|
|
18
|
+
- **remote branch only** — `confirmClaim` is called only in `placeAndClaim`'s
|
|
19
|
+
remote-spawn path (after `spawnOnMachine`). Self-placement returns handled-locally
|
|
20
|
+
and never confirms. Both covered by tests.
|
|
21
|
+
- **FSM gate** — `claim` is permitted only when the record's `ownerMachineId` equals the
|
|
22
|
+
claimed `machineId` (the placed owner). Covered in `SessionOwnership.test.ts`.
|
|
23
|
+
|
|
24
|
+
## 1. Over-block
|
|
25
|
+
|
|
26
|
+
**What legitimate inputs does this reject?** Nothing. It only ADDS a confirm after a
|
|
27
|
+
remote placement. Self-placement, forwarding to an existing owner, owner-dead
|
|
28
|
+
re-placement, and queue paths are unchanged. A `confirmClaim` that fails (e.g. CAS
|
|
29
|
+
contention) is best-effort and leaves the placement to recover via the normal fences.
|
|
30
|
+
|
|
31
|
+
## 2. Under-block
|
|
32
|
+
|
|
33
|
+
**What does this still miss?** It does not make ownership durable across restarts (the
|
|
34
|
+
store is per-machine in-memory — the shared Track-H store is separate). It confirms
|
|
35
|
+
optimistically once the spawn is DISPATCHED (the deliverMessage/spawn RPC resolved); if
|
|
36
|
+
the target's session later dies, the existing owner-dead detection re-places it. It does
|
|
37
|
+
not address bug #7 (standby outbound mute).
|
|
38
|
+
|
|
39
|
+
## 3. Level-of-abstraction fit
|
|
40
|
+
|
|
41
|
+
**Right layer?** Yes. The confirm lives in `SessionRouter.placeAndClaim` — the exact
|
|
42
|
+
place that owns the place→spawn lifecycle and already does the `place` CAS. The dep is
|
|
43
|
+
injected (testable, same pattern as `casClaimOwnership`/`spawnOnMachine`). The FSM
|
|
44
|
+
transition itself stays in `SessionOwnership.ts`.
|
|
45
|
+
|
|
46
|
+
## 4. Signal vs authority compliance
|
|
47
|
+
|
|
48
|
+
**Required reference:** [docs/signal-vs-authority.md](../../docs/signal-vs-authority.md)
|
|
49
|
+
|
|
50
|
+
This advances an ownership record through its designed FSM (`place → claim`), gated by
|
|
51
|
+
the FSM's own legal-transition check (claim machineId must equal the placed owner). It
|
|
52
|
+
adds no user-facing authority and blocks nothing. It RELAXES nothing about who may own a
|
|
53
|
+
session — it completes a transition that was already supposed to happen.
|
|
54
|
+
|
|
55
|
+
## 5. Interactions
|
|
56
|
+
|
|
57
|
+
Consumes the existing `ownReg` CAS (the same registry `place`/`transfer`/`release` use).
|
|
58
|
+
Pairs with `placeAndClaim`'s `place` CAS (the two halves of a new-session handoff). After
|
|
59
|
+
the confirm, `dispatchOne` sees `active` (not `placing`) and forwards subsequent messages
|
|
60
|
+
to the owner instead of queueing. Idempotent at the FSM level (a duplicate claim on an
|
|
61
|
+
already-active record is rejected `claim-out-of-sequence`, harmless). No interaction with
|
|
62
|
+
the lease or the shared-state read-only guard.
|
|
63
|
+
|
|
64
|
+
## 6. External surfaces
|
|
65
|
+
|
|
66
|
+
None. No HTTP routes, config, or notifications. The visible effect is a moved session's
|
|
67
|
+
ownership reaching `active` (so `/pool` + routing reflect the new owner).
|
|
68
|
+
|
|
69
|
+
## 7. Rollback cost
|
|
70
|
+
|
|
71
|
+
Low. Remove the `confirmClaim` dep + call + wiring; transfers revert to stuck-`placing`
|
|
72
|
+
(bug #11). No schema, no persisted state, no migration (the dep is optional + in-memory).
|
|
73
|
+
|
|
74
|
+
## Conclusion
|
|
75
|
+
|
|
76
|
+
Minimal, FSM-gated completion of a handoff transition that was missing, scoped to the
|
|
77
|
+
remote-placement branch, both branches + the FSM transition unit-tested, no new
|
|
78
|
+
authority, no external surface, cheap revert. Makes the live single-router transfer's
|
|
79
|
+
ownership finalize instead of sticking. Durable cross-machine ownership (Track-H) and
|
|
80
|
+
the reply relay (#7) remain separate.
|
|
81
|
+
|
|
82
|
+
## Second-pass review (if required)
|
|
83
|
+
|
|
84
|
+
Not required — completes an existing FSM transition via its own legality gate, remote-
|
|
85
|
+
branch-only, both sides tested, no shared-state authority changed, reversible. The live
|
|
86
|
+
two-machine re-test (fresh topic) is the Tier-3 gate that follows.
|
|
87
|
+
|
|
88
|
+
## Evidence pointers
|
|
89
|
+
|
|
90
|
+
- `tests/unit/SessionRouter.test.ts` — remote placement calls `confirmClaim('s1','m_remote')`;
|
|
91
|
+
self-placement does not.
|
|
92
|
+
- `tests/unit/SessionOwnership.test.ts` — `place(placing) → claim(active)` transition.
|
|
93
|
+
- 47 SessionRouter + ownership + wiring tests green; `tsc --noEmit` clean.
|
|
94
|
+
- Found live: `route … action=queued owner=?` on every post-move message; the ownership
|
|
95
|
+
FSM requires place→claim→active and the claim was never issued.
|
|
96
|
+
- Spec: `docs/specs/router-confirm-claim-on-place.md` (+ `.eli16.md`).
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Side-effects — Slack reconnect crash guard
|
|
2
|
+
|
|
3
|
+
## 1. What files/state does this touch at runtime?
|
|
4
|
+
`SocketModeClient.ts` (the event-ack send), `server.ts` (the process uncaughtException handler), and a
|
|
5
|
+
new `src/core/uncaughtExceptionPolicy.ts`. No new state, config, or schema.
|
|
6
|
+
|
|
7
|
+
## 2. Does it change any functional behavior?
|
|
8
|
+
- The Slack event ack is now skipped when the socket isn't OPEN (instead of throwing). Slack
|
|
9
|
+
redelivers the unacked event, so no event is lost; event processing is unchanged.
|
|
10
|
+
- The process uncaughtException handler now suppresses (logs + continues) one additional error class —
|
|
11
|
+
the Slack WS reconnect race ("Sent before connected") — instead of crashing. All other errors,
|
|
12
|
+
including the existing HTTP-race allowlist, are handled exactly as before.
|
|
13
|
+
|
|
14
|
+
## 3. What happens on failure / weird config?
|
|
15
|
+
The ack guard is a pure readyState check + try/catch — it can't fail destructively (worst case: an
|
|
16
|
+
ack is skipped and Slack redelivers). `isNonFatalUncaught` returns false for anything unrecognized, so
|
|
17
|
+
an unknown error still triggers the FATAL crash-and-restart (the safe default).
|
|
18
|
+
|
|
19
|
+
## 4. Migration parity — do existing agents get it?
|
|
20
|
+
Yes, via the normal release — code-only, compiled into `dist`. No agent-installed file / config /
|
|
21
|
+
template change → no `PostUpdateMigrator` pass.
|
|
22
|
+
|
|
23
|
+
## 5. Could it spam / flood / burn resources?
|
|
24
|
+
No. It removes a crash (and its restart cost). The only new log is a `[WARN]` when an ack is skipped
|
|
25
|
+
mid-reconnect (rare) or a recoverable uncaught is suppressed (rare). No new timers/IO/network.
|
|
26
|
+
|
|
27
|
+
## 6. Rollback / off-switch?
|
|
28
|
+
Revert the 3 files (re-inline the allowlist in server.ts, drop the new module, restore the unguarded
|
|
29
|
+
ack). No data, no migration, no flag.
|
|
30
|
+
|
|
31
|
+
## 7. Concurrency / ordering?
|
|
32
|
+
The ack guard adds a readyState check + try/catch around an existing synchronous send; the try/catch
|
|
33
|
+
also covers the (rare) TOCTOU where the socket changes state between the check and the send. No new
|
|
34
|
+
concurrency.
|
|
35
|
+
|
|
36
|
+
## Blast radius
|
|
37
|
+
Small + defensive. One guarded send in `SocketModeClient`, one extracted+extended allowlist used by
|
|
38
|
+
the process crash handler. The extraction is behavior-preserving for the existing patterns
|
|
39
|
+
(adversarially verified); the only behavioral change is that an isolated Slack WS reconnect race no
|
|
40
|
+
longer crashes the whole agent.
|