A desktop coding agent with free access to frontier models.
TypeScript
Integrate GUI task list, model restrictions, permissions, Library and delegation (#46–#51) (#54)
Slendywy855711fdf1e7
diff --git a/apps/app/src/app/lib/provider-catalog.ts b/apps/app/src/app/lib/provider-catalog.tsindex f346c734..5d504956 100644--- a/apps/app/src/app/lib/provider-catalog.ts+++ b/apps/app/src/app/lib/provider-catalog.ts@@ -16,8 +16,14 @@ export function isDirectModelProvider(providerID: string) {return directProviderSet.has(providerID.trim().toLowerCase());}-export function isSupportedModelProvider(providerID: string) {- return isInternalModelProvider(providerID) || isDirectModelProvider(providerID);+// Model pickers list only omnirush.ai (and org-assigned) models, which come+// from the account's catalog. Providers from the user's own engine config+// (their OpenAI, Anthropic, … keys) come back with+// VITE_OMNIRUSH_ALLOW_OTHER_PROVIDERS=1 at build time.+const OTHER_PROVIDERS_ALLOWED = import.meta.env.VITE_OMNIRUSH_ALLOW_OTHER_PROVIDERS === "1";++export function isSupportedModelProvider(providerID: string, allowOtherProviders = OTHER_PROVIDERS_ALLOWED) {+ return isInternalModelProvider(providerID) || (allowOtherProviders && isDirectModelProvider(providerID));}export function providerCatalogRank(providerID: string) {diff --git a/apps/app/src/components/tools/todowrite.tsx b/apps/app/src/components/tools/todowrite.tsxindex 1e900a21..2d5a9f3e 100644--- a/apps/app/src/components/tools/todowrite.tsx+++ b/apps/app/src/components/tools/todowrite.tsx@@ -1,7 +1,9 @@"use client"+import { Circle, CircleCheck, CircleDot, CircleX } from "lucide-react"import { Tool } from "@/components/ui/tool"import type { TodoWriteToolPart } from "@/lib/build-in-tools"+import { cn } from "@/lib/utils"interface TodoWriteToolProps {part: TodoWriteToolPart@@ -23,8 +25,42 @@ function getTodoWriteToolTitle(part: TodoWriteToolPart): string | null {return count > 0 ? `Update todo list (${count})` : "Update todo list"}+const PENDING = { Icon: Circle, label: "To do", className: "text-muted-foreground" }++const TODO_STATUS = new Map([+ ["pending", PENDING],+ ["in_progress", { Icon: CircleDot, label: "In progress", className: "text-blue-11" }],+ ["completed", { Icon: CircleCheck, label: "Done", className: "text-green-11" }],+ ["cancelled", { Icon: CircleX, label: "Cancelled", className: "text-muted-foreground" }],+])+export function TodoWriteTool({ part }: TodoWriteToolProps) {+ // Same partial-input guard as the title: a streamed part may lack todos.+ const listed = part.input?.todos+ const todos = Array.isArray(listed) ? listed : []return (- <Tool toolPart={part} title={getTodoWriteToolTitle(part) ?? undefined} />+ <Tool toolPart={part} title={getTodoWriteToolTitle(part) ?? undefined}>+ {todos.length > 0 ? (+ <ul className="flex flex-col gap-1 pr-8" data-testid="todo-checklist">+ {todos.map((todo, index) => {+ const { Icon, label, className } = TODO_STATUS.get(todo.status) ?? PENDING+ return (+ <li key={`${index}:${todo.content}`} className="flex items-start gap-2" data-status={todo.status}>+ <Icon className={cn("mt-px size-3.5 shrink-0", className)} aria-label={label} />+ <span+ className={cn(+ "min-w-0 wrap-break-word",+ todo.status === "completed" && "text-muted-foreground",+ todo.status === "cancelled" && "text-muted-foreground line-through",+ )}+ >+ {todo.content}+ </span>+ </li>+ )+ })}+ </ul>+ ) : undefined}+ </Tool>)}diff --git a/apps/app/src/components/ui/tool.tsx b/apps/app/src/components/ui/tool.tsxindex ea75c9c4..572dd791 100644--- a/apps/app/src/components/ui/tool.tsx+++ b/apps/app/src/components/ui/tool.tsx@@ -34,7 +34,7 @@ import {SquareCode,Wrench,} from "lucide-react"-import { useCallback, useState } from "react"+import { useCallback, useState, type ReactNode } from "react"import type { DynamicToolUIPart, ToolUIPart } from "ai"function toolIcon(part: ToolPart) {@@ -72,6 +72,8 @@ export type ToolProps = {toolPart: ToolPartdefaultOpen?: booleanclassName?: string+ /** Replaces the raw input/output dump with a tool-specific view. */+ children?: ReactNodeonReconnect?: (action: ChatToolReconnectAction,onProgress: (progress: ChatToolReconnectProgress) => void,@@ -120,7 +122,7 @@ function diffLineClass(line: string) {function DiffLines({ diff }: { diff: string }) {return (- <div className="max-h-60 overflow-auto rounded-md font-mono leading-relaxed">+ <div className="max-h-60 overflow-auto rounded-md pr-8 font-mono leading-relaxed">{displayRuntimeBrand(diff).split("\n").map((line, index) => (<divkey={`${index}:${line}`}@@ -151,6 +153,7 @@ const Tool = ({toolPart,defaultOpen = false,className,+ children,onReconnect,onReopenAuthorization,onRetry,@@ -264,7 +267,7 @@ const Tool = ({<p className="mt-1 text-xs text-destructive" role="alert">{reconnectError}</p>) : null}<CollapsibleContent className="h-(--collapsible-panel-height) overflow-hidden text-sm transition-[height] duration-150 ease-out data-starting-style:h-0 data-ending-style:h-0 [&[hidden]:not([hidden='until-found'])]:hidden">- <div className="bg-muted relative mt-2 flex flex-col gap-2 rounded-lg p-2 pr-10 text-xs">+ <div className="bg-muted relative mt-2 flex flex-col gap-2 rounded-lg p-2 text-xs">{resultText !== null ? (<Buttontype="button"@@ -279,26 +282,30 @@ const Tool = ({{copied ? <Check aria-hidden="true" /> : <Copy aria-hidden="true" />}</Button>) : null}- {hasInput ? (- inputDiff !== null ? (- <DiffLines diff={inputDiff} />- ) : (- <pre className="whitespace-pre-wrap wrap-break-word">- {displayRuntimeBrand(formatValue(input))}- </pre>- )- ) : null}- {hasOutput ? (- isDiffText(toolPart.output) ? (- <DiffLines diff={toolPart.output} />- ) : (- <pre className="max-h-60 overflow-auto whitespace-pre-wrap wrap-break-word opacity-80">- {displayRuntimeBrand(formatValue(toolPart.output))}- </pre>- )- ) : null}+ {children ?? (+ <>+ {hasInput ? (+ inputDiff !== null ? (+ <DiffLines diff={inputDiff} />+ ) : (+ <pre className="pr-8 whitespace-pre-wrap wrap-break-word">+ {displayRuntimeBrand(formatValue(input))}+ </pre>+ )+ ) : null}+ {hasOutput ? (+ isDiffText(toolPart.output) ? (+ <DiffLines diff={toolPart.output} />+ ) : (+ <pre className="max-h-60 overflow-auto pr-8 whitespace-pre-wrap wrap-break-word opacity-80">+ {displayRuntimeBrand(formatValue(toolPart.output))}+ </pre>+ )+ ) : null}+ </>+ )}{isError && toolPart.errorText ? (- <pre className="text-destructive max-h-60 overflow-auto whitespace-pre-wrap wrap-break-word">+ <pre className="text-destructive max-h-60 overflow-auto pr-8 whitespace-pre-wrap wrap-break-word">{displayRuntimeBrand(toolPart.errorText)}</pre>) : null}diff --git a/apps/app/src/react-app/design-system/extension-detail-modal.tsx b/apps/app/src/react-app/design-system/extension-detail-modal.tsxindex 7f37d662..42431e0b 100644--- a/apps/app/src/react-app/design-system/extension-detail-modal.tsx+++ b/apps/app/src/react-app/design-system/extension-detail-modal.tsx@@ -1,4 +1,5 @@/** @jsxImportSource react */+import { useLayoutEffect, useRef } from "react";import { CheckCircle2, ChevronLeft, ChevronRight, ExternalLink, Loader2 } from "lucide-react";import {Card,@@ -250,6 +251,18 @@ export function ExtensionDetailModal({}: ExtensionDetailModalProps) {"use memo";const resolvedIconSrc = resolveExtensionIconUrl({ iconSrc, iconSlug, serviceUrl: url });+ // As a page the detail replaces the Library list inside the same scroll+ // container, which kept the list's scroll offset: start at the top.+ const pageRef = useRef<HTMLDivElement>(null);+ useLayoutEffect(() => {+ if (!open || presentation !== "page") return;+ for (let node = pageRef.current?.parentElement; node; node = node.parentElement) {+ if (/(auto|scroll)/.test(getComputedStyle(node).overflowY)) {+ node.scrollTop = 0;+ return;+ }+ }+ }, [open, presentation, name]);if (!open) return null;@@ -703,7 +716,7 @@ export function ExtensionDetailModal({if (presentation === "page") {return (- <div className="flex w-full max-w-3xl flex-col gap-6 animate-in fade-in duration-300">+ <div ref={pageRef} className="flex w-full max-w-3xl flex-col gap-6 animate-in fade-in duration-300"><Buttonvariant="ghost"size="sm"diff --git a/apps/app/src/react-app/domains/session/surface/composer/full-permissions-toggle.tsx b/apps/app/src/react-app/domains/session/surface/composer/full-permissions-toggle.tsxindex 6859b35c..1acfc8da 100644--- a/apps/app/src/react-app/domains/session/surface/composer/full-permissions-toggle.tsx+++ b/apps/app/src/react-app/domains/session/surface/composer/full-permissions-toggle.tsx@@ -1,5 +1,5 @@/** @jsxImportSource react */-import { LoaderCircle, ShieldCheck } from "lucide-react";+import { LoaderCircle, ShieldAlert, ShieldCheck } from "lucide-react";import { toast } from "@/components/ui/sonner";import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";@@ -75,16 +75,17 @@ function FullPermissionsSwitch(props: { client: ApprovalsClient; workspaceId: stonClick={() => void toggle()}// Same height, radius, padding and text size as the model selector// trigger. Kept focusable while disabled (aria-disabled, not- // disabled) so the tooltip can explain why.+ // disabled) so the tooltip can explain why. On reads as a warning+ // (orange, alert shield): nothing asks for approval.className={`flex h-9 max-h-9 shrink-0 items-center gap-1.5 rounded-md px-2.5 text-sm transition-colors aria-disabled:cursor-not-allowed aria-disabled:opacity-60 ${full- ? "bg-[var(--dls-accent)] text-[var(--dls-accent-fg)] hover:bg-[var(--dls-accent-hover)] aria-disabled:hover:bg-[var(--dls-accent)]"+ ? "text-orange-11 hover:bg-orange-3 aria-disabled:hover:bg-transparent": "text-gray-10 hover:bg-gray-3 hover:text-gray-12 aria-disabled:hover:bg-transparent aria-disabled:hover:text-gray-10"}`}/>}>- {busy ? <LoaderCircle className="size-4 animate-spin" /> : <ShieldCheck className="size-4" />}+ {busy ? <LoaderCircle className="size-4 animate-spin" /> : full ? <ShieldAlert className="size-4" /> : <ShieldCheck className="size-4" />}<span className="whitespace-nowrap">Full permissions</span></TooltipTrigger><TooltipContent>{hint}</TooltipContent>diff --git a/apps/app/src/react-app/kernel/model-config.ts b/apps/app/src/react-app/kernel/model-config.tsindex 008421ef..3c985a84 100644--- a/apps/app/src/react-app/kernel/model-config.ts+++ b/apps/app/src/react-app/kernel/model-config.ts@@ -160,11 +160,16 @@ export function readStoredDefaultModel(): ModelRef {// Keep external provider choices and every omnirush.ai catalog model// (the catalog is the server's, not a list compiled in here), but migrate// retired routes to the default model.- if (parsed?.providerID === "omnirush" && !isOmniRushModelID(parsed.modelID)) {+ // A default on a provider the pickers no longer list (another provider,+ // hidden unless VITE_OMNIRUSH_ALLOW_OTHER_PROVIDERS=1) migrates the same way.+ if (+ (parsed?.providerID === "omnirush" && !isOmniRushModelID(parsed.modelID))+ || (parsed && !isSupportedModelProvider(parsed.providerID))+ ) {writeStoredDefaultModel(DEFAULT_MODEL);return DEFAULT_MODEL;}- return parsed && isSupportedModelProvider(parsed.providerID) ? parsed : DEFAULT_MODEL;+ return parsed ?? DEFAULT_MODEL;} catch {return DEFAULT_MODEL;}diff --git a/apps/app/src/react-app/shell/settings-route.tsx b/apps/app/src/react-app/shell/settings-route.tsxindex dec2a377..daa0e801 100644--- a/apps/app/src/react-app/shell/settings-route.tsx+++ b/apps/app/src/react-app/shell/settings-route.tsx@@ -1836,8 +1836,8 @@ function SettingsRouteContent(props: SettingsSurfaceProps = {}) {? `${local.prefs.defaultModel.providerID}/${local.prefs.defaultModel.modelID}`: t("settings.default_label");const defaultModelVariantLabel = local.prefs.modelVariant ?? t("settings.default_label");- const visibleProviderConnectedIds = providerConnectedIds.filter(- isSupportedModelProvider,+ const visibleProviderConnectedIds = providerConnectedIds.filter((id) =>+ isSupportedModelProvider(id),);const providerStatusLabel = visibleProviderConnectedIds.length > 0 ? t("status.connected") : t("status.disconnected_label");const providerStatusStyle = visibleProviderConnectedIds.length > 0@@ -1850,8 +1850,11 @@ function SettingsRouteContent(props: SettingsSurfaceProps = {}) {const disabledProviderIdSet = new Set(disabledProviders.map((id) => id.trim().toLowerCase()).filter(Boolean),);+ // Same list as the pickers: providers from the user's own engine config+ // (source "config") are not omnirush.ai's to show or disconnect here.const connectedProviders = providers.flatMap((provider) =>providerConnectedIdSet.has(provider.id) &&+ isSupportedModelProvider(provider.id) &&!disabledProviderIdSet.has(provider.id.trim().toLowerCase())? [{id: provider.id,diff --git a/apps/app/tests/full-permissions-toggle.test.tsx b/apps/app/tests/full-permissions-toggle.test.tsxindex 5fc5988e..c348d91b 100644--- a/apps/app/tests/full-permissions-toggle.test.tsx+++ b/apps/app/tests/full-permissions-toggle.test.tsx@@ -126,14 +126,16 @@ test("shows the current mode on load and reads as active while full permissionsexpect(off.textContent).toContain("Full permissions");expect(off.dataset.state).toBe("off");expect(off.dataset.lockReason).toBeUndefined();- expect(off.className).not.toContain("--dls-accent");+ expect(off.className).not.toContain("text-orange-11");const full = fakeClient("http://full.test", { mode: "full", source: "settings", setting: "full" });const active = await mount(<FullPermissionsToggle client={full.client} workspaceId="ws_1" />);await waitFor(() => toggleIn(active).getAttribute("aria-checked") === "true", "the full mode to load");expect(toggleIn(active).dataset.state).toBe("on");expect(toggleIn(active).getAttribute("aria-disabled")).toBeNull();- expect(toggleIn(active).className).toContain("bg-[var(--dls-accent)]");+ // On reads as a warning: orange, no accent fill.+ expect(toggleIn(active).className).toContain("text-orange-11");+ expect(toggleIn(active).className).not.toContain("--dls-accent");// Nothing renders without a server client.const none = await mount(<FullPermissionsToggle client={null} workspaceId="ws_1" />);diff --git a/apps/app/tests/model-behavior.test.ts b/apps/app/tests/model-behavior.test.tsindex 795eebcc..893f9aff 100644--- a/apps/app/tests/model-behavior.test.ts+++ b/apps/app/tests/model-behavior.test.ts@@ -211,15 +211,19 @@ describe("model behavior options", () => {]);});- test("allows only internal and mainstream model providers", () => {+ test("lists omnirush.ai models only, mainstream providers only behind the flag", () => {expect(isInternalModelProvider("omnirush")).toBe(true);expect(isInternalModelProvider("lpr_team")).toBe(true);expect(isDirectModelProvider("openai")).toBe(true);expect(isDirectModelProvider("anthropic")).toBe(true);- expect(isSupportedModelProvider("google")).toBe(true);- expect(isSupportedModelProvider("openrouter")).toBe(true);- expect(isSupportedModelProvider("opencode")).toBe(false);- expect(isSupportedModelProvider("ollama")).toBe(false);+ expect(isSupportedModelProvider("omnirush")).toBe(true);+ expect(isSupportedModelProvider("lpr_team")).toBe(true);+ expect(isSupportedModelProvider("anthropic")).toBe(false);+ expect(isSupportedModelProvider("google")).toBe(false);+ expect(isSupportedModelProvider("google", true)).toBe(true);+ expect(isSupportedModelProvider("openrouter", true)).toBe(true);+ expect(isSupportedModelProvider("opencode", true)).toBe(false);+ expect(isSupportedModelProvider("ollama", true)).toBe(false);expect(providerCatalogRank("omnirush")).toBeLessThan(providerCatalogRank("openai"));});diff --git a/apps/server/src/engine2/restraint-notes.e2e.test.ts b/apps/server/src/engine2/restraint-notes.e2e.test.tsindex ad4e42a8..ebf12652 100644--- a/apps/server/src/engine2/restraint-notes.e2e.test.ts+++ b/apps/server/src/engine2/restraint-notes.e2e.test.ts@@ -152,7 +152,8 @@ describeMaybe("delegation rules on the 2.x engine (mock provider)", () => {const main = await waitFor(() => seen.find((body) => !isChild(body)), "the main session's request");const mainSystem = systemOf(main);- expect(mainSystem).toContain("Do simple work yourself: a question a few tool calls can answer needs no sub-agent.");+ expect(mainSystem).toContain("For any task that takes more than a few tool calls");+ expect(mainSystem).toContain("start 2-4 sub-agents in one message so they run in parallel");expect(mainSystem).toContain("make exactly that many subagent calls, no more and no fewer, and start them all in one message");expect(mainSystem).toContain("Tell a sub-agent to start its own sub-agents only when the user explicitly asked for nested sub-agents.");expect(mainSystem).not.toContain(SUB_NOTE_MARK);diff --git a/apps/server/src/omnirush-agent-prompt.ts b/apps/server/src/omnirush-agent-prompt.tsindex 064cd61c..be153ed3 100644--- a/apps/server/src/omnirush-agent-prompt.ts+++ b/apps/server/src/omnirush-agent-prompt.ts@@ -38,7 +38,7 @@ Hard rule: never copy private memory into repo files. Store only redacted summar- If required setup or credentials are missing, ask one targeted question and continue once provided.- If you change code, run the smallest meaningful test.- Write long files in chunks: create a file with its first section, then append the rest in a few smaller edit (or patch) calls instead of one very large write. A single multi-thousand-token patch is the write most likely to be cut off in transit; if a write is interrupted, re-issue only the missing part.-- Do simple work yourself: a question a few tool calls can answer needs no sub-agent. Use the subagent tool only when the user asks for sub-agents or the work clearly splits into independent parts that each take real effort.+- Delegate real work to sub-agents. For any task that takes more than a few tool calls (a feature, a bug fix, a refactor, an investigation, a review, tests or docs), split it into independent parts and start 2-4 sub-agents in one message so they run in parallel: for example one maps the relevant code and reports what matters, one makes a change, one writes or runs the tests, one reviews the result. You plan, coordinate, check their work and write the final answer. Only a quick question that a few tool calls answer needs no sub-agent.- When the user asks for a specific number of agents, make exactly that many subagent calls, no more and no fewer, and start them all in one message so they run in parallel. Use the general subagent unless a more specialized subagent is clearly better. Never replace an explicit delegation request with a simulated multi-role answer, and never claim subagents are unavailable while the subagent tool is present.- Write each sub-agent's prompt yourself: self-contained, limited to that sub-agent's part, saying what to return. Never paste the user's whole message, or the user's instructions about sub-agents, into a sub-agent's prompt: the sub-agent would follow them again. Tell a sub-agent to start its own sub-agents only when the user explicitly asked for nested sub-agents.- Wait for every delegated task, then synthesize their actual results before answering; keep delegated activity visible in the session.diff --git a/apps/server/src/omnirush-runtime-config.test.ts b/apps/server/src/omnirush-runtime-config.test.tsindex 33ba356a..273bb618 100644--- a/apps/server/src/omnirush-runtime-config.test.ts+++ b/apps/server/src/omnirush-runtime-config.test.ts@@ -188,6 +188,21 @@ describe("omnirush runtime config file", () => {expect(JSON.stringify(parsed)).not.toContain("access-token");});+ test("signed in, only omnirush.ai models are enabled unless other providers are allowed", () => {+ const gateway = { baseUrl: "http://127.0.0.1:8090/omnirush/v1" };++ expect(buildOmniRushRuntimeConfigObjectFromSnapshot({}, gateway, {}).enabled_providers).toEqual(["omnirush"]);+ expect(buildOmniRushRuntimeConfigObjectFromSnapshot({}, gateway, { OMNIRUSH_ALLOW_OTHER_PROVIDERS: "1" }).enabled_providers)+ .toBeUndefined();+ expect(buildOmniRushRuntimeConfigObjectFromSnapshot({ managedPolicy: { allowCustomProviders: true } }, gateway, {}).enabled_providers)+ .toBeUndefined();+ // An org policy that forbids custom providers keeps its own list (Zen included by default).+ expect(buildOmniRushRuntimeConfigObjectFromSnapshot({ managedPolicy: { allowCustomProviders: false } }, gateway, {}).enabled_providers)+ .toEqual(["omnirush", "opencode"]);+ // Signed out there is no omnirush.ai provider; prompts are refused by the sign-in gate.+ expect(buildOmniRushRuntimeConfigObjectFromSnapshot({}, undefined, {}).enabled_providers).toBeUndefined();+ });+test("exposes every omnirush.ai model with the shared effort levels, default first", () => {const parsed = buildOmniRushRuntimeConfigObjectFromSnapshot({}, {baseUrl: "http://127.0.0.1:8090/omnirush/v1",@@ -324,7 +339,8 @@ describe("omnirush runtime config file", () => {expect(prompt).toContain("## Memory\n");expect(prompt).toContain("## OmniRush.ai Artifacts");expect(prompt).toContain("## Connected work");- expect(prompt).toContain("Do simple work yourself: a question a few tool calls can answer needs no sub-agent.");+ expect(prompt).toContain("Delegate real work to sub-agents. For any task that takes more than a few tool calls");+ expect(prompt).toContain("Only a quick question that a few tool calls answer needs no sub-agent.");expect(prompt).toContain("make exactly that many subagent calls, no more and no fewer, and start them all in one message");expect(prompt).toContain("Never paste the user's whole message, or the user's instructions about sub-agents, into a sub-agent's prompt");expect(prompt).toContain("Never replace an explicit delegation request with a simulated multi-role answer");diff --git a/apps/server/src/omnirush-runtime-config.ts b/apps/server/src/omnirush-runtime-config.tsindex 3187ff11..3f87a4d0 100644--- a/apps/server/src/omnirush-runtime-config.ts+++ b/apps/server/src/omnirush-runtime-config.ts@@ -171,15 +171,24 @@ export function buildOmniRushRuntimeConfigObjectFromSnapshot(? { [INTERNAL_PROVIDER_ID]: internalGatewayProvider(internalGateway, catalog) }: {}),};+ const ownProviders = Object.keys(provider).filter((id) => /^(?:lpr_|omnirush$)/i.test(id));+ // Signed in, the model picker lists only omnirush.ai (and org-assigned)+ // models: the engine would otherwise also load providers from the user's+ // own opencode config, whose models bypass the gateway and whose errors+ // name upstream relays. OMNIRUSH_ALLOW_OTHER_PROVIDERS=1 or an org policy+ // with allowCustomProviders: true lets them back in.+ const onlyOwnProviders = ownProviders.length > 0+ && env.OMNIRUSH_ALLOW_OTHER_PROVIDERS !== "1"+ && runtimeConfig.managedPolicy?.allowCustomProviders !== true;return {...engineConfig,...(internalGateway? { model: `${INTERNAL_PROVIDER_ID}/${omnirushDefaultModelId(catalog)}` }: {}),...(runtimeConfig.managedPolicy?.allowCustomProviders === false ? { enabled_providers: [- ...Object.keys(provider).filter((id) => /^(?:lpr_|omnirush$)/i.test(id)),+ ...ownProviders,...(runtimeConfig.managedPolicy.allowZenModel !== false ? ["opencode"] : []),- ] } : {}),+ ] } : onlyOwnProviders ? { enabled_providers: ownProviders } : {}),permission: { ...engineConfig.permission, ...permissions },// omnirush.ai's own on-demand skills (the swarm procedure)....(skillsDir ? { skills: { paths: [skillsDir] } } : {}),diff --git a/apps/server/src/omnirush-swarm.ts b/apps/server/src/omnirush-swarm.tsindex 17c4b601..5cd6b1e9 100644--- a/apps/server/src/omnirush-swarm.ts+++ b/apps/server/src/omnirush-swarm.ts@@ -177,7 +177,7 @@ export function omnirushSwarmSubagentNote(depth: number): string {* (every agent that has the tool, main or sub-agent). The engine's own text* asks for detailed prompts and parallel launches; this bounds both.*/-export const OMNIRUSH_TASK_TOOL_NOTE = "omnirush.ai: do simple work yourself; start sub-agents only when the user asks for them or the work clearly splits into independent parts. When the user names a number of agents, start exactly that many, all in one message. Each prompt covers only that agent's part and is self-contained: never paste the user's whole message or the user's instructions about sub-agents into it. A sub-agent starts its own sub-agents only when its task explicitly tells it to.";+export const OMNIRUSH_TASK_TOOL_NOTE = "omnirush.ai: in the main session, for any task beyond a few tool calls, split it into independent parts and start 2-4 sub-agents in one message so they run in parallel; answer only a quick question yourself. When the user names a number of agents, start exactly that many, all in one message. Each prompt covers only that agent's part and is self-contained: never paste the user's whole message or the user's instructions about sub-agents into it. A sub-agent starts its own sub-agents only when its task explicitly tells it to.";export const OMNIRUSH_SWARM_STATUSES = ["todo", "running", "done", "blocked"] as const;export type SwarmTaskStatus = (typeof OMNIRUSH_SWARM_STATUSES)[number];diff --git a/apps/server/src/opencode-plugins/omnirush-swarm.test.ts b/apps/server/src/opencode-plugins/omnirush-swarm.test.tsindex 73ff1dfb..1d4db8fc 100644--- a/apps/server/src/opencode-plugins/omnirush-swarm.test.ts+++ b/apps/server/src/opencode-plugins/omnirush-swarm.test.ts@@ -154,6 +154,8 @@ describe("omnirush swarm plugin", () => {await hooks["tool.definition"]({ toolID: "task" }, task);expect(task.description).toBe(`Launch a new agent.\n\n${OMNIRUSH_TASK_TOOL_NOTE}`);expect(OMNIRUSH_TASK_TOOL_NOTE).toContain("start exactly that many, all in one message");+ expect(OMNIRUSH_TASK_TOOL_NOTE).toContain("in the main session, for any task beyond a few tool calls");+ expect(OMNIRUSH_TASK_TOOL_NOTE).toContain("A sub-agent starts its own sub-agents only when its task explicitly tells it to.");expect(OMNIRUSH_TASK_TOOL_NOTE).toContain("never paste the user's whole message");// Sub-agents see this tool text too: it must not invite them to split their task.expect(OMNIRUSH_TASK_TOOL_NOTE).toMatch(/A sub-agent starts its own sub-agents only when its task explicitly tells it to\.$/);