Skip to content

node_runner: prefer existing local ZeuZ Node over GitHub download#667

Open
sazid wants to merge 3 commits intodevfrom
codex/modify-zeuz-node-startup-logic
Open

node_runner: prefer existing local ZeuZ Node over GitHub download#667
sazid wants to merge 3 commits intodevfrom
codex/modify-zeuz-node-startup-logic

Conversation

@sazid
Copy link
Member

@sazid sazid commented Feb 26, 2026

Motivation

  • The node runner currently always attempts to download the ZeuZ Node from GitHub on startup which prevents running when network access is blocked or unavailable.
  • If a usable ZeuZ Node has already been downloaded, the runner should reuse that local copy and avoid hitting GitHub.

Description

  • Default the computed directory name to ZeuZ_Node-dev when no --branch or tagged version is provided by updating getZeuZNodeDir().
  • Added containsNodeCLI() to detect a valid node copy by checking for node_cli.py inside a directory.
  • Added findExistingZeuzNodeDir() to search the current directory for an existing ZeuZ_Node-* folder that contains node_cli.py and return it when found.
  • Changed setupZeuzNode() to return the resolved directory (string, error) and to skip download/extract when a valid local copy is found, and updated main() to use the resolved directory before calling os.Chdir.

Testing

  • Ran code formatting with gofmt -w Apps/node_runner/main.go, which completed successfully.
  • Ran package tests with cd Apps/node_runner && go test ./..., which completed successfully (packages reported with no test files).

Codex Task

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 175946ac83

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +171 to +175
if !strings.HasPrefix(name, "ZeuZ_Node-") {
continue
}
if containsNodeCLI(name) {
return name, nil

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Honor requested revision when reusing local ZeuZ directory

This fallback loop returns the first ZeuZ_Node-* directory with node_cli.py, even when the user explicitly requested a different --branch or tagged version, so setupZeuzNode() can skip download and execute an unrelated stale checkout. The regression appears whenever expectedDir is absent but any other ZeuZ_Node folder exists, which silently changes runtime behavior and can invalidate runs that rely on a specific revision.

Useful? React with 👍 / 👎.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a6120c27fc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +185 to +186
sort.Strings(candidates)
return candidates[0], nil

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Respect requested revision when reusing local checkout

After collecting any ZeuZ_Node-* folder with node_cli.py, this code always returns the lexicographically first candidate, even when expectedDir (derived from the requested --branch or tagged version) is missing. In that scenario setupZeuzNode() silently skips download and runs an unrelated local revision, which can execute stale code and produce results that do not match the requested build.

Useful? React with 👍 / 👎.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codex address the feedback

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

  • Updated findExistingZeuzNodeDir() so it no longer falls back to an unrelated local ZeuZ_Node-* directory when a specific revision was requested via --branch or a tagged version; it now only uses arbitrary local fallback for default/dev resolution. This ensures setupZeuzNode() will proceed to download the requested revision when the exact local directory is missing. Apps/node_runner/main.goL157-L191
  • Committed the fix on branch work as commit fe773ca.
  • Created a follow-up PR using the make_pr tool with title: “Follow-up: honor requested ZeuZ Node revision before local fallback”.

Testing

  • gofmt -w Apps/node_runner/main.go
  • cd Apps/node_runner && go test ./...
  • ⚠️ curl -I https://github.com -m 10 | head -n 1 (network/proxy in this environment returned HTTP 403 on CONNECT)

View task →

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant