Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

Sign-in resume: review fixes from CI and CodeRabbit

laijsg1bf93d1422c69
diff --git a/server/harness/registry.test.ts b/server/harness/registry.test.ts
index ffdce4b868..35ea075364 100644
--- a/server/harness/registry.test.ts
+++ b/server/harness/registry.test.ts
@@ -231,6 +231,31 @@ describe("ProviderRegistry", () => {
expect(heard, "signed in all along: nothing new to tell").toEqual(["a"]);
});
+ it("tells nothing more for a sign-in the app saw, and nothing for a provider put in place of a signed-out one", async () => {
+ let authenticated: boolean | undefined = false;
+ const fake = makeFakeDriver({ get answer() { return { state: "available" as const, version: "1.0.0", ...(authenticated === undefined ? {} : { authenticated }) }; } });
+ const registry = new ProviderRegistry([fake.driver]);
+ await registry.load({ a: { driver: "fake" } });
+ const heard: string[] = [];
+ registry.onSignedIn((instanceId) => heard.push(instanceId));
+ const read = async () => {
+ registry.forgetSnapshots();
+ await registry.describe();
+ };
+ await read();
+ authenticated = true;
+ registry.sawSignedIn("a");
+ await read();
+ expect(heard, "the app told this sign-in itself").toEqual([]);
+ authenticated = false;
+ await read();
+ await registry.dispose("a");
+ await registry.load({ a: { driver: "fake" } });
+ authenticated = true;
+ await read();
+ expect(heard, "the new provider was never read signed out").toEqual([]);
+ });
+
it("tells its listeners of a sign-in when a read between said nothing about the sign-in", async () => {
let authenticated: boolean | undefined = false;
const fake = makeFakeDriver({ get answer() { return { state: "available" as const, version: "1.0.0", ...(authenticated === undefined ? {} : { authenticated }) }; } });
diff --git a/server/harness/registry.ts b/server/harness/registry.ts
index 455ad601c1..da8421352d 100644
--- a/server/harness/registry.ts
+++ b/server/harness/registry.ts
@@ -147,8 +147,10 @@ export class ProviderRegistry {
private snapshotGeneration = 0;
private manifestWatched = false;
private readonly signedInListeners = new Set<(instanceId: InstanceId) => void>();
- /** The last read that said plainly whether each engine is signed in: a read that does not say keeps it. */
- private readonly lastAuth = new Map<InstanceId, boolean>();
+ /** The newest read that said plainly whether each engine is signed in, by the order reads began: a read that does not
+ * say, or began before the one kept, keeps it. */
+ private readonly lastAuth = new Map<InstanceId, { authenticated: boolean; read: number }>();
+ private readsBegun = 0;
/** Per instance object: settings that reload an engine make a new one, so its status is read afresh. */
private readsOf = new WeakMap<ProviderInstance, { snapshot: ProviderSnapshot; at: number; generation: number }>();
private driversByKind: Map<string, AnyProviderDriver>;
@@ -592,7 +594,7 @@ export class ProviderRegistry {
private async read(instance: ProviderInstance): Promise<ProviderSnapshot> {
let snapshot: ProviderSnapshot;
let answered = true, inconclusive = false;
- const generation = this.snapshotGeneration;
+ const generation = this.snapshotGeneration, begun = ++this.readsBegun;
try {
snapshot = await instance.snapshot();
inconclusive = snapshot.state === "unavailable" && snapshot.busy === true;
@@ -637,9 +639,10 @@ export class ProviderRegistry {
this.unread?.delete(instance.instanceId);
this.saveStatus();
if (!inconclusive) this.healWrongCli(instance.instanceId, snapshot);
- const knew = this.lastAuth.get(instance.instanceId) ?? before?.authenticated;
- if (!inconclusive && snapshot.state === "available" && typeof snapshot.authenticated === "boolean") this.lastAuth.set(instance.instanceId, snapshot.authenticated);
- if (knew === false && snapshot.state === "available" && snapshot.authenticated === true) {
+ const kept = this.lastAuth.get(instance.instanceId), knew = kept ? kept.authenticated : before?.authenticated;
+ const newest = !kept || kept.read < begun;
+ if (newest && !inconclusive && snapshot.state === "available" && typeof snapshot.authenticated === "boolean") this.lastAuth.set(instance.instanceId, { authenticated: snapshot.authenticated, read: begun });
+ if (newest && knew === false && snapshot.state === "available" && snapshot.authenticated === true) {
for (const listener of this.signedInListeners) listener(instance.instanceId);
}
}
@@ -652,6 +655,11 @@ export class ProviderRegistry {
this.signedInListeners.add(listener);
}
+ /** A sign-in the app made and has already told: the next read that finds it signed in tells nothing new. */
+ sawSignedIn(instanceId: InstanceId): void {
+ this.lastAuth.set(instanceId, { authenticated: true, read: ++this.readsBegun });
+ }
+
private saveStatus(): void {
this.status?.save(this.instances().flatMap(({ instanceId, driverKind }) => {
const snapshot = this.lastSnapshots.get(instanceId) ?? this.seeds.get(instanceId);
@@ -735,6 +743,7 @@ export class ProviderRegistry {
this.byId.clear();
this.cliByInstance.clear();
this.lastSnapshots.clear();
+ this.lastAuth.clear();
this.seeds.clear();
}
@@ -746,6 +755,7 @@ export class ProviderRegistry {
this.byId.delete(instanceId);
this.cliByInstance.delete(instanceId);
this.lastSnapshots.delete(instanceId);
+ this.lastAuth.delete(instanceId);
this.seeds.delete(instanceId);
await entry?.live?.dispose();
}
diff --git a/server/host/sign-in-resume.test.ts b/server/host/sign-in-resume.test.ts
index 45459a5bba..1b5d8dcdab 100644
--- a/server/host/sign-in-resume.test.ts
+++ b/server/host/sign-in-resume.test.ts
@@ -1,11 +1,11 @@
-import { mkdtempSync, rmSync } from "node:fs";
+import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { afterEach, describe, expect, it, vi } from "vitest";
import type { ModelSelection } from "../../shared/wire.ts";
import type { Message } from "../store.ts";
-import { createSignInResume, RECHECK_MS, RECHECKS_UNANSWERED, RESUME_WINDOW_MS, SAME_SIGN_IN_MS, type SignInResumeDeps, type SignInWait } from "./sign-in-resume.ts";
+import { createSignInResume, RECHECK_MS, RECHECKS_UNANSWERED, RESUME_WINDOW_MS, type SignInResumeDeps, type SignInWait } from "./sign-in-resume.ts";
const claude: ModelSelection = { instanceId: "claude", model: "sonnet" };
const scratch: string[] = [];
@@ -20,6 +20,7 @@ function world(options: { file?: string } = {}) {
let full = false;
let signedIn = true;
let probe: Promise<boolean> | null = null;
+ let readStarted: (() => void) | undefined;
const timers: Array<() => void> = [];
const sent: Array<{ wait: SignInWait; message: Message }> = [];
let nextId = 0;
@@ -43,7 +44,10 @@ function world(options: { file?: string } = {}) {
return path[at]!;
},
} as unknown as SignInResumeDeps["store"],
- signedInNow: async () => (probe ? await probe : signedIn) ? () => true : null,
+ signedInNow: async () => {
+ readStarted?.();
+ return (probe ? await probe : signedIn) ? () => true : null;
+ },
engineName: () => "Claude",
busy: (_botId, threadId) => busy.has(threadId),
atCapacity: () => full,
@@ -70,6 +74,7 @@ function world(options: { file?: string } = {}) {
tick: (ms: number) => { clock += ms; },
set full(value: boolean) { full = value; },
set signedIn(value: boolean) { signedIn = value; },
+ reading: () => new Promise<void>((resolve) => { readStarted = resolve; }),
hold: () => { let release!: (value: boolean) => void; probe = new Promise((resolve) => { release = resolve; }); return (value: boolean) => { probe = null; release(value); }; },
noticeTool: (threadId: string, id: string) => paths.get(threadId)!.find((message) => message.id === id)!.tool,
};
@@ -148,7 +153,7 @@ describe("createSignInResume", () => {
w.row("t-kai", { tool: { name: "error: Not logged in · Please run /login", ok: false, setup: true } });
const resent = w.paths.get("t-kai")!.findLast((message) => message.role === "user")!;
await resume.waiting({ ...kai.wait, messageId: resent.id, failedAt: 1_015 });
- w.tick(SAME_SIGN_IN_MS);
+ w.tick(10);
await resume.signedIn("claude");
expect(w.sent.map(({ message }) => message.id), "a sign-in after the second refusal takes it up").toEqual([kai.asked.id, resent.id]);
});
@@ -252,22 +257,26 @@ describe("createSignInResume", () => {
expect(w.sent).toHaveLength(1);
});
- it("answers a sign-in only with what was left before it: a sign-out met after it waits for the next one", async () => {
+ it("answers a sign-in only with what was left before it: a sign-out met during its status read waits for the next one", async () => {
const w = world();
const resume = createSignInResume(w.deps);
+ const rosa = w.stuck("t-rosa", "Draft the budget");
+ resume.waiting({ ...rosa.wait, botId: "rosa" });
+ const reading = w.reading();
const release = w.hold();
w.tick(10);
const pass = resume.signedIn("claude");
+ await reading;
w.tick(10);
const later = w.stuck("t-kai");
resume.waiting(later.wait); resume.noticed(later.noticed);
release(true);
await pass;
- expect(w.sent).toEqual([]);
+ expect(w.sent.map(({ message }) => message.text)).toEqual(["Draft the budget"]);
expect(w.noticeTool("t-kai", later.notice.id)?.setup, "the new notice still offers Sign in").toBe(true);
- w.tick(SAME_SIGN_IN_MS);
+ w.tick(10);
await resume.signedIn("claude");
- expect(w.sent).toHaveLength(1);
+ expect(w.sent.map(({ message }) => message.text)).toEqual(["Draft the budget", "Draft the plan"]);
});
it("stops sending when the AI's instance is replaced partway through a pass, and reads the new one", async () => {
@@ -285,25 +294,6 @@ describe("createSignInResume", () => {
await vi.waitFor(() => expect(w.sent.map(({ message }) => message.text)).toEqual(["Draft the plan", "Draft the budget"]));
});
- it("takes a second sign-in event soon after the first for the same sign-in", async () => {
- const w = world();
- const resume = createSignInResume(w.deps);
- const kai = w.stuck("t-kai");
- resume.waiting(kai.wait);
- w.tick(10);
- await resume.signedIn("claude");
- w.tick(5);
- const resent = w.paths.get("t-kai")!.findLast((message) => message.role === "user")!;
- w.row("t-kai", { tool: { name: "error: Not logged in · Please run /login", ok: false, setup: true } });
- await resume.waiting({ ...kai.wait, messageId: resent.id, failedAt: 1_015 });
- w.tick(1_000);
- await resume.signedIn("claude");
- expect(w.sent, "the status read that sees the same sign-in sends nothing again").toHaveLength(1);
- w.tick(SAME_SIGN_IN_MS);
- await resume.signedIn("claude");
- expect(w.sent).toHaveLength(2);
- });
-
it("leaves a refusal told in the same millisecond as a sign-in for the next sign-in", async () => {
const w = world();
const resume = createSignInResume(w.deps);
@@ -409,6 +399,22 @@ describe("createSignInResume", () => {
expect(w.sent).toEqual([]);
});
+ it("starts with what it can read of a damaged saved file", async () => {
+ const directory = mkdtempSync(join(tmpdir(), "omb-sign-in-resume-"));
+ scratch.push(directory);
+ const file = join(directory, "sign-in-resume.json");
+ const w = world({ file });
+ const kai = w.stuck("t-kai");
+ writeFileSync(file, JSON.stringify({ waiting: [null, { botId: "kai" }, kai.wait], notices: [7, kai.noticed] }));
+ w.tick(10);
+ const resume = createSignInResume(w.deps);
+ await resume.resumeSaved();
+ expect(w.sent.map(({ message }) => message.id)).toEqual([kai.asked.id]);
+ expect(w.noticeTool("t-kai", kai.notice.id)?.nameCode).toBe("chat.notice.signedInAgain");
+ writeFileSync(file, "[1, 2]");
+ expect(() => createSignInResume(w.deps)).not.toThrow();
+ });
+
it("after a restart, asks the AI once and sends what was left waiting", async () => {
const directory = mkdtempSync(join(tmpdir(), "omb-sign-in-resume-"));
scratch.push(directory);
diff --git a/server/host/sign-in-resume.ts b/server/host/sign-in-resume.ts
index eac6cc4da9..0922281f38 100644
--- a/server/host/sign-in-resume.ts
+++ b/server/host/sign-in-resume.ts
@@ -19,8 +19,6 @@ export const RESUME_WINDOW_MS = 24 * 60 * 60_000;
const NOTICE_TTL_MS = 30 * 24 * 60 * 60_000;
export const RECHECK_MS = 15_000;
const RECHECK_MAX_MS = 5 * 60_000;
-/** Sign-in events this close together are one sign-in: the app's own, then the status read that sees it. */
-export const SAME_SIGN_IN_MS = 60_000;
/** Status reads that did not say signed in, in a row, before an AI's waiting messages wait for its next sign-in. */
export const RECHECKS_UNANSWERED = 5;
@@ -37,6 +35,17 @@ export interface SignedOutNotice { instanceId: string; threadId: string; message
interface Saved { waiting?: SignInWait[]; notices?: SignedOutNotice[] }
+const text = (value: unknown): value is string => typeof value === "string" && value.length > 0;
+const savedWait = (row: unknown): row is SignInWait => {
+ const wait = row as Partial<SignInWait> | null;
+ return Boolean(wait) && text(wait!.botId) && text(wait!.threadId) && text(wait!.messageId) && Number.isFinite(wait!.failedAt)
+ && text(wait!.selection?.instanceId) && typeof wait!.selection?.model === "string";
+};
+const savedNotice = (row: unknown): row is SignedOutNotice => {
+ const notice = row as Partial<SignedOutNotice> | null;
+ return Boolean(notice) && text(notice!.instanceId) && text(notice!.threadId) && text(notice!.messageId) && Number.isFinite(notice!.at);
+};
+
export interface SignInResumeDeps {
file?: string;
store: Pick<Store, "activePath" | "messagesFor" | "taskByThread" | "projectBotForTask" | "patchMessage">;
@@ -68,7 +77,7 @@ export function createSignInResume(deps: SignInResumeDeps) {
const sending = new Set<SignInWait>();
const signedInAt = new Map<string, number>();
const chains = new Map<string, Promise<void>>();
- const scheduled = new Map<string, Promise<void>>();
+ const queuedPasses = new Map<string, Promise<void>>();
const rechecks = new Map<string, { ms: number; armed: boolean; unanswered: number }>();
const prune = (): void => {
@@ -79,9 +88,12 @@ export function createSignInResume(deps: SignInResumeDeps) {
if (deps.file) {
try {
- const saved = JSON.parse(readFileSync(deps.file, "utf8")) as Saved;
- waiting = Array.isArray(saved.waiting) ? saved.waiting : [];
- notices = Array.isArray(saved.notices) ? saved.notices : [];
+ const saved = JSON.parse(readFileSync(deps.file, "utf8")) as unknown;
+ const rows = (key: keyof Saved) => saved && typeof saved === "object" && Array.isArray((saved as Saved)[key]) ? (saved as Record<string, unknown[]>)[key]! : [];
+ waiting = rows("waiting").filter(savedWait);
+ notices = rows("notices").filter(savedNotice);
+ const dropped = rows("waiting").length + rows("notices").length - waiting.length - notices.length;
+ if (dropped) log(`sign-in resume: left out ${dropped} unreadable saved rows`);
} catch {}
prune();
}
@@ -95,7 +107,6 @@ export function createSignInResume(deps: SignInResumeDeps) {
}
};
- /** The message to send again, "park" while its bot has no room, or null when it no longer stands as it was left. */
const resumable = (wait: SignInWait): Message | "park" | null => {
const { store } = deps;
if (!store.taskByThread(wait.botId, wait.threadId) || deps.busy(wait.botId, wait.threadId)) return null;
@@ -129,7 +140,6 @@ export function createSignInResume(deps: SignInResumeDeps) {
state.unanswered = 0;
};
- /** Another pass after a wait that grows each time, while `instanceId` has rows it could not deal with yet. */
const recheck = (instanceId: string, unanswered: boolean): void => {
const state = recheckState(instanceId);
state.unanswered = unanswered ? state.unanswered + 1 : 0;
@@ -146,6 +156,7 @@ export function createSignInResume(deps: SignInResumeDeps) {
const signedInWhen = signedInAt.get(instanceId) ?? now();
const mine = (row: { selection?: ModelSelection; instanceId?: string; failedAt?: number; at?: number }) =>
(row.selection?.instanceId ?? row.instanceId) === instanceId && (row.failedAt ?? row.at ?? 0) < signedInWhen;
+ if (!waiting.some(mine) && !notices.some(mine)) return;
const stands = await deps.signedInNow(instanceId).catch(() => null);
if (!stands) {
if (waiting.some(mine) || notices.some(mine)) recheck(instanceId, true);
@@ -155,7 +166,7 @@ export function createSignInResume(deps: SignInResumeDeps) {
let parked = false;
for (const wait of waiting.filter((one) => mine(one) && !sending.has(one))) {
if (!stands()) break;
- const message = resumable(wait);
+ const message = now() - wait.failedAt < RESUME_WINDOW_MS ? resumable(wait) : null;
if (message === "park") {
parked = true;
continue;
@@ -188,15 +199,14 @@ export function createSignInResume(deps: SignInResumeDeps) {
else resetRecheck(instanceId);
};
- /** One pass at a time for each AI; a pass asked for while another waits to start is that same pass. */
const pass = (instanceId: string): Promise<void> => {
- const waitingToStart = scheduled.get(instanceId);
+ const waitingToStart = queuedPasses.get(instanceId);
if (waitingToStart) return waitingToStart;
const next = (chains.get(instanceId) ?? Promise.resolve()).then(() => {
- scheduled.delete(instanceId);
+ queuedPasses.delete(instanceId);
return run(instanceId);
}).catch((error: unknown) => log(`sign-in resume: ${error instanceof Error ? error.message : String(error)}`));
- scheduled.set(instanceId, next);
+ queuedPasses.set(instanceId, next);
chains.set(instanceId, next);
return next;
};
@@ -220,8 +230,7 @@ export function createSignInResume(deps: SignInResumeDeps) {
},
/** Something says this AI is signed in again: a status read, or a sign-in in the app. */
signedIn(instanceId: string): Promise<void> {
- const last = signedInAt.get(instanceId);
- if (last === undefined || now() - last >= SAME_SIGN_IN_MS) signedInAt.set(instanceId, now());
+ signedInAt.set(instanceId, now());
resetRecheck(instanceId);
return pass(instanceId);
},
@@ -241,7 +250,7 @@ export type SignInResume = ReturnType<typeof createSignInResume>;
* pass, so the turn it sends again is not held at its start. */
export function createSignInResumeHost(deps: Omit<SignInResumeDeps, "file" | "signedInNow" | "retry"> & {
dataDir: string;
- registry: Pick<ProviderRegistry, "forgetSnapshots" | "get" | "onSignedIn">;
+ registry: Pick<ProviderRegistry, "forgetSnapshots" | "get" | "onSignedIn" | "sawSignedIn">;
takeover: { signedIn(instanceId: string): void };
startTurn(botId: string, text: string, opts: { threadId: string; editedMessageId: string; replyTo?: Message; dataContext?: Message["dataContext"]; trigger?: UsageTrigger; sender?: Message["sender"] }): Promise<unknown>;
replyTarget(threadId: string, id: string): Message | undefined;
@@ -270,5 +279,10 @@ export function createSignInResumeHost(deps: Omit<SignInResumeDeps, "file" | "si
};
registry.onSignedIn(signedIn);
void Promise.resolve(deps.startupRead).then(() => resume.resumeSaved());
- return { ...resume, signedIn };
+ /** A sign-in made in the app: the status read that later finds it is the same sign-in, not another. */
+ const appSignedIn = (instanceId: string): void => {
+ registry.sawSignedIn(instanceId);
+ signedIn(instanceId);
+ };
+ return { ...resume, signedIn, appSignedIn };
}
diff --git a/server/index.ts b/server/index.ts
index 9b1a05ba25..46c6bff31d 100644
--- a/server/index.ts
+++ b/server/index.ts
@@ -1351,7 +1351,7 @@ const attributeUsage = createUsageAttribution({ section: (botId) => store.bot(bo
} usageCapGate.booked(row.botId);
}
-const providerAuthSessions = new ProviderAuthSessions({ signedIn: (instanceId) => signInResume.signedIn(instanceId) }); const mcpServersHost = createMcpServersHost({ dataDir: DATA_DIR, cfg: () => cfg, personMcp: () => teamConnections.personMcp(), botsPath: () => brokerPath(botBox), moveGrants: (bot, move) => moveSavedGrants(store, bot, move), persist: persistMcpServers, bots: () => store.bots, policy: (servers) => managedPolicy.filterMcp(servers), tell: (text, about) => notify(buildNoticeNotification(about, store.bot(about.id)?.threadId ?? "", text)), startsServers: (botId) => { const bot = store.bot(botId); return Boolean(bot && registry.get(bot.modelSelection.instanceId)?.adapter.capabilities.customMcp === true); }, boxed: () => botBox.enabled(), keys: mcpKeys, forgetSignIn: (name) => mcpOAuth.forget(name) });
+const providerAuthSessions = new ProviderAuthSessions({ signedIn: (instanceId) => signInResume.appSignedIn(instanceId) }); const mcpServersHost = createMcpServersHost({ dataDir: DATA_DIR, cfg: () => cfg, personMcp: () => teamConnections.personMcp(), botsPath: () => brokerPath(botBox), moveGrants: (bot, move) => moveSavedGrants(store, bot, move), persist: persistMcpServers, bots: () => store.bots, policy: (servers) => managedPolicy.filterMcp(servers), tell: (text, about) => notify(buildNoticeNotification(about, store.bot(about.id)?.threadId ?? "", text)), startsServers: (botId) => { const bot = store.bot(botId); return Boolean(bot && registry.get(bot.modelSelection.instanceId)?.adapter.capabilities.customMcp === true); }, boxed: () => botBox.enabled(), keys: mcpKeys, forgetSignIn: (name) => mcpOAuth.forget(name) });
const mcpOAuth = new McpOAuthManager({
file: join(DATA_DIR, "mcp-oauth.json"),
isOwnerLive: (owner) => owner === "loopback" || sessions.isLive(owner) || isCardOwnerLive(store, owner),
diff --git a/server/sign-in-resume-antigravity.e2e.test.ts b/server/sign-in-resume-antigravity.e2e.test.ts
index d51b8563bf..6bd4075428 100644
--- a/server/sign-in-resume-antigravity.e2e.test.ts
+++ b/server/sign-in-resume-antigravity.e2e.test.ts
@@ -79,9 +79,12 @@ it.skipIf(process.platform === "win32")("a bot on a signed-out Antigravity runs
expect(now.filter((row) => row.role === "user").map((row) => row.text)).toEqual(["继续吧"]);
expect(now.filter((row) => row.role === "bot" && row.kind === "text").at(-1)).toMatchObject({ text: "fixture reply" });
} finally {
- writeFileSync(`${logPath}.sign-in-resume-agy.json`, JSON.stringify(evidence, null, 2));
- await waitForExit(server, { signal: "SIGTERM" });
- await fixture.close();
- console.info(JSON.stringify({ logPath, evidence: `${logPath}.sign-in-resume-agy.json` }));
+ try {
+ writeFileSync(`${logPath}.sign-in-resume-agy.json`, JSON.stringify(evidence, null, 2));
+ console.info(JSON.stringify({ logPath, evidence: `${logPath}.sign-in-resume-agy.json` }));
+ } finally {
+ await waitForExit(server, { signal: "SIGTERM" });
+ await fixture.close();
+ }
}
}, hostTimeout(300_000));
diff --git a/server/sign-in-resume.e2e.test.ts b/server/sign-in-resume.e2e.test.ts
index 133596db2b..6ddfc7eedb 100644
--- a/server/sign-in-resume.e2e.test.ts
+++ b/server/sign-in-resume.e2e.test.ts
@@ -63,9 +63,12 @@ async function withSignedOutClaude(check: (fixture: {
all: async (threadId) => (await page(threadId)).messages,
});
} finally {
- writeFileSync(join(scratch, "evidence.json"), JSON.stringify(evidence, null, 2));
- console.info(JSON.stringify({ log: fixture.info.logPath, evidence: join(scratch, "evidence.json") }));
- await fixture.close();
+ try {
+ writeFileSync(join(scratch, "evidence.json"), JSON.stringify(evidence, null, 2));
+ console.info(JSON.stringify({ log: fixture.info.logPath, evidence: join(scratch, "evidence.json") }));
+ } finally {
+ await fixture.close();
+ }
}
}
@@ -97,6 +100,7 @@ it("signing in again runs each stuck conversation's message once more, and its s
expect(setupRows(now), "no sign-out row on the conversation as it reads now").toEqual([]);
expect(now.filter((row) => row.role === "user").map((row) => row.text)).toEqual([`Draft the plan for ${bot.name}`]);
expect(now.some((row) => row.role === "bot" && row.kind === "text" && row.text && !row.text.startsWith("Hi, I'm"))).toBe(true);
+ await expect.poll(async () => (await all(bot.activeTaskId)).some((row) => row.tool?.nameCode === "chat.notice.signedInAgain"), { timeout: 30_000 }).toBe(true);
const history = await all(bot.activeTaskId);
expect(setupRows(history).map((row) => row.tool!.name), "the failed try stays on its own version").toEqual(["error: Not logged in · Please run /login"]);
expect(history.filter((row) => row.tool?.nameCode === "chat.notice.signedInAgain"), "and its notice says the AI is signed in again").toHaveLength(1);
diff --git a/src/locales/pt-br.json b/src/locales/pt-br.json
index 0840202a50..b6248ba017 100644
--- a/src/locales/pt-br.json
+++ b/src/locales/pt-br.json
@@ -10218,6 +10218,7 @@
"serverError.wait.alreadyEnded": "Esta espera já terminou.",
"chat.notice.failoverSignedInAgain": "{engine} está com o login ativo novamente, então esta conversa voltou para {engine}.",
"chat.notice.failoverSignedOut": "{from} está sem login, então {to} assumiu.",
+ "chat.notice.signedInAgain": "{engine} está com login de novo.",
"serverError.botDefaults.nameLength": "O nome precisa ter no máximo 100 caracteres",
"serverError.botDefaults.sectionLength": "O nome da equipe precisa ter no máximo 60 caracteres",
"serverError.botDefaults.invalid": "Estas configurações do bot são inválidas.",
diff --git a/src/locales/source-hashes.json b/src/locales/source-hashes.json
index c33b862fe6..aa40b09f14 100644
--- a/src/locales/source-hashes.json
+++ b/src/locales/source-hashes.json
@@ -36083,6 +36083,7 @@
"serverError.wait.alreadyEnded": "be86b8a7a633810f0c30cbcaaefc5d2c752676503a408a309becb7deff463a2c",
"chat.notice.failoverSignedInAgain": "f7ad07121dd657d29d8243d3d6026e32c97b33b513b79460fef44c43652860bd",
"chat.notice.failoverSignedOut": "7bd97e3b465c2f6459a6df3c1509ff41dab29cb2f992a5e90aea48aeb676c40e",
+ "chat.notice.signedInAgain": "196873429f933f51d2d97300ff8bf0299558606d6452aba60c02f533d2bc5a51",
"serverError.botDefaults.nameLength": "99f0e0c98f56cc5679a5b10113f6d30ef44c35a44d9117e3e354dad1dfcdc9a7",
"serverError.botDefaults.sectionLength": "cc502025433f0b1ca3c902b927eb55ebb8faae9c38fd24655d8e358b78610885",
"serverError.botDefaults.invalid": "94ffcd279707a297db3074d3d01937ab6a825aaab505dc2fc3be8affcc1170dd",