switchroom 0.14.55 → 0.14.57
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/cli/switchroom.js +2 -2
- package/package.json +1 -1
- package/telegram-plugin/bridge/bridge.ts +3 -1
- package/telegram-plugin/dist/bridge/bridge.js +3 -1
- package/telegram-plugin/dist/gateway/gateway.js +227 -47
- package/telegram-plugin/dist/server.js +3 -1
- package/telegram-plugin/gateway/answer-thread-resolve.ts +79 -0
- package/telegram-plugin/gateway/gateway.ts +532 -98
- package/telegram-plugin/gateway/serialize-drain-gate.ts +111 -0
- package/telegram-plugin/tests/answer-thread-resolve.test.ts +111 -0
- package/telegram-plugin/tests/buffer-gate-broadened.test.ts +16 -7
- package/telegram-plugin/tests/multitopic-routing-wiring.test.ts +131 -0
- package/telegram-plugin/tests/no-reply-bounded-drain.test.ts +156 -0
- package/telegram-plugin/tests/serialize-drain-gate.test.ts +112 -0
- package/telegram-plugin/tests/tool-activity-summary.test.ts +26 -0
|
@@ -222,4 +222,30 @@ describe("renderActivityFeedWithNested — foreground sub-agent nesting (Model A
|
|
|
222
222
|
"<i>✓ Reading a.ts</i>",
|
|
223
223
|
);
|
|
224
224
|
});
|
|
225
|
+
|
|
226
|
+
// Pins the invariant the gateway's foreground handoff-clear path relies on:
|
|
227
|
+
// on an ack-first turn the parent feed is empty (mirrorLines=[]) and the only
|
|
228
|
+
// content is the foreground sub-agent's nested narrative. The finalized
|
|
229
|
+
// render MUST be captured WHILE that narrative is present — once the gateway
|
|
230
|
+
// removes the finished sub-agent from the map, the render collapses to null
|
|
231
|
+
// and the finalize would be skipped, freezing the last live "→" line. This is
|
|
232
|
+
// exactly why clearActivitySummary takes a pre-delete finalHtmlOverride.
|
|
233
|
+
describe("foreground handoff-clear: capture-before-delete invariant", () => {
|
|
234
|
+
it("ack-first (empty parent) + child present → non-null all-done render (✓, no →)", () => {
|
|
235
|
+
const out = renderActivityFeedWithNested(
|
|
236
|
+
[],
|
|
237
|
+
["Sleep 2 for step 8", "Step 8 done; final echo", "All eight steps completed"],
|
|
238
|
+
true,
|
|
239
|
+
);
|
|
240
|
+
expect(out).not.toBeNull();
|
|
241
|
+
expect(out).not.toContain("→");
|
|
242
|
+
expect(out).toContain("All eight steps completed");
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
it("ack-first (empty parent) + child REMOVED → null (the emptied-feed skip the gateway must avoid)", () => {
|
|
246
|
+
// After foregroundSubAgents.delete(agentId), the parent has nothing left
|
|
247
|
+
// to render on an ack-first turn → null → finalize would no-op.
|
|
248
|
+
expect(renderActivityFeedWithNested([], [], true)).toBeNull();
|
|
249
|
+
});
|
|
250
|
+
});
|
|
225
251
|
});
|