diff --git a/CHANGELOG.md b/CHANGELOG.md index ae920b52..0b3e62ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ and adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - The shared background server is no longer killed with "Main thread unresponsive" while it brings another project's index up to date, such as one a session names with `projectPath`: only its own project's index counted as progress, so a long update of any other looked like a hang, and the server was stopped and restarted again and again. Every index the server keeps up to date now counts, and so does the one a session updates on its own when the background server is unavailable. Thanks @mradwankhalil for the report and the first fix. (#2404) - An index left incomplete by an indexing run that was stopped partway, by a crash, an out-of-memory kill or the server's own hang check, no longer gets the background server killed with "Main thread unresponsive" every time it starts: on a large project, restoring the database indexes the run had set aside took longer than the hang check allows, so each restart died at the same point and the index was never repaired. They are now restored in the background, and the project is served once they are back. Thanks @cbeaulieu-gt for the report and the first fix. (#1887) - A new agent session no longer waits up to about 12 minutes for its first answer when the background server is stuck: a server whose process still holds its connection open but never responds made the session wait out a long series of retries. The session now gives up within seconds and answers on its own, and switches back to the background server once that has been restarted. +- On Windows, a command like `codegraph sync` no longer sometimes crashes as it exits, after its work is done, printing `Assertion failed: !(handle->flags & UV_HANDLE_CLOSING)`, which made a script or CI run that had succeeded fail. The bundled Node runtime moves to 24.21.0, which fixes that crash in Node itself. Thanks @Ancienttwo for the report and the first fix. (#2617) - When CodeGraph can't open a project's database, it now says what went wrong: SQLite's error, the file's path, and what to check, such as another program holding the file open, a folder you can't write to, or a network share. Before, every such failure read "CodeGraph requires node:sqlite (Node.js 22.5+)", and an agent was told no project was loaded. That hint now appears only when Node really can't load its built-in SQLite, a case that used to end in an unhandled error instead. - `codegraph upgrade` no longer wipes your agent instructions file, such as a global `AGENTS.md`, `CLAUDE.md` or `GEMINI.md`, when it refreshes CodeGraph's section in it: a stray `` line above that section, like one left behind when part of an older section was deleted by hand, made the refresh replace everything in between, often the whole file. CodeGraph now rewrites only its own section, in `codegraph install` and `codegraph uninstall` too, and keeps everything around it exactly as it was, Windows line endings included. Thanks @pzaj2 for the report. (#2506) - `codegraph install`, `upgrade` and `uninstall` now write through an instructions or config file that is a symbolic link, such as a `~/.codex/AGENTS.md` or `~/.claude.json` linked from your dotfiles, instead of replacing the link with a copy: the shared file gets CodeGraph's settings, uninstall takes them out again, and the link stays in place. A link CodeGraph can't write through, like one to a read-only file or into a folder that doesn't exist, is now reported by name and left alone, and an upgrade still refreshes your other agents. Thanks @jguerra6 for the report and @danusha2345 for the first fix. (#2721) diff --git a/__tests__/bundle-launcher.test.ts b/__tests__/bundle-launcher.test.ts index 04c07902..c05fbc4a 100644 --- a/__tests__/bundle-launcher.test.ts +++ b/__tests__/bundle-launcher.test.ts @@ -122,3 +122,23 @@ describe('bundled launchers (#1278)', () => { } }); }); + +describe('bundled Node runtime (#2617)', () => { + it('ships a Node 24 release with the fix for the Windows abort at exit', () => { + // The release workflow passes only the target, so the recipe's default + // version is the Node every release bundles. + const workflow = fs.readFileSync(path.resolve('.github/workflows/release.yml'), 'utf8'); + const calls = workflow.match(/build-bundle\.sh[^\r\n]*/g) ?? []; + expect(calls.length).toBeGreaterThan(0); + for (const call of calls) expect(call.trim()).toBe('build-bundle.sh "$t"'); + + const pin = /^NODE_VERSION="\$\{2:-v(\d+)\.(\d+)\.(\d+)\}"\r?$/m.exec(recipe); + expect(pin, 'default NODE_VERSION in scripts/build-bundle.sh').not.toBeNull(); + const [major, minor] = pin!.slice(1, 3).map(Number); + // The CLI refuses to run on Node 25 and later. + expect(major).toBe(24); + // Node 24 before 24.20.0 can abort on Windows as the process exits, after + // the command's work is done (0xC0000409, nodejs/node#56645). + expect(minor).toBeGreaterThanOrEqual(20); + }); +}); diff --git a/scripts/build-bundle.sh b/scripts/build-bundle.sh index 0fef1c98..4d571709 100755 --- a/scripts/build-bundle.sh +++ b/scripts/build-bundle.sh @@ -13,7 +13,7 @@ # scripts/build-bundle.sh [node-version] # target: darwin-arm64 | darwin-x64 | linux-x64 | linux-arm64 # | win32-x64 | win32-arm64 -# node-version: e.g. v24.16.0 (default below; pin for reproducible builds) +# node-version: e.g. v24.21.0 (default below; pin for reproducible builds) # # Output: # unix: release/codegraph-.tar.gz (launcher: bin/codegraph) @@ -21,7 +21,13 @@ set -euo pipefail TARGET="${1:?usage: build-bundle.sh [node-version]}" -NODE_VERSION="${2:-v24.16.0}" +# The release workflow passes no version, so this default is the Node every +# release bundles. Keep it on 24.x (the CLI refuses Node 25+) and at 24.20.0 or +# later: older 24.x releases can abort on Windows just as the process exits, +# after its work is done, with 0xC0000409 and "Assertion failed: +# !(handle->flags & UV_HANDLE_CLOSING), file src\win\async.c" (nodejs/node#56645, +# fixed by nodejs/node#61999 in 24.20.0; issue #2617). +NODE_VERSION="${2:-v24.21.0}" ROOT="$(cd "$(dirname "$0")/.." && pwd)" OUT="$ROOT/release"