Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
# Need Node 22+ for fs.promises.glob (used by GlobTool).
# @deepcode/core's `package.json` engines field requires >=22 too.
node-version: '22'
cache: 'pnpm'

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20
22
2 changes: 1 addition & 1 deletion apps/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
"vitest": "^2.1.0"
},
"engines": {
"node": ">=20"
"node": ">=22"
}
}
2 changes: 1 addition & 1 deletion apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
"typescript": "^5.7.0"
},
"engines": {
"node": ">=20"
"node": ">=22"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"description": "DeepCode — Claude Code 的 DeepSeek 版(monorepo root)",
"license": "MIT",
"engines": {
"node": ">=20",
"node": ">=22",
"pnpm": ">=9"
},
"packageManager": "pnpm@9.12.0",
Expand Down
15 changes: 14 additions & 1 deletion packages/core/src/hooks/dispatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,22 @@ export function runCommand(
resolveResult({ stdout, stderr, exitCode });
});

// Suppress EPIPE / EBADF when the child closes stdin before our write
// completes (handlers that don't read stdin are common and harmless).
child.stdin.on('error', () => {
// swallow
});
if (opts.stdin) {
child.stdin.write(opts.stdin);
try {
child.stdin.write(opts.stdin);
} catch {
// pipe already closed — fine
}
}
try {
child.stdin.end();
} catch {
// already ended — fine
}
});
}
Expand Down
7 changes: 3 additions & 4 deletions packages/core/src/tools/bash.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ describe('BashTool', () => {

it('runs in the given cwd', async () => {
const r = await BashTool.execute({ command: 'pwd' }, { cwd: tmp });
// macOS resolves /private/var symlinks for /tmp paths; tolerate that
expect(r.content).toMatch(
new RegExp(tmp.replace(/^\/tmp/, '(/private)?/tmp').replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&')),
);
// macOS resolves /tmp → /private/tmp via symlink. Check just the suffix to be portable.
const suffix = tmp.replace(/^\/tmp\//, '').replace(/^\/private\/tmp\//, '');
expect(r.content).toContain(suffix);
});
});
Loading