Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
A routine says when a hand-off was refused, and doesn't report completed
milind-sonie0f241aaa690
diff --git a/docs/team-cloud.md b/docs/team-cloud.mdindex 368ac5748a..4578c9a825 100644--- a/docs/team-cloud.md+++ b/docs/team-cloud.md@@ -480,6 +480,7 @@ inbox is unread.| @Ben in a bot's settled reply, where Ben can see it | the same | that bot, in that conversation || a question or approval routed to Ben (`ask-routing.ts`), from a shared chat, a room, a routine or work handed on | a copy of the card, `"ask"` | the card where it was asked: the copy's buttons answer it there (`answeredIn`) and the copy follows it || a routine's report or a failure routed to Ben | the report, `"result"` / `"notice"` | nothing |+| a routine Ben wrote that tried to hand work to a bot it may not reach | what was refused, `"notice"` | nothing |An ask in the person's own private chat, where they are, stays only there. The Admins' asks (a bot nobody owns) are notanyone's inbox. A member without any bot of their own gets the notification where it was written, as before.diff --git a/server/host/refused-handoffs.test.ts b/server/host/refused-handoffs.test.tsnew file mode 100644index 0000000000..655cb801c8--- /dev/null+++ b/server/host/refused-handoffs.test.ts@@ -0,0 +1,86 @@+import { describe, expect, it } from "vitest";++import type { RosterMember } from "../peer-roster.ts";+import { createRefusedHandoffs } from "./refused-handoffs.ts";+import type { Delivery } from "./person-inbox.ts";++const B = { people: ["[email protected]"] };+const rooms: RosterMember = { id: "rooms", name: "Rooms", visibility: B };+const hours: RosterMember = { id: "hours", name: "Staff Hours", visibility: B };+const books: RosterMember = { id: "books", name: "Bookkeeping", visibility: "admins" };+const listed: RosterMember = { ...rooms, id: "listed", name: "Listed", peers: ["hours"] };+const mausbot: RosterMember = { id: "maus", name: "MausBot", visibility: { people: ["[email protected]"] }, defaultBot: { person: "[email protected]" } };+const bots = [rooms, hours, books, listed, mausbot];++function fixture(over: { writer?: string; asked?: string | null; run?: boolean; own?: boolean } = {}) {+ const lines: Array<{ to: string; delivery: Delivery }> = [];+ const refused = createRefusedHandoffs({+ bots: () => bots, runOf: () => (over.run === false ? undefined : { routineId: "r1", botId: "rooms" }), writerOf: () => over.writer,+ askedPerson: () => over.asked ?? null, theirOwn: () => over.own === true, inbox: () => ({ deliver: (to, delivery) => { lines.push({ to, delivery }); } }), language: () => undefined,+ });+ return { refused, lines };+}++describe("a routine's refused hand-off", () => {+ it("makes the run say so, once, whether the bot was named by id or by name", () => {+ for (const named of ["books", "Bookkeeping", "@bookkeeping"]) {+ const { refused } = fixture();+ refused.settled("t", rooms, [named], 403);+ expect(refused.take("t")).toBe("Rooms couldn't hand this to Bookkeeping, because they're shared with different people. Nothing was sent.");+ expect(refused.take("t")).toBeNull();+ }+ });++ it("says why when the bot's own list of peers is what refused it", () => {+ const { refused } = fixture();+ refused.settled("t", listed, ["Rooms"], 403);+ expect(refused.take("t")).toBe("Listed couldn't hand this to Rooms, because it isn't set to talk to it. Nothing was sent.");+ });++ it("stays quiet about anything that wasn't the refusal: a hand-off that went through, a typo, the bot itself, someone's own MausBot", () => {+ for (const [named, status] of [["Staff Hours", 202], ["Staff Hours", 403], ["Bookkeeper", 403], ["Rooms", 403], ["MausBot", 403], ["books", 202]] as const) {+ const { refused } = fixture();+ refused.settled("t", rooms, [named], status);+ expect(refused.take("t"), named).toBeNull();+ }+ });++ it("forgets a refusal once the same bot was reached after all", () => {+ const { refused } = fixture();+ refused.settled("t", rooms, ["Bookkeeping"], 403);+ refused.settled("t", rooms, ["books"], 202);+ expect(refused.take("t")).toBeNull();+ });++ it("keeps nothing for a conversation that isn't a routine's run", () => {+ const { refused } = fixture({ run: false });+ refused.settled("t", rooms, ["Bookkeeping"], 403);+ expect(refused.take("t")).toBeNull();+ });++ it("tells who wrote the routine in their inbox when the bot's failures reach someone else, once for the same words", () => {+ const { refused, lines } = fixture({ writer: "p_olive", asked: "p_mara" });+ refused.settled("t", rooms, ["Bookkeeping"], 403);+ refused.take("t");+ expect(lines).toHaveLength(1);+ expect(lines[0]!.to).toBe("p_olive");+ expect(lines[0]!.delivery).toMatchObject({ kind: "notice", quiet: false, title: "Rooms's routine couldn't hand off its work", text: "Rooms couldn't hand this to Bookkeeping, because they're shared with different people. Nothing was sent." });+ refused.settled("t2", rooms, ["Bookkeeping"], 403);+ refused.take("t2");+ expect(lines, "the next day's run says the same").toHaveLength(1);+ });++ it("reaches a person's inbox from a run of their own too, where the failure's own notification already tells them", () => {+ const { refused, lines } = fixture({ writer: "p_mara", asked: "p_mara", own: true });+ refused.settled("t", rooms, ["Bookkeeping"], 403);+ refused.take("t");+ expect(lines.map((line) => [line.to, line.delivery.quiet])).toEqual([["p_mara", true]]);+ });++ it("sends no second line when the bot's failures already reach who wrote it", () => {+ const { refused, lines } = fixture({ writer: "p_olive", asked: "p_olive" });+ refused.settled("t", rooms, ["Bookkeeping"], 403);+ refused.take("t");+ expect(lines).toEqual([]);+ });+});diff --git a/server/host/refused-handoffs.ts b/server/host/refused-handoffs.tsnew file mode 100644index 0000000000..741406fad5--- /dev/null+++ b/server/host/refused-handoffs.ts@@ -0,0 +1,74 @@+// A routine's run that tried to hand work to a bot it may not reach. coordinate_bots refuses while the turn runs, and the+// model may say anything after, so the run keeps who it was refused and ends saying so plainly, instead of "completed":+// nothing arrived. The person who wrote the routine reads it in their inbox, whoever else the bot's failures reach.+import { namesTeammate, reachesInAudience, unreachableTeammate, type RosterMember } from "../peer-roster.ts";+import { serverLine } from "../server-lines.ts";+import type { Delivery } from "./person-inbox.ts";++type Refused = { target: RosterMember; from: RosterMember };++export interface RefusedHandoffDeps {+ bots(): readonly RosterMember[];+ /** The run this conversation is, when it is one. */+ runOf(threadId: string): { routineId: string; botId: string } | undefined;+ /** The person key of who wrote this routine; absent off a Cloud and for a routine nobody wrote. */+ writerOf(routineId: string): string | undefined;+ /** Who this bot's failures in this conversation are for. */+ askedPerson(botId: string, threadId: string): string | null;+ /** This conversation is that person's own, where their failures stay rather than reaching their inbox. */+ theirOwn(threadId: string, person: string): boolean;+ /** Every person's inbox, made after this. */+ inbox(): { deliver(person: string, delivery: Delivery): unknown };+ /** The language of a line in this conversation. */+ language(threadId: string): string | undefined;+}++export function createRefusedHandoffs(deps: RefusedHandoffDeps) {+ const refused = new Map<string, Map<string, Refused>>();+ const toldWriter = new Map<string, string>();++ function words(threadId: string, seen: readonly Refused[]): string {+ const language = deps.language(threadId), bot = seen[0]!.from.name;+ const named = (some: readonly Refused[]) => some.map(({ target }) => target.name).join(", ");+ const apart = seen.filter(({ from, target }) => !reachesInAudience(from, target)), listed = seen.filter(({ from, target }) => reachesInAudience(from, target));+ return [+ ...(apart.length ? [serverLine(language, "server.runs.handoffApart", { bot, target: named(apart) })] : []),+ ...(listed.length ? [serverLine(language, "server.runs.handoffNotListed", { bot, target: named(listed) })] : []),+ ].join(" ");+ }++ return {+ /** A coordinate_bots call in a routine's run came back: remembers the bots it could not reach, and forgets one it has reached since. */+ settled(threadId: string, from: RosterMember, named: readonly string[], status: number): void {+ if (!deps.runOf(threadId)) return;+ const seen = refused.get(threadId) ?? new Map<string, Refused>();+ for (const raw of named) {+ const target = status >= 400 ? unreachableTeammate(deps.bots(), from, raw) : null;+ if (target) seen.set(target.id, { target, from });+ if (status < 400) for (const [id, was] of seen) if (namesTeammate(was.target, raw)) seen.delete(id);+ }+ if (seen.size) refused.set(threadId, seen);+ else refused.delete(threadId);+ },+ /** The run in this conversation is ending well: what it must say instead, once; null when nothing was refused. */+ take(threadId: string): string | null {+ const seen = [...refused.get(threadId)?.values() ?? []];+ if (!seen.length) return null;+ refused.delete(threadId);+ const said = words(threadId, seen);+ const run = deps.runOf(threadId), writer = run && deps.writerOf(run.routineId);+ const asked = run ? deps.askedPerson(run.botId, threadId) : null, inboxedAnyway = writer === asked && !deps.theirOwn(threadId, asked!);+ if (run && writer && !inboxedAnyway && toldWriter.get(run.routineId) !== said) {+ toldWriter.set(run.routineId, said);+ const from = seen[0]!.from;+ deps.inbox().deliver(writer, {+ kind: "notice", from: { name: from.name, botId: from.id }, origin: { botId: run.botId, threadId }, notify: "routine-failed",+ title: serverLine(deps.language(threadId), "server.runs.handoffRefusedTitle", { bot: from.name }), text: said, quiet: writer === asked,+ });+ }+ return said;+ },+ };+}++export type RefusedHandoffs = ReturnType<typeof createRefusedHandoffs>;diff --git a/server/index.ts b/server/index.tsindex 2f9d2519f7..d89cbdba12 100644--- a/server/index.ts+++ b/server/index.ts@@ -44,7 +44,7 @@ import { escapeAttribute } from "../src/lib/composer-attachments.ts";import { isPendingSignInRequest, normalizeSignInSite, signInOutcome, signInResumePrompt } from "../shared/sign-in-request.ts";import { createRoomTurnLevels } from "./room-turn-level.ts";-import { createSignInSettle } from "./host/sign-in-settle.ts"; import { createPersonLanguages, THIS_COMPUTER } from "./host/person-languages.ts"; import "./server-line-packs.ts"; import { serverLine, setConversationLanguage } from "./server-lines.ts";+import { createSignInSettle } from "./host/sign-in-settle.ts"; import { createPersonLanguages, THIS_COMPUTER } from "./host/person-languages.ts"; import "./server-line-packs.ts"; import { conversationLanguage, serverLine, setConversationLanguage } from "./server-lines.ts";import { RoomMemberLock } from "./room-member-lock.ts";import { approvalHeldNote, approvalHeldReason, approvalModeForOrigin, autoVerdict, deliverFullAccessApproval, undeliveredApprovalTool } from "./auto-approve.ts"; import { readsOwnFiles } from "./own-file-reads.ts";import { bindSafetyFloor, denyAtSafetyFloor, heldAtSafetyFloor, safetyFloorOn } from "./safety-floor-gate.ts";@@ -445,7 +445,7 @@ import { createScreenFrameSource, rememberTurnFrame, type ScreenCapture } from "import { screenFrameHash, screenSurfaceForTool, screenTouchingTool, settledFrameIsNews } from "./screen-frame-gate.ts";import { asSchedule, RoutineRequestService } from "./routine-requests.ts"; import { ownerSpokeOnly } from "./cloud-routine-level.ts"; import { routineRunCard, routineRunFallbackText } from "./routine-run-card.ts";import { activeRoutinesContext } from "./active-routines-context.ts";-import { automationContextText, createAutomationReports, newestAutomationLines } from "./automation-reports.ts"; import { createAutomationDestinations } from "./automation-destinations.ts"; import { createProactive } from "./host/proactive.ts"; import { createFirstHourHooks, startFirstHour, welcomeDonePatch } from "./host/first-hour-host.ts"; import { greetingMessage } from "./host/first-hour.ts"; import { READ_AND_DRAFT_PARTS, READ_AND_DRAFT_REFUSAL, READ_AND_DRAFT_TOOLS, recordsAnswer } from "./read-and-draft.ts"; import { createPresenceRoutes } from "./routes/presence.ts"; import { needsYouNow } from "./today.ts";+import { createRefusedHandoffs } from "./host/refused-handoffs.ts"; import { automationContextText, createAutomationReports, newestAutomationLines } from "./automation-reports.ts"; import { createAutomationDestinations } from "./automation-destinations.ts"; import { createProactive } from "./host/proactive.ts"; import { createFirstHourHooks, startFirstHour, welcomeDonePatch } from "./host/first-hour-host.ts"; import { greetingMessage } from "./host/first-hour.ts"; import { READ_AND_DRAFT_PARTS, READ_AND_DRAFT_REFUSAL, READ_AND_DRAFT_TOOLS, recordsAnswer } from "./read-and-draft.ts"; import { createPresenceRoutes } from "./routes/presence.ts"; import { needsYouNow } from "./today.ts";import { engineLabel, LimitResetClock, nearLimitNote } from "./limit-resets.ts"; import { loadPlanUsage, planAccountsFromInstances } from "./plan-usage.ts"; import { LimitFailovers, limitBackupAllowed } from "./limit-failover.ts"; import { createLimitResetRoutes } from "./routes/limit-resets.ts";import { parseTriggerRequest, triggerTarget } from "./trigger-tools.ts"; import { WebhookRequestError, WebhookRequestService } from "./webhook-requests.ts"; import { createAppTriggerHost } from "./app-trigger-host.ts";import { appliesNow, directApply, UNDO_STALE, type DirectApply } from "./direct-apply.ts";@@ -2854,7 +2854,7 @@ const { stopThreadForPerson, stopOnTypedCommand, restartForPerson, noteTeammatesstopGoal: (threadId) => oneOnOneGoals.stop(threadId), markStopped: (threadId) => personStops.stop(threadId, liveTurns.running(threadId), directTurnDispatchClaims.has(threadId)),}); const teamMessages = createTeamMessages({ team: CLOUD_TEAM, dataDir: DATA_DIR, store, people: teamOwners.people, personName: teamHost.personName, audienceOf: teamHost.audienceOf, starters: threadStarters, notify, sees: (person) => visibleTo(person.role === "member" ? { kind: "member", email: person.email } : { kind: "all", email: person.email }), inbox: { askedPerson: teamOwners.routing.askedPerson, changed: (threadId) => { const bot = store.botByThread(threadId); if (bot) broadcast({ kind: "bot", bot: wireBot(bot) }); }, ensureOwnBot: (email) => { ensureDefaultBot(store, { dataDir: DATA_DIR, person: email, team: CLOUD_TEAM?.name ?? null }); }, handedFrom: (threadId) => { const from = delegatorOf(threadId); return from && from.threadId !== threadId ? from.threadId : null; }, continueTurn: relayedTurn({ store, startTurn, state: (botId, threadId) => ({ atCapacity: botAtThreadCapacity(botId, threadId), threadBusy: threadBusy(botId, threadId), groupTurn: roomTurnHolds(activeGroupTurnForBot(botId), threadId, false), parksBehindCoordination: parksBehindCoordination(botId, threadId) }) }), representative: { generate: async (botId, prompt) => (await sideJobs.text("representative", botId)?.generateText(prompt, { timeoutMs: 60_000 })) ?? null, busy: createPersonCalendar({ access: (person) => teamConnections.personApps().includes("googlecalendar") ? teamConnections.people.appsAccess(person) : null, connected: async (access) => (await composio.connectedServices(cfg, access)).googlecalendar?.connected === true, relay: (payload, session, signal, access) => composio.relayMcp(cfg, payload as never, session, undefined, signal, access) }).busy } } });const botNameClash = createBotNameClash({ store, people: () => teamMessages.people(), profileName: () => cfg.profile?.name });-const devsReports = createDevsReports({ dataDir: DATA_DIR, store, installId: ENVIRONMENT_ID, appVersion: serverVersion(), runsOn: CLOUD_TEAM ? "Team Cloud" : CLOUD_HOME ? "My Cloud" : DESKTOP_MANAGED ? "desktop app" : HOSTED_WORKSPACE ? "hosted server" : "self-hosted server", recentLog: captureRecentLog(), send: devsReportSender(bugReportEndpoint(process.env, CLOUD_HOME?.adminOrigin)), askStatus: devsStatusAsker(bugReportEndpoint(process.env, CLOUD_HOME?.adminOrigin), CLOUD_HOME), statusEveryMs: Number(process.env.OMB_DEVS_STATUS_MS) || undefined, tell: (threadId, text, person) => { const group = store.groupByThread(threadId), bot = group ? store.bot(group.memberIds[0] ?? "") : store.botByThread(threadId); if (bot) notify({ ...buildNoticeNotification(bot, threadId, text), ...(group ? { groupId: group.id } : {}), ...(CLOUD_TEAM && person ? { forPerson: person } : {}) }); }, working: (threadId) => { const group = store.groupByThread(threadId), bot = group ? null : store.botByThread(threadId); return group ? Boolean(group.busyBotId) || groupThreadIsWorking(group.id, threadId) : Boolean(bot && threadBusy(bot.id, threadId)); }, automated: (threadId) => Boolean(routines?.isActiveThread(threadId)), engine: (instanceId) => (registry.get(instanceId) ? { name: engineName(instanceId), snapshot: registry.lastSnapshot(instanceId) } : null), appsReady: () => composio.configured(cfg), sessions: () => sessions.list(), ownerKey: CLOUD_OWNER_KEY, team: Boolean(CLOUD_TEAM), profileEmail: () => cfg.profile?.email, language: appLanguage, lineLanguage: personLanguages.forLine });+const refusedHandoffs = createRefusedHandoffs({ bots: () => store.bots, runOf: (threadId) => routines?.runForThread(threadId) ?? undefined, writerOf: (routineId) => cloudRoutineAuthors?.writer(routineId), askedPerson: teamOwners.routing.askedPerson, theirOwn: (threadId, person) => audienceMember(teamHost.audienceOf(threadId)) === person, inbox: () => teamMessages.inbox, language: conversationLanguage }); const devsReports = createDevsReports({ dataDir: DATA_DIR, store, installId: ENVIRONMENT_ID, appVersion: serverVersion(), runsOn: CLOUD_TEAM ? "Team Cloud" : CLOUD_HOME ? "My Cloud" : DESKTOP_MANAGED ? "desktop app" : HOSTED_WORKSPACE ? "hosted server" : "self-hosted server", recentLog: captureRecentLog(), send: devsReportSender(bugReportEndpoint(process.env, CLOUD_HOME?.adminOrigin)), askStatus: devsStatusAsker(bugReportEndpoint(process.env, CLOUD_HOME?.adminOrigin), CLOUD_HOME), statusEveryMs: Number(process.env.OMB_DEVS_STATUS_MS) || undefined, tell: (threadId, text, person) => { const group = store.groupByThread(threadId), bot = group ? store.bot(group.memberIds[0] ?? "") : store.botByThread(threadId); if (bot) notify({ ...buildNoticeNotification(bot, threadId, text), ...(group ? { groupId: group.id } : {}), ...(CLOUD_TEAM && person ? { forPerson: person } : {}) }); }, working: (threadId) => { const group = store.groupByThread(threadId), bot = group ? null : store.botByThread(threadId); return group ? Boolean(group.busyBotId) || groupThreadIsWorking(group.id, threadId) : Boolean(bot && threadBusy(bot.id, threadId)); }, automated: (threadId) => Boolean(routines?.isActiveThread(threadId)), engine: (instanceId) => (registry.get(instanceId) ? { name: engineName(instanceId), snapshot: registry.lastSnapshot(instanceId) } : null), appsReady: () => composio.configured(cfg), sessions: () => sessions.list(), ownerKey: CLOUD_OWNER_KEY, team: Boolean(CLOUD_TEAM), profileEmail: () => cfg.profile?.email, language: appLanguage, lineLanguage: personLanguages.forLine });const creditMoves = cloudCredit && createCreditMoves({ credit: cloudCredit, store, context: selectionContext, threadBusy, saveDefault: saveNewBotModel,defaults: () => [cfg.defaultModelSelection, cfg.newBotDefaults?.profile.modelSelection], engineName: id => registry.get(id)?.displayName ?? id,log: line => console.warn(line) });@@ -8902,7 +8902,7 @@ routines = new RoutineManager({launchId: DESKTOP_MANAGED && /^[\w-]{1,100}$/.test(process.env.OMB_DESKTOP_LAUNCH_ID ?? "")? process.env.OMB_DESKTOP_LAUNCH_ID : undefined,skipStartupRuns: Boolean(CLOUD_HOME) && wokeFromSleep(DATA_DIR), // a Cloud home waking from a sleep it was stopped for- hasPendingDelegations: runtimeWorkPending, handedOffWorkLive: (threadId) => coordinator.outstandingFor(threadId).length > 0,+ hasPendingDelegations: runtimeWorkPending, refusedHandoff: refusedHandoffs.take, handedOffWorkLive: (threadId) => coordinator.outstandingFor(threadId).length > 0,routineTurn: (threadId) => directRequestOwners.get(threadId)?.automation !== undefined,botState: unattendedDispatchState,goalState: (groupId, coordinatorBotId) => {@@ -14084,7 +14084,7 @@ const handleRequest = async (req: IncomingMessage, res: ServerResponse) => {}).safeParse(await readInternalBody());if (!parsed.success) return json(res, 400, { error: "Provide 1-4 distinct botIds and a message of 1-4000 characters; thread is standing, new or the id of a thread you opened on that teammate, title one line of at most 80 characters, reply is resume or none, consult is a boolean, done_when at most 1000 characters." });const { groupId, botIds, message, reason, rework, thread, title, reply, consult, inMyFolder, done_when: doneWhen, answers } = parsed.data;- const result = await coordinateBots({ groupId, botIds, message, reason: reason || undefined, rework, thread, title: title || undefined, reply, consult, inMyFolder, doneWhen: doneWhen || undefined, ...(answers ? { answers } : {}) });+ const result = await coordinateBots({ groupId, botIds, message, reason: reason || undefined, rework, thread, title: title || undefined, reply, consult, inMyFolder, doneWhen: doneWhen || undefined, ...(answers ? { answers } : {}) }); refusedHandoffs.settled(internalCapability.threadId, internalSender, botIds, result.status);return json(res, result.status, result.body);}if (method === "GET" && path === "/api/internal/room-targets") {diff --git a/server/peer-roster.ts b/server/peer-roster.tsindex c6578b6b0a..144eb7d427 100644--- a/server/peer-roster.ts+++ b/server/peer-roster.ts@@ -138,6 +138,25 @@ export function reachablePeers<T extends RosterMember>(bots: readonly T[], from:});}+const foldedName = (value: string) => value.replace(/^@/, "").replace(/\s+/g, " ").trim().toLowerCase();+// Models slug names they saw ("Reviewer 2" → "reviewer-2").+const looseName = (value: string) => foldedName(value.replace(/[-_]+/g, " "));++/** Whether `raw`, as a bot wrote it, means this teammate: its id, or its name however it was typed. */+export function namesTeammate(target: Pick<RosterMember, "id" | "name">, raw: string): boolean {+ const wanted = raw.trim();+ return target.id === wanted || foldedName(target.name) === foldedName(wanted) || looseName(target.name) === looseName(wanted);+}++/** Their audiences alone would let `from` reach `target`, whatever its own list of peers says. */+export const reachesInAudience = (from: RosterMember, target: RosterMember): boolean => sameAudience(from.visibility, target.visibility);++/** The teammate `raw` names when `from` may not reach it. A person's own MausBot is never named to anyone else. */+export function unreachableTeammate<T extends RosterMember>(bots: readonly T[], from: RosterMember, raw: string): T | null {+ const target = bots.find((bot) => bot.id === raw.trim()) ?? bots.find((bot) => namesTeammate(bot, raw));+ return target && target.id !== from.id && !target.hidden && !target.defaultBot && !canReach(from, target) ? target : null;+}+/** A name resolves only inside reachablePeers, so it can never reach a bot its id could not. `elsewhere(name)`: why no bot* here has that name past "no such bot", when one of the person's other places has it, or when they work as one place. */export function resolveTeammate<T extends RosterMember>(@@ -149,9 +168,7 @@ export function resolveTeammate<T extends RosterMember>(): { id: string; byName: boolean } | { error: string } {const wanted = raw.trim();if (bots.some(bot => bot.id === wanted)) return { id: wanted, byName: false };- const fold = (value: string) => value.replace(/^@/, "").replace(/\s+/g, " ").trim().toLowerCase();- // Models slug names they saw ("Reviewer 2" → "reviewer-2").- const loose = (value: string) => fold(value.replace(/[-_]+/g, " "));+ const fold = foldedName, loose = looseName;const name = fold(wanted);const shown = peerName(wanted) || wanted;if (!name) return { error: `No bot with id "${shown}" — call list_bots and copy the exact id from the result` };diff --git a/server/routines.ts b/server/routines.tsindex 73132a1e20..17f6c0c651 100644--- a/server/routines.ts+++ b/server/routines.ts@@ -257,7 +257,7 @@ export interface RoutineManagerOptions {onRunDeferred?: (run: RoutineRun, alert?: RoutineAlert) => void;/** A run a restart cut off, before it starts again or fails: its old turn's work must not resume as well. */onRunCut?: (run: RoutineRun) => void;- hasPendingDelegations?: (threadId: string) => boolean;+ hasPendingDelegations?: (threadId: string) => boolean; /** Why a run that ended well in this thread must say a hand-off was refused, once; null when none was. */ refusedHandoff?: (threadId: string) => string | null;/** The turn in this thread is a routine's own, not one a person started there while its run waits on teammates. */routineTurn?: (threadId: string) => boolean;/** When an engine's usage limit resets (epoch ms), or null while that is not known. */@@ -1279,11 +1279,10 @@ export class RoutineManager {return cloneRun(run);}this.failureFacts.delete(run.id);- if (this.options.hasPendingDelegations?.(event.threadId) === true) this.wait(run, "Waiting for work it handed on to finish");- else {- Object.assign(run, { status: "completed", attention: undefined, finishedAt: this.now() } satisfies Partial<RoutineRun>);- this.ownerNotices = this.ownerNotices.filter((notice) => notice.botId !== run.botId);- }+ const waitsOnTeammates = this.options.hasPendingDelegations?.(event.threadId) === true, handoffRefused = waitsOnTeammates ? null : this.options.refusedHandoff?.(event.threadId);+ if (handoffRefused) { this.failRun(Object.assign(run, { partial: Boolean(run.output) || undefined }), handoffRefused); queueMicrotask(() => this.tickInBackground()); return cloneRun(run); }+ if (waitsOnTeammates) this.wait(run, "Waiting for work it handed on to finish");+ else { Object.assign(run, { status: "completed", attention: undefined, finishedAt: this.now() } satisfies Partial<RoutineRun>); this.ownerNotices = this.ownerNotices.filter((notice) => notice.botId !== run.botId); }run.error = undefined;} else {return null;diff --git a/server/team-refused-handoff.e2e.test.ts b/server/team-refused-handoff.e2e.test.tsnew file mode 100644index 0000000000..619af070a5--- /dev/null+++ b/server/team-refused-handoff.e2e.test.ts@@ -0,0 +1,82 @@+// A real Team Cloud with the fake engine: a routine that hands work to a bot shared with different people says so to the+// person who owns it, and nothing arrives. The engine's tool call is scripted, so this proves the rule and the report, not+// that a model would write that call.+import { randomBytes } from "node:crypto";+import { rmSync, writeFileSync } from "node:fs";+import { join } from "node:path";+import { afterAll, beforeAll, expect, it } from "vitest";+import { launchCloudSendFixture, type CloudSendFixture, type CloudTeamFixture } from "../scripts/testing/cloud-send-fixture.ts";+import { hostTimeout } from "./testing/host-timeout.ts";++const OWNER = { email: "[email protected]", role: "owner" as const }, MEMBER = { email: "[email protected]", role: "member" as const };+const ENGINE = `process.env.FAKE_CLAUDE_TOOL_CALLS_FILE = process.env.FAKE_CLAUDE_FIXTURE_DIR + "/tool-calls.json";`;+const REFUSED = "Rooms couldn't hand this to Bookkeeping, because they're shared with different people. Nothing was sent.";+const ONLY_MARA = { everyone: "none", people: { [MEMBER.email]: "chat" } };+type Bot = { id: string; name: string; threadId: string; mainThreadId?: string };+let fx: CloudSendFixture, team: CloudTeamFixture, owner = "", member = "";+let rooms: Bot, hours: Bot, books: Bot;++const sleep = (ms: number) => new Promise((done) => setTimeout(done, ms));+const script = (calls: unknown[] | null) => { const file = join(team.home, "tool-calls.json"); if (calls) writeFileSync(file, JSON.stringify(calls)); else rmSync(file, { force: true }); };+const handOff = (to: string, extra: Record<string, unknown> = {}) => ({ name: "coordinate_bots", server: "agents", input: { bot_ids: [to], message: "Rooms 12, Staff hours 86.", ...extra } });+const make = async (name: string, access: unknown) => {+ const made = await team.as(owner, "POST", "/api/bots", { name });+ expect(made.status, JSON.stringify(made.body)).toBe(201);+ expect((await team.as(owner, "PUT", `/api/bots/${made.body.bot.id}/access`, access)).status).toBe(200);+ return made.body.bot as Bot;+};+async function runRoutine(token: string, bot: Bot, name: string, calls: unknown[]) {+ const made = await team.as(token, "POST", "/api/routines", { name, prompt: "Send today's numbers on.", botId: bot.id, schedule: { type: "interval", everyMinutes: 1440, anchorAt: Date.now() + 86_400_000 } });+ expect(made.status, JSON.stringify(made.body)).toBe(201);+ script(calls);+ const ran = await team.as(token, "POST", `/api/routines/${made.body.routine.id}/run`);+ const end = Date.now() + 90_000;+ for (;;) {+ const run = ((await team.as(token, "GET", "/api/routines")).body.runs as Array<{ id: string; status: string; error?: string; partial?: boolean; threadId?: string }>).find((candidate) => candidate.id === ran.body.run.id);+ if (run && ["completed", "failed"].includes(run.status)) return run;+ if (Date.now() > end) throw new Error(`the run did not end: ${JSON.stringify(run)}`);+ await sleep(200);+ }+}+const inbox = async (token: string) => ((await team.as(token, "GET", "/api/inbox")).body.rows ?? []) as Array<{ kind: string; text: string }>;+const lines = async (token: string, threadId: string) => ((await team.as(token, "GET", `/api/threads/${threadId}/messages?limit=200`)).body.messages ?? []) as Array<{ role: string; text?: string }>;+const refusedLine = (rows: Array<{ text: string }>) => rows.filter((row) => row.text.includes(REFUSED));++beforeAll(async () => {+ fx = await launchCloudSendFixture({ onePasswordToken: `ops_fake-team-${randomBytes(8).toString("hex")}`, team: { id: "team-acme-1", name: "Acme", engine: ENGINE } });+ team = fx.team!;+ owner = (await team.pair(OWNER)).token!;+ member = (await team.pair(MEMBER)).token!;+ rooms = await make("Rooms", ONLY_MARA);+ hours = await make("Staff Hours", ONLY_MARA);+ books = await make("Bookkeeping", { everyone: "none", people: {} });+}, hostTimeout(180_000));+afterAll(async () => { await fx?.close(); });++it("an owner's routine says the hand-off was refused, never completed, and the owner reads it in their inbox", async () => {+ const run = await runRoutine(owner, rooms, "Evening numbers", [handOff(books.id)]);+ expect(run).toMatchObject({ status: "failed", error: REFUSED, partial: true });+ await expect.poll(async () => refusedLine(await inbox(owner)).length, { timeout: 10_000 }).toBeGreaterThan(0);+ expect((await lines(owner, books.threadId)).filter((line) => line.role === "user"), "nothing arrived").toEqual([]);+}, hostTimeout(120_000));++it("a member's routine, naming the bot, says so to the member", async () => {+ const run = await runRoutine(member, rooms, "Mara's numbers", [handOff("Bookkeeping")]);+ expect(run).toMatchObject({ status: "failed", error: REFUSED });+ await expect.poll(async () => refusedLine(await inbox(member)).length, { timeout: 10_000 }).toBeGreaterThan(0);+}, hostTimeout(120_000));++it("reaches who wrote the routine when the bot's failures go to someone else", async () => {+ expect((await team.as(owner, "PUT", `/api/bots/${hours.id}/reports-to`, { email: MEMBER.email })).status).toBe(200);+ const before = refusedLine(await inbox(owner)).length;+ const run = await runRoutine(owner, hours, "Hours", [handOff(books.id)]);+ expect(run).toMatchObject({ status: "failed" });+ await expect.poll(async () => (await inbox(owner)).filter((row) => row.text.includes("Staff Hours couldn't hand this to Bookkeeping")).length, { timeout: 10_000 }).toBeGreaterThan(0);+ expect(refusedLine(await inbox(owner)).length).toBe(before);+}, hostTimeout(120_000));++it("leaves a routine alone when its hand-off went through", async () => {+ const run = await runRoutine(owner, rooms, "Within the studio", [handOff(hours.id, { reply: "none" })]);+ expect(run.status).toBe("completed");+ expect(run.error).toBeUndefined();+}, hostTimeout(120_000));diff --git a/src/locales/de.json b/src/locales/de.jsonindex 69ff67dbcc..d6386c7c06 100644--- a/src/locales/de.json+++ b/src/locales/de.json@@ -59,6 +59,9 @@"server.runs.didNotFinish": "Diese Ausführung wurde nicht beendet.","server.runs.didNotFinishWhy": "Diese Ausführung wurde nicht beendet: {detail}","server.runs.partlyDoneWhy": "Diese Ausführung wurde teilweise erledigt: {detail}",+ "server.runs.handoffApart": "{bot} konnte das nicht an {target} übergeben, weil sie mit unterschiedlichen Personen geteilt sind. Es wurde nichts gesendet.",+ "server.runs.handoffNotListed": "{bot} konnte das nicht an {target} übergeben, weil dieser Bot nicht mit ihm sprechen darf. Es wurde nichts gesendet.",+ "server.runs.handoffRefusedTitle": "Die Routine von {bot} konnte ihre Arbeit nicht übergeben","server.runs.recovered": "Wieder in Ordnung: {name} wurde um {time} erfolgreich beendet","server.runs.card.line": "Routine „{name}“ {state}","server.runs.state.needsInput": "braucht deine Eingabe",diff --git a/src/locales/en.json b/src/locales/en.jsonindex 2dc463d346..8a041d7fca 100644--- a/src/locales/en.json+++ b/src/locales/en.json@@ -158,6 +158,9 @@"server.runs.didNotFinish": "This run didn't finish.","server.runs.didNotFinishWhy": "This run didn't finish: {detail}","server.runs.partlyDoneWhy": "This run was partly done: {detail}",+ "server.runs.handoffApart": "{bot} couldn't hand this to {target}, because they're shared with different people. Nothing was sent.",+ "server.runs.handoffNotListed": "{bot} couldn't hand this to {target}, because it isn't set to talk to it. Nothing was sent.",+ "server.runs.handoffRefusedTitle": "{bot}'s routine couldn't hand off its work","server.runs.recovered": "Recovered: {name} finished OK at {time}","server.runs.card.line": "Routine “{name}” {state}","server.runs.state.needsInput": "needs your input",diff --git a/src/locales/es.json b/src/locales/es.jsonindex 312451deba..429c364875 100644--- a/src/locales/es.json+++ b/src/locales/es.json@@ -102,6 +102,9 @@"server.runs.didNotFinish": "Esta ejecución no terminó.","server.runs.didNotFinishWhy": "Esta ejecución no terminó: {detail}","server.runs.partlyDoneWhy": "Esta ejecución se completó en parte: {detail}",+ "server.runs.handoffApart": "{bot} no pudo pasar esto a {target} porque están compartidos con personas distintas. No se envió nada.",+ "server.runs.handoffNotListed": "{bot} no pudo pasar esto a {target} porque no está configurado para hablar con él. No se envió nada.",+ "server.runs.handoffRefusedTitle": "La rutina de {bot} no pudo pasar su trabajo","server.runs.recovered": "Resuelto: {name} terminó bien a las {time}","server.runs.card.line": "La rutina «{name}» {state}","server.runs.state.needsInput": "necesita tu respuesta",diff --git a/src/locales/fr.json b/src/locales/fr.jsonindex e35c88773f..c6c9447a4b 100644--- a/src/locales/fr.json+++ b/src/locales/fr.json@@ -56,6 +56,9 @@"server.runs.didNotFinish": "Cette exécution ne s'est pas terminée.","server.runs.didNotFinishWhy": "Cette exécution ne s'est pas terminée : {detail}","server.runs.partlyDoneWhy": "Cette exécution n'a été faite qu'en partie : {detail}",+ "server.runs.handoffApart": "{bot} n'a pas pu transmettre ceci à {target}, car ils sont partagés avec des personnes différentes. Rien n'a été envoyé.",+ "server.runs.handoffNotListed": "{bot} n'a pas pu transmettre ceci à {target}, car il n'est pas configuré pour lui parler. Rien n'a été envoyé.",+ "server.runs.handoffRefusedTitle": "La routine de {bot} n'a pas pu transmettre son travail","server.runs.recovered": "Rétabli : {name} s'est bien terminé à {time}","server.runs.card.line": "Routine « {name} » {state}","server.runs.state.needsInput": "attend votre réponse",diff --git a/src/locales/hi.json b/src/locales/hi.jsonindex 3330da0f9a..380cfe7a3d 100644--- a/src/locales/hi.json+++ b/src/locales/hi.json@@ -56,6 +56,9 @@"server.runs.didNotFinish": "यह एक्ज़ीक्यूशन पूरा नहीं हुआ।","server.runs.didNotFinishWhy": "यह एक्ज़ीक्यूशन पूरा नहीं हुआ: {detail}","server.runs.partlyDoneWhy": "यह एक्ज़ीक्यूशन आंशिक रूप से पूरा हुआ: {detail}",+ "server.runs.handoffApart": "{bot} इसे {target} को नहीं दे सका, क्योंकि वे अलग-अलग लोगों के साथ साझा हैं। कुछ भी नहीं भेजा गया।",+ "server.runs.handoffNotListed": "{bot} इसे {target} को नहीं दे सका, क्योंकि उसे उससे बात करने के लिए सेट नहीं किया गया है। कुछ भी नहीं भेजा गया।",+ "server.runs.handoffRefusedTitle": "{bot} की रूटीन अपना काम आगे नहीं दे सकी","server.runs.recovered": "फिर से ठीक है: {name} {time} पर ठीक से पूरा हुआ","server.runs.card.line": "रूटीन “{name}” {state}","server.runs.state.needsInput": "आपके जवाब का इंतज़ार कर रहा है",diff --git a/src/locales/it.json b/src/locales/it.jsonindex 3192f02ce3..689beac22c 100644--- a/src/locales/it.json+++ b/src/locales/it.json@@ -107,6 +107,9 @@"server.runs.didNotFinish": "Questa esecuzione non è terminata.","server.runs.didNotFinishWhy": "Questa esecuzione non è terminata: {detail}","server.runs.partlyDoneWhy": "Questa esecuzione è stata completata in parte: {detail}",+ "server.runs.handoffApart": "{bot} non ha potuto passare questo a {target}, perché sono condivisi con persone diverse. Non è stato inviato nulla.",+ "server.runs.handoffNotListed": "{bot} non ha potuto passare questo a {target}, perché non è impostato per parlargli. Non è stato inviato nulla.",+ "server.runs.handoffRefusedTitle": "La routine di {bot} non ha potuto passare il suo lavoro","server.runs.recovered": "Risolto: {name} è terminata correttamente alle {time}","server.runs.card.line": "La routine «{name}» {state}","server.runs.state.needsInput": "aspetta una tua risposta",diff --git a/src/locales/ja.json b/src/locales/ja.jsonindex 0e9bf7b0dc..be026aed48 100644--- a/src/locales/ja.json+++ b/src/locales/ja.json@@ -109,6 +109,9 @@"server.runs.didNotFinish": "この実行は完了しませんでした。","server.runs.didNotFinishWhy": "この実行は完了しませんでした:{detail}","server.runs.partlyDoneWhy": "この実行は一部だけ完了しました:{detail}",+ "server.runs.handoffApart": "{bot} はこれを {target} に引き継げませんでした。共有先の人が異なるためです。何も送信されていません。",+ "server.runs.handoffNotListed": "{bot} はこれを {target} に引き継げませんでした。相手と話すよう設定されていないためです。何も送信されていません。",+ "server.runs.handoffRefusedTitle": "{bot} のルーティンは作業を引き継げませんでした","server.runs.recovered": "復旧しました:{name} は {time} に正常に完了しました","server.runs.card.line": "ルーティン「{name}」は{state}","server.runs.state.needsInput": "あなたの入力を待っています",diff --git a/src/locales/ko.json b/src/locales/ko.jsonindex e6f4cadd85..914cecca10 100644--- a/src/locales/ko.json+++ b/src/locales/ko.json@@ -152,6 +152,9 @@"server.runs.didNotFinish": "이번 실행은 끝나지 않았어요.","server.runs.didNotFinishWhy": "이번 실행은 끝나지 않았어요: {detail}","server.runs.partlyDoneWhy": "이번 실행은 일부만 끝났어요: {detail}",+ "server.runs.handoffApart": "{bot}이(가) 이 일을 {target}에게 넘기지 못했어요. 공유된 사람이 서로 다르기 때문이에요. 아무것도 보내지 않았어요.",+ "server.runs.handoffNotListed": "{bot}이(가) 이 일을 {target}에게 넘기지 못했어요. 대화하도록 설정되어 있지 않기 때문이에요. 아무것도 보내지 않았어요.",+ "server.runs.handoffRefusedTitle": "{bot}의 루틴이 일을 넘기지 못했어요","server.runs.recovered": "복구됨: {name} 실행이 {time}에 정상적으로 끝났어요","server.runs.card.line": "루틴 “{name}”: {state}","server.runs.state.needsInput": "입력이 필요해요",diff --git a/src/locales/pl.json b/src/locales/pl.jsonindex 5ebfec6702..aadde9896c 100644--- a/src/locales/pl.json+++ b/src/locales/pl.json@@ -109,6 +109,9 @@"server.runs.didNotFinish": "To uruchomienie się nie zakończyło.","server.runs.didNotFinishWhy": "To uruchomienie się nie zakończyło: {detail}","server.runs.partlyDoneWhy": "To uruchomienie zostało wykonane częściowo: {detail}",+ "server.runs.handoffApart": "{bot} nie może przekazać tego do {target}, bo są udostępnione różnym osobom. Nic nie wysłano.",+ "server.runs.handoffNotListed": "{bot} nie może przekazać tego do {target}, bo nie ma ustawionej rozmowy z tym botem. Nic nie wysłano.",+ "server.runs.handoffRefusedTitle": "Rutyna bota {bot} nie może przekazać swojej pracy","server.runs.recovered": "Znowu działa: rutyna „{name}” zakończyła się poprawnie o {time}","server.runs.card.line": "Rutyna „{name}” {state}","server.runs.state.needsInput": "czeka na twoją odpowiedź",diff --git a/src/locales/pt-br.json b/src/locales/pt-br.jsonindex 8fe32c2164..7541166a75 100644--- a/src/locales/pt-br.json+++ b/src/locales/pt-br.json@@ -101,6 +101,9 @@"server.runs.didNotFinish": "Esta execução não terminou.","server.runs.didNotFinishWhy": "Esta execução não terminou: {detail}","server.runs.partlyDoneWhy": "Esta execução foi concluída em parte: {detail}",+ "server.runs.handoffApart": "{bot} não conseguiu passar isto para {target}, porque estão compartilhados com pessoas diferentes. Nada foi enviado.",+ "server.runs.handoffNotListed": "{bot} não conseguiu passar isto para {target}, porque não está configurado para falar com ele. Nada foi enviado.",+ "server.runs.handoffRefusedTitle": "A rotina de {bot} não conseguiu passar o trabalho","server.runs.recovered": "Resolvido: {name} terminou bem às {time}","server.runs.card.line": "A rotina “{name}” {state}","server.runs.state.needsInput": "precisa da sua resposta",diff --git a/src/locales/ru.json b/src/locales/ru.jsonindex ee6cc7fa62..8901eb36e4 100644--- a/src/locales/ru.json+++ b/src/locales/ru.json@@ -109,6 +109,9 @@"server.runs.didNotFinish": "Этот запуск не завершился.","server.runs.didNotFinishWhy": "Этот запуск не завершился: {detail}","server.runs.partlyDoneWhy": "Этот запуск выполнен частично: {detail}",+ "server.runs.handoffApart": "{bot} не смог передать это {target}: они доступны разным людям. Ничего не отправлено.",+ "server.runs.handoffNotListed": "{bot} не смог передать это {target}: он не настроен на общение с ним. Ничего не отправлено.",+ "server.runs.handoffRefusedTitle": "Расписание {bot} не смогло передать работу","server.runs.recovered": "Снова в порядке: процедура «{name}» успешно завершилась в {time}","server.runs.card.line": "Процедура «{name}» {state}","server.runs.state.needsInput": "ждёт вашего ответа",diff --git a/src/locales/tr.json b/src/locales/tr.jsonindex 9868a6c55e..92d20dfe43 100644--- a/src/locales/tr.json+++ b/src/locales/tr.json@@ -87,6 +87,9 @@"server.runs.didNotFinish": "Bu çalıştırma tamamlanmadı.","server.runs.didNotFinishWhy": "Bu çalıştırma tamamlanmadı: {detail}","server.runs.partlyDoneWhy": "Bu çalıştırma kısmen tamamlandı: {detail}",+ "server.runs.handoffApart": "{bot} bunu {target} botuna devredemedi, çünkü farklı kişilerle paylaşılıyorlar. Hiçbir şey gönderilmedi.",+ "server.runs.handoffNotListed": "{bot} bunu {target} botuna devredemedi, çünkü onunla konuşacak şekilde ayarlanmamış. Hiçbir şey gönderilmedi.",+ "server.runs.handoffRefusedTitle": "{bot} rutini işini devredemedi","server.runs.recovered": "Düzeldi: {name} sorunsuz tamamlandı (saat {time})","server.runs.card.line": "“{name}” rutini {state}","server.runs.state.needsInput": "yanıtınızı bekliyor",diff --git a/src/locales/uk.json b/src/locales/uk.jsonindex 14c34fd934..cf56ee0485 100644--- a/src/locales/uk.json+++ b/src/locales/uk.json@@ -56,6 +56,9 @@"server.runs.didNotFinish": "Цей запуск не завершився.","server.runs.didNotFinishWhy": "Цей запуск не завершився: {detail}","server.runs.partlyDoneWhy": "Цей запуск виконано частково: {detail}",+ "server.runs.handoffApart": "{bot} не зміг передати це {target}: вони доступні різним людям. Нічого не надіслано.",+ "server.runs.handoffNotListed": "{bot} не зміг передати це {target}: він не налаштований на спілкування з ним. Нічого не надіслано.",+ "server.runs.handoffRefusedTitle": "Розклад {bot} не зміг передати роботу","server.runs.recovered": "Знову все гаразд: рутина «{name}» успішно завершилася о {time}","server.runs.card.line": "Рутина «{name}» {state}","server.runs.state.needsInput": "чекає на вашу відповідь",diff --git a/src/locales/vi.json b/src/locales/vi.jsonindex 475c50665f..fc0f72d93f 100644--- a/src/locales/vi.json+++ b/src/locales/vi.json@@ -87,6 +87,9 @@"server.runs.didNotFinish": "Lượt chạy này chưa hoàn tất.","server.runs.didNotFinishWhy": "Lượt chạy này chưa hoàn tất: {detail}","server.runs.partlyDoneWhy": "Lần chạy này chỉ xong một phần: {detail}",+ "server.runs.handoffApart": "{bot} không thể chuyển việc này cho {target} vì chúng được chia sẻ với những người khác nhau. Chưa có gì được gửi.",+ "server.runs.handoffNotListed": "{bot} không thể chuyển việc này cho {target} vì chưa được thiết lập để nói chuyện với bot đó. Chưa có gì được gửi.",+ "server.runs.handoffRefusedTitle": "Quy trình của {bot} không thể chuyển việc","server.runs.recovered": "Đã ổn trở lại: {name} đã chạy xong bình thường lúc {time}","server.runs.card.line": "Tác vụ định kỳ “{name}” {state}","server.runs.state.needsInput": "cần bạn trả lời",diff --git a/src/locales/zh-tw.json b/src/locales/zh-tw.jsonindex 6128add6cb..80f3675a7c 100644--- a/src/locales/zh-tw.json+++ b/src/locales/zh-tw.json@@ -86,6 +86,9 @@"server.runs.didNotFinish": "這次執行沒有完成。","server.runs.didNotFinishWhy": "這次執行沒有完成:{detail}","server.runs.partlyDoneWhy": "這次執行只完成了一部分:{detail}",+ "server.runs.handoffApart": "{bot} 無法將這項工作交給 {target},因為它們共享的對象不同。沒有傳送任何內容。",+ "server.runs.handoffNotListed": "{bot} 無法將這項工作交給 {target},因為它未設定為可與對方溝通。沒有傳送任何內容。",+ "server.runs.handoffRefusedTitle": "{bot} 的例行任務無法交接工作","server.runs.recovered": "已恢復:{name} 已於 {time} 正常完成","server.runs.card.line": "例行工作「{name}」{state}","server.runs.state.needsInput": "需要你回覆",diff --git a/src/locales/zh.json b/src/locales/zh.jsonindex 51a6d7ce1e..a879679a07 100644--- a/src/locales/zh.json+++ b/src/locales/zh.json@@ -155,6 +155,9 @@"server.runs.didNotFinish": "这次执行没有完成。","server.runs.didNotFinishWhy": "这次执行没有完成:{detail}","server.runs.partlyDoneWhy": "这次运行只完成了一部分:{detail}",+ "server.runs.handoffApart": "{bot} 无法将这项工作交给 {target},因为它们共享的对象不同。没有发送任何内容。",+ "server.runs.handoffNotListed": "{bot} 无法将这项工作交给 {target},因为它未设置为可与对方沟通。没有发送任何内容。",+ "server.runs.handoffRefusedTitle": "{bot} 的例行任务无法交接工作","server.runs.recovered": "已恢复:{name} 已于 {time} 正常完成","server.runs.card.line": "例行任务「{name}」{state}","server.runs.state.needsInput": "需要你回复",