Skip to content

[BUG] Windows "Open With" dialog when running AgnesCode — resources/bin/node is a bash script #53

Description

@Jack-8

Bug: Windows "Open With" dialog when running AgnesCode — resources/bin/node is a bash script
Environment
OS: Windows 10 (build 26200 / Win11)
AgnesCode version: 1.0.23
Product URL: https://github.com/AgnesAI-Labs/AgnesCode/releases/latest/download/
Reproduction Steps
Launch AgnesCode via shortcut (C:\Users\qilei\AppData\Local\Programs\AgnesCode\AgnesCode.exe)
Windows pops up "选择用什么打开 NODE 文件" dialog
Application hangs until user dismisses or selects an app for the extensionless node file
Root Cause Analysis
In resources/bin/, there is a file named node with no file extension. It is a POSIX bash wrapper script:

#!/bin/bash

set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${SCRIPT_DIR}/node-setup-common.sh"

log "Executing 'node' command with arguments: ${}"
node "${@}" || log "Failed to execute 'node' with arguments: ${
}"

log "node script completed successfully."
On Linux/macOS this works through the shell environment. On Windows, however, Windows has no concept of executing an extensionless file by default. Since there is no default handler registered for files named exactly node, Windows shows the "Open With" picker dialog instead of silently executing the script through bash.

Meanwhile, the actual Node.js runtime used by AgnesCode already exists at:

resources/slide_export_runtime/node/node.exe (v22.14.0, ~83 MB)
Current Workaround & Update Problem
Placing a node.cmd in resources/bin/ works temporarily, but gets overwritten on every auto-update because the update mechanism replaces the entire resources/ tree via AgnesCode-Setup.exe.

Suggested Fix
Add a proper Windows shim for node in the Electron build/packaging step, analogous to how npx.cmd, uv.exe, and uvx.exe are already copied into the user's AppData\Local\Agnes\bin\ shim directory at startup:

From main.log:

Copied Windows shim: uvx.exe -> AppData\Local\Agnes\bin\uvx.exe
Copied Windows shim: npx.cmd -> AppData\Local\Agnes\bin\npx.cmd
Copied Windows shim: uv.exe -> AppData\Local\Agnes\bin\uv.exe
Added C:\Users\qilei\AppData\Local\Agnes\bin to PATH for Agnes processes only
The new shim should be:

Source (Windows-specific): resources/bin-shims/node.cmd
Content:

@echo off
"%~dp0node.exe" %*
Or point directly to the embedded Node binary:

@echo off
"%~dp0....\Resources\bin\slide_export_runtime\node\node.exe" %*
Then include node / node.cmd in the list of Windows shims that are copied to AppData\Local\Agnes\bin\ during startup. Also ensure the Windows build does not ship the extensionless node bash script in resources/bin/.

Logs
Full main.log available upon request. The key lines are from the startup sequence where shim copying happens.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions