Skip to content

A desktop coding agent with free access to frontier models.

TypeScript

chore: shared claude provider and notes from cli 2.7.5

ogsamratd4cb4814233c
diff --git a/apps/app/src/react-app/domains/whats-new/PARITY.sha256 b/apps/app/src/react-app/domains/whats-new/PARITY.sha256
index c19f6225..61ac5646 100644
--- a/apps/app/src/react-app/domains/whats-new/PARITY.sha256
+++ b/apps/app/src/react-app/domains/whats-new/PARITY.sha256
@@ -1,3 +1,3 @@
# whats-new.json is the same file in omnirush-cli (src/whats-new/) and omnirush-gui (apps/app/src/react-app/domains/whats-new/).
# A change to one must be ported to the other and this list updated in both.
-e2740ab0b17bb1f59be44e2dec5eddef3d6b953b0f3d06939336ee5514645590 whats-new.json
+73554fe088f8b7cc977ff77d5c8b372337c15d7342f43a388c0489eb821283ad whats-new.json
diff --git a/apps/app/src/react-app/domains/whats-new/whats-new.json b/apps/app/src/react-app/domains/whats-new/whats-new.json
index 05a2e66d..25968142 100644
--- a/apps/app/src/react-app/domains/whats-new/whats-new.json
+++ b/apps/app/src/react-app/domains/whats-new/whats-new.json
@@ -2,6 +2,34 @@
"$comment": "What's new in OmniRush: release notes written for users, newest first, shown in the CLI (/changelog, omnirush changelog) and the desktop app (Help > What's new). Same file in omnirush-cli (src/whats-new/) and omnirush-gui (apps/app/src/react-app/domains/whats-new/); keep the copies byte-identical (PARITY.sha256). Plain language, no PR numbers, nothing internal. Write the entry for every release before tagging.",
"schema": 1,
"cli": [
+ {
+ "version": "2.7.5",
+ "date": "2026-10-27",
+ "new": [],
+ "improved": [
+ "`omnirush -m claude-opus-5-5` starts the chat on Claude, and `omnirush -s <chat> -m <model>:<effort>` reopens a chat on that model and effort when the chat can switch to it.",
+ "The effort picker shows the effort the chat really runs at, also when it was set with `-m <model>:<effort>`.",
+ "The first time a message that starts with ! runs as a shell command, OmniRush says so and how to leave shell mode."
+ ],
+ "fixed": [
+ "A Claude message no longer runs twice when several chats start at once (seen on Macs as \"Session ID … is already in use\", or two agents editing the same files).",
+ "A model picked in a new chat before its first message, such as Kimi, is no longer refused as \"This chat runs on GPT 6 Astra\".",
+ "Answering No to \"Start a new chat with Claude?\" puts the chat back on its own model, so the next message is not refused again.",
+ "Claude access given to or taken from your account now applies without restarting OmniRush.",
+ "Quitting OmniRush now stops its Linux sandbox when no other OmniRush session uses it, instead of leaving it running.",
+ "On Windows, `omnirush sandbox` now says to turn on virtualization when WSL can't start its virtual machine."
+ ]
+ },
+ {
+ "version": "2.7.4",
+ "date": "2026-10-27",
+ "new": [],
+ "improved": [],
+ "fixed": [
+ "Changing the reasoning effort in the middle of a chat now applies to the next message, instead of the chat staying on the effort it started with.",
+ "With a separate OmniRush folder per login (OMNIRUSH_DIR), the folder's name no longer shows up in what the agent is told or in its PATH."
+ ]
+ },
{
"version": "2.7.3",
"date": "2026-10-26",
@@ -316,6 +344,19 @@
}
],
"desktop": [
+ {
+ "version": "3.8.1",
+ "date": "2026-10-27",
+ "new": [],
+ "improved": [
+ "The sidebar shows your profile with its name and a labelled Send feedback button, and its tools explain themselves when you point at them.",
+ "On a Mac with no Docker-compatible app, the sandbox now sets up OmniRush's own Linux VM instead of running the project on the Mac."
+ ],
+ "fixed": [
+ "The reasoning effort can be picked again: the effort you choose, also in the middle of a chat, is the one the next message runs at.",
+ "Claude access given to or taken from your account now shows without restarting the app, and a Claude message on an account without access is refused at once instead of after a long wait."
+ ]
+ },
{
"version": "3.8.0",
"date": "2026-10-26",
diff --git a/apps/server/src/opencode-plugins/claude-provider/PARITY.sha256 b/apps/server/src/opencode-plugins/claude-provider/PARITY.sha256
index 1f76369d..ffb40f5b 100644
--- a/apps/server/src/opencode-plugins/claude-provider/PARITY.sha256
+++ b/apps/server/src/opencode-plugins/claude-provider/PARITY.sha256
@@ -1,3 +1,3 @@
# The Claude provider: the same files in omnirush-cli (assets/claude-provider/) and omnirush-gui. A change to one must be ported to the other and this list updated in both.
-e06a1d3a28a663c6f3935dc9d74eb5ce88a83e42f5ad95061d632ca824b211d9 index.js
+2cddbf5ef97680589675fa8d0641ddb45afe5107a79209df96104cb6805018df index.js
3018991c25910011fd1387d311aaf5c128971b0f1ba3f1627c7b0126729d1d2a map.js
diff --git a/apps/server/src/opencode-plugins/claude-provider/index.js b/apps/server/src/opencode-plugins/claude-provider/index.js
index 4ca9439e..0d8e4107 100644
--- a/apps/server/src/opencode-plugins/claude-provider/index.js
+++ b/apps/server/src/opencode-plugins/claude-provider/index.js
@@ -25,6 +25,11 @@
//
// Stop arrives as the stream's cancel() (the engine passes no abortSignal):
// an interrupt on Claude's stdin, then SIGINT, then SIGKILL.
+//
+// One Claude per chat: a title request is never a turn (the engine asks the chat's model for the title when the
+// title model fails), and LAUNCH ends any earlier Claude of the same chat still running in the box (a launch boxsh
+// runs again with `<runtime> exec` after boxd's connection failed, a stopped turn's leftover); the turn's first
+// message is a file in the run folder, so a launch run again reads it too.
import { spawn } from "node:child_process";
import { createHash, randomUUID } from "node:crypto";
@@ -78,14 +83,50 @@ export function hasTranscript(configDir, uuid) {
} catch { return false; }
}
-/** Claude Code's argv for a turn. */
-export function claudeArgs({ model, uuid, resume }) {
+/** Claude Code's argv for a turn (LAUNCH adds --resume or --session-id in the box). */
+export function claudeArgs({ model }) {
return ["-p", "--input-format", "stream-json", "--output-format", "stream-json", "--verbose", "--include-partial-messages",
- "--model", model, "--permission-mode", "bypassPermissions", resume ? "--resume" : "--session-id", uuid];
+ "--model", model, "--permission-mode", "bypassPermissions"];
+}
+
+/**
+ * The turn's command in the box: sh -c LAUNCH <claude> <run folder> <uuid> <claudeArgs...>.
+ * Ends any other Claude of this chat (with its process group, unless it is ours), resumes when
+ * Claude has the chat's transcript, then gives Claude turn-<uuid>.jsonl and the provider's stdin after it.
+ */
+export const LAUNCH = [
+ "bin=$0 run=$1 id=$2; shift 2",
+ "me=$(cut -d' ' -f5 /proc/$$/stat 2>/dev/null)",
+ 'for c in $(grep -lsaF -- "$id" /proc/[0-9]*/cmdline); do',
+ ' p=${c%/cmdline}; n=${p#/proc/}; [ "$n" = "$$" ] && continue',
+ " case \"$(tr '\\0' ' ' 2>/dev/null <\"$p/cmdline\")\" in",
+ " *\"$bin \"*\" $id \"*) g=$(cut -d' ' -f5 \"$p/stat\" 2>/dev/null); [ -n \"$g\" ] && [ \"$g\" != \"$me\" ] && kill -KILL -- \"-$g\" 2>/dev/null; kill -KILL \"$n\" 2>/dev/null;;",
+ " esac",
+ "done",
+ 'if ls "$CLAUDE_CONFIG_DIR"/projects/*/"$id.jsonl" >/dev/null 2>&1; then set -- "$@" --resume "$id"; else set -- "$@" --session-id "$id"; fi',
+ 'f="$run/turn-$id.jsonl"; i=0; while [ ! -s "$f" ] && [ $i -lt 50 ]; do sleep 0.1; i=$((i+1)); done',
+ // The feeder ends with Claude: a Claude that exits early (an error) must not leave the turn waiting on stdin.
+ 't=$(mktemp /tmp/omnirush-feed.XXXXXX)',
+ 'sh -c \'echo $$ > "$1"; cat "$2"; exec cat\' feed "$t" "$f" | { "$bin" "$@"; c=$?; i=0; while [ ! -s "$t" ] && [ $i -lt 40 ]; do sleep 0.05; i=$((i+1)); done; kill "$(cat "$t")" 2>/dev/null; rm -f "$t"; exit $c; }',
+].join("\n");
+
+/**
+ * The install log's folder for this chat's commands, as the app's box plugin gives the engine's own shell calls:
+ * a desktop chat notes in the desktop's box folder (<boxHome>/desktop-projects.json `pkglog_dir`), a CLI chat in
+ * the engine's (OMNIRUSH_PKGLOG_DIR). Null when the install log is off.
+ */
+export function installLogDir(boxHome, client, env = process.env) {
+ if (boxHome && String(client).startsWith("gui/")) {
+ try {
+ const dir = JSON.parse(fs.readFileSync(path.join(boxHome, "desktop-projects.json"), "utf8"))?.pkglog_dir;
+ if (typeof dir === "string" && dir) return dir;
+ } catch { /* not listed */ }
+ }
+ return env.OMNIRUSH_PKGLOG_DIR || null;
}
/** The env Claude Code runs with in the box (passed by boxsh through OMNIRUSH_BOX_PASS_ENV). */
-export function claudeEnv({ model, baseUrl, sessionID, client }) {
+export function claudeEnv({ model, baseUrl, sessionID, client, pkglogDir = null }) {
const env = {
CLAUDE_CONFIG_DIR: `${BOX_RUN}/claude/config`,
ANTHROPIC_BASE_URL: baseUrl,
@@ -97,6 +138,10 @@ export function claudeEnv({ model, baseUrl, sessionID, client }) {
DISABLE_AUTOUPDATER: "1", CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: "1", DISABLE_TELEMETRY: "1", DISABLE_ERROR_REPORTING: "1",
// The box is the boundary that makes running without asks acceptable (it runs as root in a container).
IS_SANDBOX: "1",
+ // The install log: Claude's commands (its sub-agents' too) note installs where the app reads this chat's, and
+ // name the chat (the engine names no call of Claude's: the app matches them to the chat's turn).
+ OMNIRUSH_SESSION: sessionID,
+ ...(pkglogDir ? { OMNIRUSH_PKGLOG_DIR: pkglogDir } : {}),
};
return env;
}
@@ -191,6 +236,9 @@ class ClaudeCodeModel {
const sessionID = String(headers["x-session-id"] || headers["x-opencode-session-id"] || "");
if (!sessionID) throw apiError("A Claude turn needs its chat.");
if (headers["x-omnirush-side"] === "1") throw apiError("Side questions aren't available in Claude chats yet.");
+ // A title the title model could not make (refused, busy) is asked again on the chat's model: here that ran the
+ // first message as a second Claude turn next to the real one ("Session ID … is already in use", two agents).
+ if (headers["x-omnirush-title"] === "1" || headers["x-omnirush-agent"] === "title") throw apiError("A Claude chat's title comes from the title model.");
const compaction = headers["x-omnirush-agent"] === "compaction";
const { shell, boxHome, directory, client = "cli", note } = this.settings;
// One desktop engine serves every project: the request names its folder.
@@ -214,11 +262,13 @@ class ClaudeCodeModel {
writeToken(grant.token);
fs.writeFileSync(path.join(configDir, "settings.json"), `${JSON.stringify({ apiKeyHelper: `cat ${BOX_RUN}/claude/token` })}\n`, { mode: 0o600 });
- const passed = claudeEnv({ model: this.modelId, baseUrl: grant.baseUrl, sessionID, client: grant.client || client });
+ const passed = claudeEnv({ model: this.modelId, baseUrl: grant.baseUrl, sessionID, client: grant.client || client, pkglogDir: installLogDir(boxHome, client) });
const env = { ...process.env, ...passed, OMNIRUSH_BOX_KEY: key, OMNIRUSH_BOX_HOME: boxHome, OMNIRUSH_BOX_PASS_ENV: Object.keys(passed).join(",") };
try { await ensureClaude({ shell, env, cwd: root, home: boxHome, run }); } catch (error) { throw apiError(error?.message || "Claude Code could not be installed in the sandbox."); }
- const child = spawn(shell, ["-c", 'exec "$0" "$@"', BOX_BIN, ...claudeArgs({ model: this.modelId, uuid, resume })], { cwd: root, env, stdio: ["pipe", "pipe", "pipe"], windowsHide: true });
+ const turnFile = path.join(run, `turn-${uuid}.jsonl`);
+ fs.writeFileSync(turnFile, `${JSON.stringify({ type: "user", message: { role: "user", content }, parent_tool_use_id: null, session_id: uuid })}\n`, { mode: 0o600 });
+ const child = spawn(shell, ["-c", LAUNCH, BOX_BIN, `${BOX_RUN}/claude`, uuid, ...claudeArgs({ model: this.modelId })], { cwd: root, env, stdio: ["pipe", "pipe", "pipe"], windowsHide: true });
const mapper = new ClaudeStreamMapper({ compaction });
let stderr = "";
let done = false;
@@ -228,7 +278,8 @@ class ClaudeCodeModel {
const timers = [];
const end = () => { done = true; clearInterval(refresh); for (const t of timers) clearTimeout(t); };
child.stdin.on("error", () => undefined);
- child.stdin.write(`${JSON.stringify({ type: "user", message: { role: "user", content }, parent_tool_use_id: null, session_id: uuid })}\n`);
+ // The box has read it once Claude answers; a launch boxsh runs again reads it too.
+ child.on("close", () => fs.rmSync(turnFile, { force: true }));
const settings = this.settings;
return {
stream: new ReadableStream({
@@ -253,7 +304,10 @@ class ClaudeCodeModel {
}
});
child.on("error", (error) => { if (done) return; send({ type: "error", error: apiError(`Claude Code could not start in the sandbox (${error.message}).`) }); end(); controller.close(); });
+ // The turn's native transcript goes up with the chat (best effort), a stopped turn's too once Claude has exited.
+ const ended = (ok) => void fetch(settings.grantURL, { method: "POST", headers: { "content-type": "application/json", "x-omnirush-usage-key": settings.grantKey || "" }, body: JSON.stringify({ op: "end", sessionID, uuid, ok }) }).catch(() => undefined);
child.on("close", (code) => {
+ if (stopped) return ended(false);
if (done) return;
const tail = stderr.trim().split("\n").filter(Boolean).at(-1);
const last = mapper.finish(`Claude Code stopped before the turn finished${tail ? `: ${tail.slice(0, 300)}` : ` (exit ${code})`}.`);
@@ -261,8 +315,7 @@ class ClaudeCodeModel {
send(last);
end();
controller.close();
- // The turn's native transcript goes up with the chat (best effort).
- void fetch(settings.grantURL, { method: "POST", headers: { "content-type": "application/json", "x-omnirush-usage-key": settings.grantKey || "" }, body: JSON.stringify({ op: "end", sessionID, uuid, ok: last.type === "finish" }) }).catch(() => undefined);
+ ended(last.type === "finish");
});
},
cancel() {