@rubytech/create-maxy 1.0.730 → 1.0.731
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/payload/server/server.js +18 -0
package/package.json
CHANGED
package/payload/server/server.js
CHANGED
|
@@ -8260,6 +8260,24 @@ app11.post("/", requireAdminSession, async (c) => {
|
|
|
8260
8260
|
const sk = sseConvId?.slice(0, 8) ?? session_key.slice(0, 8);
|
|
8261
8261
|
let tailer = null;
|
|
8262
8262
|
const readable = new ReadableStream({
|
|
8263
|
+
// Task 606 — fires when the consumer (Hono's response writer / Node
|
|
8264
|
+
// adapter) cancels the stream because the client disconnected. This is
|
|
8265
|
+
// the only signal that arrives WHILE start()'s for-await is blocked
|
|
8266
|
+
// awaiting the SDK's next message — c.req.raw.signal didn't propagate
|
|
8267
|
+
// under @hono/node-server, and controller.enqueue throwing only
|
|
8268
|
+
// surfaces on the next yielded event (which never comes if the model
|
|
8269
|
+
// is mid-response when Cancel is pressed). cancel() is the load-bearing
|
|
8270
|
+
// hook for operator abort.
|
|
8271
|
+
cancel(reason) {
|
|
8272
|
+
const ts = (/* @__PURE__ */ new Date()).toISOString().slice(11, 23);
|
|
8273
|
+
const reasonStr = typeof reason === "string" ? reason : reason instanceof Error ? reason.message : "consumer-cancelled";
|
|
8274
|
+
sseLog.write(`[${ts}] [${sk}] admin: CANCEL [stream-cancel] reason=${reasonStr}
|
|
8275
|
+
`);
|
|
8276
|
+
interruptClient(session_key).catch((err) => {
|
|
8277
|
+
sseLog.write(`[${ts}] [${sk}] admin: ABORT [interrupt-failed] ${err instanceof Error ? err.message : String(err)}
|
|
8278
|
+
`);
|
|
8279
|
+
});
|
|
8280
|
+
},
|
|
8263
8281
|
async start(controller) {
|
|
8264
8282
|
let controllerOpen = true;
|
|
8265
8283
|
const sseEntry = { controller, conversationId: sseConvId ?? null, sessionKey: session_key };
|