Skip to content

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

Merge remote-tracking branch 'gh/train/nov30-a8a' into train/nov30-final

milind-soni6a9eafed6fa3
diff --cc server/drivers/codex.ts
index 2346b060f9,0d653e65ae..12cbc0b9a9
--- a/server/drivers/codex.ts
+++ b/server/drivers/codex.ts
@@@ -2,10 -2,10 +2,10 @@@ import { decodeRoutedCodexConfig, manag
export { managedCodexArgs, endpointCodexArgs } from "./codex-endpoint-config.ts";
import { codexActionFailure } from "./codex-action-notice.ts";
import { codexToolSurfaceArgs } from "./codex-tool-surface.ts";
-import { codexShellDisabled, codexTurnConfigArgs } from "./codex-guest.ts"; import { shellOff } from "./shell-off.ts";
+import { codexShellDisabled, codexTurnConfigArgs } from "./codex-guest.ts"; import { shellOff } from "./shell-off.ts"; import { withTrailingTurnClock } from "../turn-clock.ts";
import { TEAM_TOOLS_FAILED, teamToolsFailed } from "./team-tools.ts";
import { enabledMcpMounts, mcpStartupTracker, supportsMcpStartup } from "./codex-mcp-startup.ts";
- import { boxAdmittedEnv, boxProxyEnvNames, customServerEnvBox, type McpApprovalMode, mountMcpServer } from "./codex-mcp-mount.ts";
+ import { boxAdmittedEnv, boxProxyEnvNames, codexInSeccompBox, customServerEnvBox, type McpApprovalMode, mountMcpServer } from "./codex-mcp-mount.ts";
import { reportUnsupportedCalls, rolloutMark, type RolloutMark } from "./codex-unsupported-calls.ts";
// The `codex` CLI headless over its app-server JSON-RPC (NDJSON on stdio): completion is
// `turn/completed`, approvals arrive as server→client requests, resumeCursor is the codex thread id.
@@@ -55,11 -55,11 +55,11 @@@ import { CodexDeviceAuthController } fr
import { codexAccountEmail, codexHome } from "./codex-identity.ts";
import { keepChatsOutOfCodexHistory, linkSharedCodexHome } from "./codex-shared-home.ts";
import { mcpAppApprovalForm, mcpAppApprovalText, mcpElicitationDeclined, plainRecord } from "./codex-app-approval.ts";
-import { archivedNativeCodexThread, CODEX_MISSING_CREDENTIALS, codexProviderMismatch, CODEX_SIGN_IN_EXPIRED, codexLimitFacts, codexNotSignedIn, CodexRpcError, codexSignInExpired, codexPlanModelRefused, codexPlanUnsupportedInput, codexSignInRefused, codexUserError, codexUserFailure, missingNativeCodexThread, type CodexRoute } from "./codex-errors.ts";
+import { archivedNativeCodexThread, CODEX_MISSING_CREDENTIALS, CODEX_SIGN_IN_EXPIRED, CodexRpcError, codexLimitFacts, codexNotSignedIn, codexPlanModelRefused, codexPlanUnsupportedInput, codexResumeRebuild, codexSignInExpired, codexSignInRefused, codexUserError, codexUserFailure, type CodexRoute } from "./codex-errors.ts";
import { codexTierOf } from "./codex-tier.ts"; import { codexLoginCheck, keptCodexLogin, readCodexLogin, storedCodexLogin } from "./codex-login.ts";
import { keyRejected, noteKeyAccepted, noteKeyRejected } from "../key-rejections.ts";
- import { classifyResumeFailure, mayReplay, recoveryPromptFor, sessionRebuildNotice } from "../resume-recovery.ts";
- import { extractMcpImages } from "../mcp-tool-images.ts"; import { codexImageInputs, withoutInlineImages } from "./codex-images.ts";
-import { classifyResumeFailure, instructionsOverflowNotice, mayReplay, rebuiltSessionNotice, recoveryPromptFor } from "../resume-recovery.ts";
++import { classifyResumeFailure, instructionsOverflowNotice, mayReplay, rebuiltSessionNotice, recoveryPromptFor, sessionRebuildNotice } from "../resume-recovery.ts";
+ import { extractMcpImages, isOwnScreenTool, ownScreenMounts } from "../mcp-tool-images.ts"; import { codexImageInputs, withoutInlineImages } from "./codex-images.ts";
import { parseProtocolAskQuestions, questionChoices } from "../../shared/ask-question.ts";
import { codexQuestionReply, openAsyncQuestion, type CodexAsk } from "./codex-questions.ts";
import { codexReleaseUpdate, codexUpdateCommand } from "./codex-update.ts";
diff --cc server/drivers/openai-chat.ts
index f018873703,a6af050acb..fcca191563
--- a/server/drivers/openai-chat.ts
+++ b/server/drivers/openai-chat.ts
@@@ -972,22 -978,13 +972,22 @@@ export function createOpenAIChatRuntime
return () => listeners.delete(listener);
},
},
- generateText: async (prompt, { signal, onUsage, model: named, checkModel, maxOutputTokens, finalTextOnly, threadId } = {}) => {
- const model = named ?? options.generateModel?.() ?? options.models().default;
- generateText: async (prompt, { signal, onUsage, model: named, checkModel, fallback } = {}) => {
++ generateText: async (prompt, { signal, onUsage, model: named, checkModel, maxOutputTokens, finalTextOnly, threadId, fallback } = {}) => {
+ const model = named ?? options.generateModel?.() ?? fallback?.model ?? options.models().default;
signal?.throwIfAborted();
checkModel?.(model);
- const { text, reasoning, toolCalls } = await complete([{ role: "user", content: prompt }], model, false, signal, undefined, [], onUsage);
- if (toolCalls.length) throw new ChatProtocolError("provider returned tool calls to a text-only helper");
- return text.trim() ? text : reasoning;
+ const headerContext: RuntimeHeaderContext = { ...(threadId ? { threadId } : {}), providerInstanceId: input.instanceId };
+ const headerSecrets = customHeaderSecrets(options.customHeaders, headerContext);
+ try {
+ const route = finalTextOnly && routes.routeFor(model, true) === "responses" ? "responses" : "chat";
+ const { text, reasoning, toolCalls, responseOutput } = await completeOn(route,
+ [{ role: "user", content: prompt }], model, false, signal, undefined, [], undefined, threadId, { onUsage, maxOutputTokens, headerContext });
+ if (toolCalls.length) throw new ChatProtocolError("provider returned tool calls to a text-only helper");
+ const answer = finalTextOnly && responseOutput ? finalResponseText(responseOutput) : finalTextOnly || text.trim() ? text : reasoning;
+ return maskCustomSecrets(answer, headerSecrets);
+ } catch (error) {
+ throw scrubErrorSecrets(error, headerSecrets);
+ }
},
dispose: async () => {
const turns = [...active.values()];
diff --cc server/index.ts
index 8bc3c3f1ce,a943ea619e..61c9b32f27
--- a/server/index.ts
+++ b/server/index.ts
@@@ -145,7 -145,7 +145,7 @@@ import
type Runtime,
} from "./container-computer.ts";
import { containerComputerMcp } from "./local-vm-box.ts";
- import { attachedFileLine, attachForTurn, saveBotAttachment } from "./bot-attachment.ts"; import { attachNotFound } from "./attach-file-hint.ts"; import { cacheKeepWarmUnavailableReason } from "./claude-endpoints.ts";
-import { attachedFileLine, attachForTurn, readBotFile, saveBotAttachment } from "./bot-attachment.ts"; import { attachNotFound } from "./attach-file-hint.ts";
++import { attachedFileLine, attachForTurn, readBotFile, saveBotAttachment } from "./bot-attachment.ts"; import { attachNotFound } from "./attach-file-hint.ts"; import { cacheKeepWarmUnavailableReason } from "./claude-endpoints.ts";
import {
cacheUntilConfigChanges,
ensureDirs,
diff --cc server/store.ts
index a788966c45,ff405ec06b..f62f3318cd
--- a/server/store.ts
+++ b/server/store.ts
@@@ -118,10 -118,10 +118,10 @@@ const TASK_PATCH_FIELDS =
] as const satisfies readonly (keyof TaskRecord)[];
export type TaskPatch = Partial<Pick<TaskRecord, typeof TASK_PATCH_FIELDS[number]>>;
-export type GroupTaskPatch = Partial<Pick<GroupTaskRecord, "title" | "pinned">> & { turnTimeoutMinutes?: number | null; archivedAt?: number | null; activity?: "waiting-on-you" | null; closed?: { at: number; by: NonNullable<GroupTaskRecord["closedBy"]> } | null };
+export type GroupTaskPatch = Partial<Pick<GroupTaskRecord, "title" | "titleMode" | "pinned">> & { turnTimeoutMinutes?: number | null; archivedAt?: number | null; activity?: "waiting-on-you" | null; closed?: { at: number; by: NonNullable<GroupTaskRecord["closedBy"]> } | null };
- export const ACTIVITY_BUSY: ReadonlySet<BotActivity> = new Set(["working", "waiting-on-you", "no-signal"]);
+ export { ACTIVITY_BUSY };
export type StoreChange =
| { type: "sections" }
diff --cc src/locales/de.json
index b0fa76ac9c,f2891abcf7..314afa9a1c
--- a/src/locales/de.json
+++ b/src/locales/de.json
@@@ -4576,8 -4568,8 +4576,10 @@@
"approval.status.teammateSkills": "Team-Skills geändert",
"approval.applied.skill.teammates": "{name} hat Skills im Team geändert: {title}",
"skills.request.reviewTeammates": "Prüfe jede Änderung, bevor du sie anwendest",
+ "lend.why.off": "Computerfreigabe ist auf {name} ausgeschaltet, daher können seine Bots diesen Computer nicht nutzen. Bitte einen Bot dort, die Computerfreigabe wieder einzuschalten.",
+ "native.lend.sharingOff": "Computerfreigabe ist dort ausgeschaltet, daher können seine Bots diesen Computer nicht nutzen. Bitte einen Bot dort, die Computerfreigabe wieder einzuschalten.",
+ "botIdentity.ai.keyNeeded": "Bilder brauchen einen Bild-API-Schlüssel. KI-Abos wie Antigravity oder Gemini können hier keine Bilder erstellen.",
+ "botIdentity.ai.getGeminiKey": "Gemini-API-Schlüssel holen",
"automations.pauseAll": "Alle pausieren",
"automations.resumeAll": "Alle fortsetzen",
"automations.pausedAll.one": "1 Automatisierung pausiert.",