Telegram: threaded conversation support (#1597)
* Telegram: isolate dm topic sessions * Tests: cap vitest workers * Tests: cap Vitest workers on CI macOS * Tests: avoid timer-based pi-ai stream mock * Tests: increase embedded runner timeout * fix: harden telegram dm thread handling (#1597) (thanks @rohannagpal) --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
@@ -70,7 +70,7 @@ vi.mock("@mariozechner/pi-ai", async () => {
|
||||
},
|
||||
streamSimple: (model: { api: string; provider: string; id: string }) => {
|
||||
const stream = new actual.AssistantMessageEventStream();
|
||||
setTimeout(() => {
|
||||
queueMicrotask(() => {
|
||||
stream.push({
|
||||
type: "done",
|
||||
reason: "stop",
|
||||
@@ -80,7 +80,7 @@ vi.mock("@mariozechner/pi-ai", async () => {
|
||||
: buildAssistantMessage(model),
|
||||
});
|
||||
stream.end();
|
||||
}, 0);
|
||||
});
|
||||
return stream;
|
||||
},
|
||||
};
|
||||
@@ -213,7 +213,7 @@ describe("runEmbeddedPiAgent", () => {
|
||||
|
||||
itIfNotWin32(
|
||||
"persists the first user message before assistant output",
|
||||
{ timeout: 60_000 },
|
||||
{ timeout: 120_000 },
|
||||
async () => {
|
||||
const sessionFile = nextSessionFile();
|
||||
const cfg = makeOpenAiConfig(["mock-1"]);
|
||||
|
||||
Reference in New Issue
Block a user