fix(#2557): download openshell binaries during watch mode - #2558
Conversation
The openshell extension's watch script only ran vite build --watch, which does not download the openshell binaries needed for development. First-time developers who ran pnpm install followed by pnpm watch would be missing the binaries in the assets folder, causing the extension to fall back to system PATH lookups. Add tsx ./scripts/download.ts to the watch script so that binaries are downloaded for the host platform before starting the vite watcher. The download is idempotent and skips if binaries are already present at the correct version. Note: unit tests and linters could not be run because node_modules are not installed in the sandbox environment. The change is a single-line script modification in package.json with no production code impact. Closes #2557
There was a problem hiding this comment.
For watch command that developers run repeatedly during iteration, downloading both openshell and image-builder every invocation adds unnecessary startup latency. The download is idempotent (it checks a version marker), but it still resolves the GitHub release for both components each time.
Consider whether the watch script should scope the download to just the openshell component:
"watch": "tsx ./scripts/download.ts --component openshell && vite build --watch"
|
The openshell binary should be considered as a dependency so it makes more sense to install it as part of the "pnpm install" process, as @benoitf mentioned in #2557 (comment) |
|
/fs-code |
|
/fs-fix |
|
🤖 Finished Fix · ✅ Success · Started 1:05 PM UTC · Completed 1:11 PM UTC |
The watch script previously ran `tsx ./scripts/download.ts` without the --component flag, which downloads both openshell and image-builder binaries on every invocation. Since watch is run repeatedly during development, this adds unnecessary startup latency from resolving the GitHub release for image-builder. Scope the download to `--component openshell` to match the dedicated `download` script and avoid the extra network round-trip. Addresses review feedback on #2558
🔧 Fix agent — iteration 1 (human-triggered)Scoped the watch script download to --component openshell only, addressing the review feedback about unnecessary startup latency from downloading both components. Fixed (1):
Tests: passed Updated by fullsend fix agent |
|
add it as a post-install step, do not use --component |
|
/fs-fix |
|
🤖 Finished Fix · ✅ Success · Started 1:18 PM UTC · Completed 1:25 PM UTC |
Move the binary download from the watch script to a postinstall hook so openshell binaries are fetched during pnpm install, treating them as a project dependency. Remove --component flag per reviewer request so all components are downloaded. Addresses review feedback on #2558
🔧 Fix agent — iteration 2 (human-triggered)Addressed both review findings from benoitf: moved openshell binary download from the watch script to a postinstall hook in package.json, and removed the --component flag so all components are downloaded during pnpm install. Fixed (2):
Tests: passed Updated by fullsend fix agent |
Summary
tsx ./scripts/download.tsstep to the openshell extension'swatchscript so that OpenShell binaries are downloaded for the host platform before starting the vite watcherpnpm install→pnpm watchhave the binaries available inextensions/openshell/assets/<platform>-<arch>/, which is where the extension looks for them in development mode (per PR fix(openshell): use extension assets folder for bundled binaries in dev mode #2486)Test plan
pnpm installin a clean checkout, thenpnpm watchextensions/openshell/assets/<platform>-<arch>/is populated with openshell binariespnpm watcha second time and verify the download step is skipped (idempotent)Closes #2557
Post-script verification
agent/2557-openshell-watch-download)06fa8ae0fd6b2fc5a9999b866b3bd703adaf10b8..HEAD)