A desktop coding agent with free access to frontier models.
TypeScript
fix: default sub-agents to gpt-5.6-sol
Task Builderf1a344646b7d
diff --git a/apps/app/src/react-app/domains/settings/subagent-model.ts b/apps/app/src/react-app/domains/settings/subagent-model.tsindex 6a24038d..5c39f6f2 100644--- a/apps/app/src/react-app/domains/settings/subagent-model.ts+++ b/apps/app/src/react-app/domains/settings/subagent-model.ts@@ -25,7 +25,7 @@ export const SUBAGENT_MODEL_HELP =export const SUBAGENT_EFFORT_HELP ="How hard sub-agents think. \"Same as main agent\" uses the main agent's effort, mapped to the nearest level the sub-agent model offers.";-export const DEFAULT_SUBAGENT_SETTING: OmniRushSubagentModelSetting = { model: null, effort: null };+export const DEFAULT_SUBAGENT_SETTING: OmniRushSubagentModelSetting = { model: "gpt-5.6-sol", effort: null };export function subagentModelQueryKey(client: SubagentModelClient | null): readonly unknown[] {return ["omnirush-subagent-model", client?.baseUrl?.trim() || "default"];diff --git a/apps/app/tests/subagent-model-setting.test.ts b/apps/app/tests/subagent-model-setting.test.tsindex 83199772..7334b2fc 100644--- a/apps/app/tests/subagent-model-setting.test.ts+++ b/apps/app/tests/subagent-model-setting.test.ts@@ -6,6 +6,7 @@ import {nextSubagentSetting,subagentEffortOptions,subagentModelUnavailable,+ DEFAULT_SUBAGENT_SETTING,subagentSummary,} from "../src/react-app/domains/settings/subagent-model";import { BUILTIN_OMNIRUSH_MODEL_IDS } from "../src/app/constants";@@ -24,6 +25,9 @@ const state: OmniRushSubagentModelState = {};describe("sub-agent model setting (app)", () => {+ test("defaults new sessions to GPT-5.6 Sol", () => {+ expect(DEFAULT_SUBAGENT_SETTING).toEqual({ model: "gpt-5.6-sol", effort: null });+ });test("GPT 6 Sol is built in between Astra and GPT-5.6 Sol, with its display name", () => {expect([...BUILTIN_OMNIRUSH_MODEL_IDS]).toEqual(["gpt-6-astra", "gpt-6-sol", "gpt-5.6-sol"]);expect(resolveModelDisplayName("gpt-6-sol")).toBe("GPT 6 Sol");diff --git a/apps/server/src/engine2/restraint-notes.e2e.test.ts b/apps/server/src/engine2/restraint-notes.e2e.test.tsindex ebf12652..c0b65b1a 100644--- a/apps/server/src/engine2/restraint-notes.e2e.test.ts+++ b/apps/server/src/engine2/restraint-notes.e2e.test.ts@@ -152,8 +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("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("For a feature, bug fix, refactor or other code change that takes more than a few tool calls");+ expect(mainSystem).toContain("split the implementation into independent parts and 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 be153ed3..183868a8 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.-- 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.+- Delegate implementation work to sub-agents. For a feature, bug fix, refactor or other code change that takes more than a few tool calls, split the implementation into independent parts and start 2-4 sub-agents in one message so they run in parallel. Do investigations, reviews, tests, docs, explanations and quick questions yourself unless the user explicitly asks for sub-agents. You plan, coordinate, check their work and write the final answer.- 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-subagent-model.routes.test.ts b/apps/server/src/omnirush-subagent-model.routes.test.tsindex 9150c1c0..7b1299e9 100644--- a/apps/server/src/omnirush-subagent-model.routes.test.ts+++ b/apps/server/src/omnirush-subagent-model.routes.test.ts@@ -66,15 +66,19 @@ describe("sub-agent model routes", () => {const main = { providerID: "omnirush", modelID: "gpt-6-astra", variant: "max" };const initial = await read();- expect(initial.setting).toEqual({ model: null, effort: null });+ expect(initial.setting).toEqual({ model: "gpt-5.6-sol", effort: null });expect(initial.signedIn).toBe(true);expect((initial.models as Array<{ id: string; name: string; efforts: string[] }>).map((model) => [model.id, model.name, model.efforts.join(",")])).toEqual([["gpt-6-astra", "GPT 6 Astra", "low,high,xhigh,max"],["gpt-6-sol", "GPT 6 Sol", "low,high,xhigh,max"],["gpt-5.6-sol", "GPT-5.6 Sol", "low,high,xhigh,max"],]);- // Untouched: sub-agent prompts stay as the engine made them.- expect(await resolve({ sessionId: "ses_child", rootSessionId: "ses_main", inherited: main, main })).toEqual({});+ // A missing preference defaults to GPT-5.6 Sol while preserving the main effort.+ expect(await resolve({ sessionId: "ses_child", rootSessionId: "ses_main", inherited: main, main })).toEqual({+ model: { providerID: "omnirush", modelID: "gpt-5.6-sol" },+ variant: "max",+ gatewayFallback: { model: "gpt-6-astra", effort: "max" },+ });const bad = await fetch(`${base}/omnirush/subagent-model`, { method: "PUT", headers: client, body: JSON.stringify({ model: "gpt-6-sol", effort: "turbo" }) });expect(bad.status).toBe(400);diff --git a/apps/server/src/omnirush-subagent-model.test.ts b/apps/server/src/omnirush-subagent-model.test.tsindex 0001274c..fe3cabd2 100644--- a/apps/server/src/omnirush-subagent-model.test.ts+++ b/apps/server/src/omnirush-subagent-model.test.ts@@ -32,13 +32,13 @@ async function config(): Promise<ServerConfig> {}describe("sub-agent model setting", () => {- test("untouched reads as same-as-main; unusable values read as unset", async () => {+ test("missing settings default to GPT-5.6 Sol; explicit values remain safe", async () => {const cfg = await config();- expect(await readSubagentModelSetting(cfg)).toEqual({ model: null, effort: null });+ expect(await readSubagentModelSetting(cfg)).toEqual({ model: "gpt-5.6-sol", effort: null });expect(sanitizeSubagentModelSetting({ model: "gpt-6-sol", effort: "HIGH" })).toEqual({ model: "gpt-6-sol", effort: "high" });expect(sanitizeSubagentModelSetting({ model: "../etc", effort: "turbo" })).toEqual({ model: null, effort: null });expect(sanitizeSubagentModelSetting({ model: "", effort: "ultra" })).toEqual({ model: null, effort: "max" });- expect(sanitizeSubagentModelSetting("nope")).toEqual({ model: null, effort: null });+ expect(sanitizeSubagentModelSetting("nope")).toEqual({ model: "gpt-5.6-sol", effort: null });});test("persists atomically and survives a corrupt file", async () => {@@ -46,7 +46,7 @@ describe("sub-agent model setting", () => {await writeSubagentModelSetting(cfg, { model: "meta-muse-spark", effort: "medium" });expect(await readSubagentModelSetting(cfg)).toEqual({ model: "meta-muse-spark", effort: "medium" });await writeFile(subagentModelSettingPath(cfg), "{not json", "utf8");- expect(await readSubagentModelSetting(cfg)).toEqual({ model: null, effort: null });+ expect(await readSubagentModelSetting(cfg)).toEqual({ model: "gpt-5.6-sol", effort: null });});});diff --git a/apps/server/src/omnirush-subagent-model.ts b/apps/server/src/omnirush-subagent-model.tsindex 4d22b7b7..6b452892 100644--- a/apps/server/src/omnirush-subagent-model.ts+++ b/apps/server/src/omnirush-subagent-model.ts@@ -4,9 +4,9 @@* to the main agent's model when that model cannot serve them.** The setting is kept at <runtimeStorageDir>/omnirush-subagent-model.json.- * Untouched (both fields null, or no file) nothing changes: sub-agents keep- * the engine's own inheritance of the main agent's model and effort, exactly- * as before the picker existed.+ * An explicit "same as main" setting (both fields null) keeps the engine's+ * inheritance. A missing setting uses GPT-5.6 Sol with the main agent's+ * inherited effort; users can still select another model in Preferences.** Who does what:* - The app reads and writes the setting (GET/PUT /omnirush/subagent-model).@@ -56,7 +56,7 @@ export type SubagentModelSetting = {effort: OmniRushModelEffort | null;};-export const DEFAULT_SUBAGENT_MODEL_SETTING: SubagentModelSetting = Object.freeze({ model: null, effort: null });+export const DEFAULT_SUBAGENT_MODEL_SETTING: SubagentModelSetting = Object.freeze({ model: "gpt-5.6-sol", effort: null });export type EngineModelRef = { providerID: string; modelID: string };@@ -98,7 +98,7 @@ export function parseSubagentEffort(value: unknown): OmniRushModelEffort | nullreturn (OMNIRUSH_MODEL_EFFORTS as readonly string[]).includes(normalized) ? normalized as OmniRushModelEffort : null;}-/** A stored or submitted setting; anything unusable reads as "same as main". */+/** A stored or submitted setting; a missing setting is handled by the GPT-5.6 Sol default. */export function sanitizeSubagentModelSetting(raw: unknown): SubagentModelSetting {if (!isRecord(raw)) return { ...DEFAULT_SUBAGENT_MODEL_SETTING };const model = typeof raw.model === "string" && MODEL_ID.test(raw.model.trim()) ? raw.model.trim() : null;diff --git a/apps/server/src/omnirush-swarm.ts b/apps/server/src/omnirush-swarm.tsindex 5cd6b1e9..2c1dda31 100644--- a/apps/server/src/omnirush-swarm.ts+++ b/apps/server/src/omnirush-swarm.ts@@ -102,7 +102,7 @@ export const OMNIRUSH_SWARM_TOOL_NAME = "swarm_board";/** The on-demand skill that carries the swarm procedure. */export const OMNIRUSH_SWARM_SKILL_NAME = "omnirush-swarm";-export const OMNIRUSH_SWARM_SKILL_DESCRIPTION = `Required before starting ${OMNIRUSH_SWARM_MIN_AGENTS} or more sub-agents for one request (a swarm, or the user asks for ${OMNIRUSH_SWARM_MIN_AGENTS}+ agents): the shared-board procedure. Never for 1-2 sub-agents or a small request.`;+export const OMNIRUSH_SWARM_SKILL_DESCRIPTION = `Required before starting ${OMNIRUSH_SWARM_MIN_AGENTS} or more sub-agents for implementation work (a swarm, or the user asks for a swarm or for ${OMNIRUSH_SWARM_MIN_AGENTS}+ agents): the shared-board procedure. Never for 1-2 sub-agents or a small request.`;/*** The main agent's always-on swarm text (part of OMNIRUSH_AGENT_PROMPT). The@@ -110,12 +110,12 @@ export const OMNIRUSH_SWARM_SKILL_DESCRIPTION = `Required before starting ${OMNI*/export const OMNIRUSH_SWARM_PROMPT = `## Sub-agent swarms-Before you start ${OMNIRUSH_SWARM_MIN_AGENTS} or more sub-agents for one request (large work that splits into ${OMNIRUSH_SWARM_MIN_AGENTS}+ independent parts, or the user asks for a swarm or for ${OMNIRUSH_SWARM_MIN_AGENTS}+ agents), load the \`${OMNIRUSH_SWARM_SKILL_NAME}\` skill first and follow it. Otherwise do simple work yourself, or use the 1-2 sub-agents the work needs with the subagent tool and no board or coordination file.`;+Before you start ${OMNIRUSH_SWARM_MIN_AGENTS} or more sub-agents for implementation work (large work that splits into ${OMNIRUSH_SWARM_MIN_AGENTS}+ independent parts, or the user asks for a swarm or for ${OMNIRUSH_SWARM_MIN_AGENTS}+ agents), load the \`${OMNIRUSH_SWARM_SKILL_NAME}\` skill first and follow it. Handle questions, investigations, reviews, tests, docs and explanations yourself unless the user explicitly asks for sub-agents. For smaller implementation work, use 1-2 sub-agents directly when they help.`;/** The body of the omnirush-swarm skill (without frontmatter). */export const OMNIRUSH_SWARM_SKILL = `# Sub-agent swarm-Use this only for a real swarm: ${OMNIRUSH_SWARM_MIN_AGENTS} or more sub-agents working in parallel, or the user asked for a swarm or for ${OMNIRUSH_SWARM_MIN_AGENTS}+ agents. For 1-2 sub-agents, stop here: call the subagent tool directly and do not create or touch a board.+Use this only for a real implementation swarm: ${OMNIRUSH_SWARM_MIN_AGENTS} or more sub-agents working in parallel, or the user asked for a swarm or for ${OMNIRUSH_SWARM_MIN_AGENTS}+ agents. For 1-2 sub-agents, stop here: call the subagent tool directly and do not create or touch a board.The board is \`${OMNIRUSH_SWARM_FILE}\` in the workspace, never a file in the project root. It is a short status board, not a report: every agent re-reads it, so keep it small. omnirush.ai keeps it out of git and clears it when your turn ends. Ignore any \`swarm.md\` in the project root: it is not this swarm's board.@@ -149,7 +149,7 @@ export function omnirushSubagentNote(depth: number): string {`You are a sub-agent (layer ${depth} of at most ${OMNIRUSH_SUBAGENT_DEPTH}). Do your task yourself.`,"Instructions about sub-agents that the user wrote (how many agents to use, what to delegate) were meant for the main session, which already carried them out: do not repeat them.",depth < OMNIRUSH_SUBAGENT_DEPTH- ? "Start sub-agents with the subagent tool only if your task explicitly tells you to; otherwise do the whole task yourself, even when it is long. Never re-delegate your whole task."+ ? "Start sub-agents with the subagent tool only if your task explicitly tells you to implement a part; otherwise do the whole task yourself, even when it is long. Never re-delegate your whole task.": "You cannot delegate further: do the work yourself.",].join("\n");}@@ -167,7 +167,7 @@ export function omnirushSwarmSubagentNote(depth: number): string {`You are part of a swarm coordinated through the board \`${OMNIRUSH_SWARM_FILE}\`.`,`Do not read, search or edit the board file: use the \`${OMNIRUSH_SWARM_TOOL_NAME}\` tool with your task id (from your prompt); it answers with your rows and the Decisions. Call it once when you start (status running) and once when you finish (status done, a one-line result, at most ${OMNIRUSH_SWARM_FINDINGS_PER_TASK} one-line findings other agents need). Put details in your final report, not on the board. Do not move or archive the board: omnirush.ai does that.`,...(canDelegate- ? [`If you do delegate part of your task, add sub-task rows (for example T1.1, T1.2) with \`${OMNIRUSH_SWARM_TOOL_NAME}\` first and give each sub-agent the same board instructions.`]+ ? [`If you implement a delegated part of your task, add sub-task rows (for example T1.1, T1.2) with \`${OMNIRUSH_SWARM_TOOL_NAME}\` first and give each sub-agent the same board instructions.`]: []),].join("\n");}@@ -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: 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_TASK_TOOL_NOTE = "omnirush.ai: in the main session, delegate only implementation work. For a feature, bug fix, refactor or other code change beyond a few tool calls, split the implementation into independent parts and start 2-4 sub-agents in one message so they run in parallel. Do investigations, reviews, tests, docs, explanations and quick questions yourself unless the user explicitly asks for sub-agents. When the user names a number of agents, start exactly that many, all in one message. Each prompt covers only its own 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 implement a part.";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 1d4db8fc..e8407e52 100644--- a/apps/server/src/opencode-plugins/omnirush-swarm.test.ts+++ b/apps/server/src/opencode-plugins/omnirush-swarm.test.ts@@ -105,7 +105,7 @@ describe("omnirush swarm plugin", () => {expect(child).toContain("layer 1 of at most 3");expect(child).toContain("Do not read, search or edit the board file");expect(child).toContain(`use the \`${OMNIRUSH_SWARM_TOOL_NAME}\` tool`);- expect(child).toContain("If you do delegate part of your task, add sub-task rows");+ expect(child).toContain("If you implement a delegated part of your task, add sub-task rows");expect(await system("ses_grand")).toContain("layer 2 of at most 3");const great = await system("ses_great");expect(great).toContain(`layer ${OMNIRUSH_SUBAGENT_DEPTH} of at most ${OMNIRUSH_SUBAGENT_DEPTH}`);@@ -154,11 +154,11 @@ 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("in the main session, delegate only implementation work");+ expect(OMNIRUSH_TASK_TOOL_NOTE).toContain("A sub-agent starts its own sub-agents only when its task explicitly tells it to implement a part.");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\.$/);+ expect(OMNIRUSH_TASK_TOOL_NOTE).toMatch(/A sub-agent starts its own sub-agents only when its task explicitly tells it to implement a part\.$/);const bash = { description: "Run a command." };await hooks["tool.definition"]({ toolID: "bash" }, bash);expect(bash.description).toBe("Run a command.");