From 617de1cab633a97fd05bbc7c3449231a409018c9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Aug 2026 04:38:12 +0000 Subject: [PATCH 1/2] chore(deps-dev): Bump @eslint/js from 9.39.4 to 10.0.1 Bumps [@eslint/js](https://github.com/eslint/eslint/tree/HEAD/packages/js) from 9.39.4 to 10.0.1. - [Release notes](https://github.com/eslint/eslint/releases) - [Commits](https://github.com/eslint/eslint/commits/v10.0.1/packages/js) --- updated-dependencies: - dependency-name: "@eslint/js" dependency-version: 10.0.1 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package.json | 2 +- pnpm-lock.yaml | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index e8c005a..ec7a61e 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "prepare": "husky || true" }, "devDependencies": { - "@eslint/js": "^9.16.0", + "@eslint/js": "^10.0.1", "@types/node": "^22.10.0", "eslint": "^10.8.0", "husky": "^9.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2687048..35e1fbc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: devDependencies: '@eslint/js': - specifier: ^9.16.0 - version: 9.39.4 + specifier: ^10.0.1 + version: 10.0.1(eslint@10.8.0(jiti@1.21.7)) '@types/node': specifier: ^22.10.0 version: 22.19.19 @@ -454,9 +454,14 @@ packages: resolution: {integrity: sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==} engines: {node: ^20.19.0 || ^22.13.0 || >=24} - '@eslint/js@9.39.4': - resolution: {integrity: sha512-nE7DEIchvtiFTwBw4Lfbu59PG+kCofhjsKaCWzxTpt4lfRjRMqG6uMBzKXuEcyXhOHoUp9riAm7/aWYGhXZ9cw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/js@10.0.1': + resolution: {integrity: sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + peerDependencies: + eslint: ^10.0.0 + peerDependenciesMeta: + eslint: + optional: true '@eslint/object-schema@3.0.5': resolution: {integrity: sha512-vqTaUEgxzm+YDSdElad6PiRoX4t8VGDjCtt05zn4nU810UIx/uNEV7/lZJ6KwFThKZOzOxzXy48da+No7HZaMw==} @@ -2790,7 +2795,9 @@ snapshots: dependencies: '@types/json-schema': 7.0.15 - '@eslint/js@9.39.4': {} + '@eslint/js@10.0.1(eslint@10.8.0(jiti@1.21.7))': + optionalDependencies: + eslint: 10.8.0(jiti@1.21.7) '@eslint/object-schema@3.0.5': {} From 4db0888c0b17d35b15c1761762a3e4bbf7c99400 Mon Sep 17 00:00:00 2001 From: oratis Date: Tue, 25 Aug 2026 23:09:11 +0800 Subject: [PATCH 2/2] fix: satisfy the two rules @eslint/js 10 turns on MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The bump was red because eslint 10's recommended set adds `preserve-caught-error` and `no-useless-assignment`, and nine existing sites break them. Both findings are real, so they are fixed rather than silenced. preserve-caught-error (5) — settings loading (twice), the directory trust store, the hook trust file, and the MCP `headersHelper` each wrapped a caught error in a new Error carrying only `.message`. A JSON parse failure or a spawn error therefore arrived with its stack, `errno` and `path` gone: the message says "Failed to parse ~/.deepcode/ settings.json: Unexpected token" and nothing says which byte, or that the real failure was EACCES. Each now passes `{ cause }`. no-useless-assignment (4) — `patch`/`binary` in workspace-diff and `stdout` in the Grep tool were initialised and then overwritten on every path that reads them; the initialisers only suppressed TypeScript's definite-assignment analysis. Dropping them lets tsc prove what the initialiser was papering over, and it does. In `parseQName` the `pos++` before `break` consumed the DNS root label for a variable nothing reads after the loop. Note eslint itself was already 10.8.0 in the lockfile — only `@eslint/js` was pinned at 9, so the repo was running a v10 engine against a v9 recommended config. This closes that gap. typecheck, lint, format, docs clean; 1671 tests pass, 19 skipped. Co-Authored-By: Claude Opus 5 --- CHANGELOG.md | 7 +++++++ apps/server/src/workspace-diff.ts | 4 ++-- packages/core/src/config/hook-trust.ts | 4 +++- packages/core/src/config/loader.ts | 6 ++++-- packages/core/src/config/trust-store.ts | 4 +++- packages/core/src/mcp/client.ts | 2 +- packages/core/src/sandbox/dns-proxy.ts | 7 +++---- packages/core/src/tools/grep.ts | 2 +- 8 files changed, 24 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74fcf8f..4567472 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -181,6 +181,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### 🐛 Fixed +- **A rethrown error keeps the one that caused it.** Five places wrapped a + caught error in a new `Error` carrying only its `.message` — settings and + trust-store loading, the hook trust file, and the MCP `headersHelper` — so a + parse failure or a spawn error arrived with the original stack, `errno` and + `path` discarded. They now pass `{ cause }`, and ESLint's `preserve-caught-error` + keeps the next one from being written. + - **Tool output could flood the model's context, or vanish** (#268). Two defects, one cause: nothing central bounded what a tool result put in front of the model, so each tool improvised. diff --git a/apps/server/src/workspace-diff.ts b/apps/server/src/workspace-diff.ts index 9b878c2..5fc83c0 100644 --- a/apps/server/src/workspace-diff.ts +++ b/apps/server/src/workspace-diff.ts @@ -35,8 +35,8 @@ export async function collectWorkspaceDiff(cwd: string): Promise { } catch (err) { const code = (err as NodeJS.ErrnoException).code; if (code === 'ENOENT') return undefined; - throw new Error(`Failed to parse ${path}: ${(err as Error).message}`); + throw new Error(`Failed to parse ${path}: ${(err as Error).message}`, { cause: err }); } } @@ -104,7 +104,9 @@ async function readJsonRequired(path: string): Promise { const raw = await fs.readFile(path, 'utf8'); return parseSettings(raw, path); } catch (err) { - throw new Error(`--settings: cannot load ${path}: ${(err as Error).message}`); + throw new Error(`--settings: cannot load ${path}: ${(err as Error).message}`, { + cause: err, + }); } } diff --git a/packages/core/src/config/trust-store.ts b/packages/core/src/config/trust-store.ts index d883023..28be849 100644 --- a/packages/core/src/config/trust-store.ts +++ b/packages/core/src/config/trust-store.ts @@ -33,7 +33,9 @@ export class DirectoryTrustStore { return validateState(parsed); } catch (error) { if ((error as NodeJS.ErrnoException).code === 'ENOENT') return { dirs: {} }; - throw new Error(`Failed to load directory trust: ${(error as Error).message}`); + throw new Error(`Failed to load directory trust: ${(error as Error).message}`, { + cause: error, + }); } } diff --git a/packages/core/src/mcp/client.ts b/packages/core/src/mcp/client.ts index 7985e62..2ea22ec 100644 --- a/packages/core/src/mcp/client.ts +++ b/packages/core/src/mcp/client.ts @@ -153,7 +153,7 @@ async function resolveAuthHeaders(config: McpServerConfig): Promise 63) return null; // compression / invalid pos++; if (pos + len > buf.length) return null; diff --git a/packages/core/src/tools/grep.ts b/packages/core/src/tools/grep.ts index 366ce64..8cbd3ac 100644 --- a/packages/core/src/tools/grep.ts +++ b/packages/core/src/tools/grep.ts @@ -145,7 +145,7 @@ export const GrepTool: ToolHandler = { args.push('--', input.pattern, searchPath); - let stdout = ''; + let stdout: string; try { const result = await execFileAsync('rg', args, { cwd: ctx.cwd,