A desktop coding agent with free access to frontier models.
TypeScript
fix: shared context listing without the repo fsmonitor or app secrets
ogsamrat406d58fc1b56
diff --git a/apps/server/src/context/PARITY.sha256 b/apps/server/src/context/PARITY.sha256index a7aa28bc..e054688c 100644--- a/apps/server/src/context/PARITY.sha256+++ b/apps/server/src/context/PARITY.sha256@@ -8,7 +8,7 @@ e13f86577014b52affc4c2336630eedcac277b974939c6741119a62b7fda439b ephemeral.tsd204176a44609f7c3da5bcedfada71fdd79703d0c854e3c9632b94e9be007a6f install-log.tsa9474cc5087b39e56f79bcd7e4cdfa9fcb748f26505bf6ad0f891c17393407ac network.ts37a3247535ef6809afac5f6c606ca8d40f9b44c779131c8d167110ec288cacb8 open-tools.ts-f626d385059c042f7ac3e0dbaee8315973c8c8a6296184fb5f53cabba95e9af2 outside-files.ts+6d56de7643be3eaf4f01d2e682b18e0992ccfd1e621da69885cd1238b69d5680 outside-files.tsd772119f2785b6926cd765a44589c171542d5e79b3677bfa076851775d794480 outside.tsd7c5638ca9204a9c51a4552e7a9b09cf7beeae9c63d9352d5950118fd5536967 pm-config.ts932c1eff09d540590abf99ede63447f4e0af9396096d325fa5fcfbcde49eda10 privacy.tsdiff --git a/apps/server/src/context/outside-files.ts b/apps/server/src/context/outside-files.tsindex 84612c03..ebcacb42 100644--- a/apps/server/src/context/outside-files.ts+++ b/apps/server/src/context/outside-files.ts@@ -23,7 +23,6 @@* and omnirush-gui (apps/server/src/context/), listed in PARITY.sha256.*/-import { gitChildEnv } from "../git-env.js";import { execFile } from "node:child_process";import { createHash } from "node:crypto";import { lstat, readFile, readlink, readdir } from "node:fs/promises";@@ -120,9 +119,29 @@ async function sha256Of(file: string, size: number): Promise<string | null> {}}+// The environment git gets here: the basics a program needs and git's own settings that carry no credential+// (no app tokens, no engine password, no other keys); the same list as the desktop's git-env.ts, kept in this+// shared file so the CLI and the desktop stay byte-identical.+const GIT_ENV_KEEP = new Set([+ "PATH", "HOME", "USER", "LOGNAME", "SHELL", "TMPDIR", "TMP", "TEMP", "LANG", "LANGUAGE", "TZ", "TERM",+ "SYSTEMROOT", "WINDIR", "COMSPEC", "PATHEXT", "USERPROFILE", "USERNAME", "USERDOMAIN", "APPDATA", "LOCALAPPDATA", "PROGRAMDATA",+ "PROGRAMFILES", "PROGRAMFILES(X86)", "PROGRAMW6432", "HOMEDRIVE", "HOMEPATH", "SYSTEMDRIVE", "ALLUSERSPROFILE",+ "GIT_CONFIG_NOSYSTEM", "GIT_CONFIG_GLOBAL", "GIT_CEILING_DIRECTORIES",+]);++function gitEnvironment(base: NodeJS.ProcessEnv = process.env): NodeJS.ProcessEnv {+ const out: NodeJS.ProcessEnv = { GIT_TERMINAL_PROMPT: "0", GIT_OPTIONAL_LOCKS: "0" };+ for (const [key, value] of Object.entries(base)) {+ if (typeof value !== "string" || /^(?:OMNIRUSH_|OPENCODE_SERVER_|OPENCODE_PASSWORD$)/i.test(key)) continue;+ if (GIT_ENV_KEEP.has(key.toUpperCase()) || /^(?:LC_|XDG_)/i.test(key)) out[key] = value;+ }+ return out;+}++// A listing only: no fsmonitor program from the repository's config (core.fsmonitor can name any program).function git(root: string, args: string[]): Promise<string | null> {return new Promise((resolve) => {- execFile("git", ["-C", root, ...args], { timeout: GIT_TIMEOUT_MS, maxBuffer: 8 * 1024 * 1024, windowsHide: true, env: gitChildEnv() }, (error, stdout) => resolve(error ? null : stdout));+ execFile("git", ["-C", root, "-c", "core.fsmonitor=false", ...args], { timeout: GIT_TIMEOUT_MS, maxBuffer: 8 * 1024 * 1024, windowsHide: true, env: gitEnvironment() }, (error, stdout) => resolve(error ? null : stdout));});}