Skip to content

fix(video-agent-kit): resolve Python interpreter across platforms - #38

Open
dvd233 wants to merge 1 commit into
zai-org:mainfrom
dvd233:contrib/fix-video-agent-python-launcher
Open

dvd233 wants to merge 1 commit into
zai-org:mainfrom
dvd233:contrib/fix-video-agent-python-launcher

Conversation

@dvd233

@dvd233 dvd233 commented Sep 23, 2026 •

Copy link
Copy Markdown

Summary

On Windows, the official Python installer exposes python.exe and the py launcher but does not provide a python3 command. The video-agent-kit hooks therefore failed on every SessionStart, UserPromptSubmit, and Stop event for the environment reported in #14. The MCP stdio entrypoint had the same platform assumption.

This change:

  • adds a Node-based launcher that resolves py -3 / python on Windows and python3 / python on macOS and Linux;
  • routes all three hooks and the video-edit MCP server through that launcher;
  • preserves the Python script's exit status and only falls back when an interpreter is not found;
  • documents that third-party plugin entrypoints require Node.js on the user's PATH in addition to Python 3.10+; ZCode does not expose a bundled Node binary to third-party plugins;
  • bumps the installable plugin version to 0.4.5 in both manifests and the marketplace.

Fixes #14

Validation

  • python scripts/validate.py — 26 plugins validated.
  • python scripts/build_dist.py — passed; video-agent-kit/0.4.5/plugin.zip contains the launcher and updated entrypoints.
  • git diff --check — passed.
  • node --check plugins/video-agent-kit/hooks/run_python.mjs — passed.
  • Direct launcher exit-code test with a script exiting 7 — returned 7 unchanged.
  • Package inspection confirmed the launcher is included and maintainer-owned test files are not packaged.

The launcher was tested directly; a full ZCode desktop session was not available in this environment.

@panda920

Copy link
Copy Markdown
Collaborator

Thanks for the contribution! This PR changes files that are maintained by the ZCode team and cannot be taken from external contributions: tests/test_video_agent_kit_plugin.py. Please drop those changes (plugin content, marketplace.json and docs are welcome) and push again; it will be picked up automatically.

🤖 Copy this prompt into Claude Code / Codex to fix it
You are updating my pull request #38 to github.com/zai-org/zcode-plugins (the ZCode plugin marketplace).
The maintainers' automated intake reported: the PR touches maintainer-owned files

Remove my changes to: tests/test_video_agent_kit_plugin.py

Fix it in this repository:
- Only change files under plugins/<my-plugin>/ and my plugin's entry in marketplace.json;
  never modify .github/, scripts/, tests/, .gitignore, .gitattributes or AGENTS.md.
- Follow CONTRIBUTING.md and AGENTS.md: the manifest lives at plugins/<name>/.zcode-plugin/plugin.json,
  its name/version must match marketplace.json, names are kebab-case, keep the required i18n fields.
- Fetch the latest main of zai-org/zcode-plugins and rebase onto it; if marketplace.json conflicts,
  keep every existing entry and re-add mine.
- Run `python scripts/validate.py` until it passes, then force-push my PR branch.

@dvd233
dvd233 force-pushed the contrib/fix-video-agent-python-launcher branch from f84e4c2 to f09c94b Compare September 24, 2026 09:30
@dvd233

dvd233 commented Sep 24, 2026

Copy link
Copy Markdown
Author

Thanks! I removed tests/test_video_agent_kit_plugin.py, rebased the branch onto the latest main, and reran the repository validation. The updated PR now only changes the video-agent-kit plugin and its marketplace.json entry. python scripts/validate.py, python scripts/build_dist.py, and git diff --check all pass.

@panda920

Copy link
Copy Markdown
Collaborator

✅ Internal validation passed. A ZCode maintainer will review the change next; once merged it is published to the marketplace and this PR is closed automatically.

@jacksonliuyn

Copy link
Copy Markdown
Collaborator

Thanks for the fix! One thing worth calling out: this PR introduces a new runtime dependency on node.

Before this change, the three hooks and the video-edit MCP server only needed Python (python3 ...). Now every entrypoint starts with node:

  • hooks/hooks.json: node "${CLAUDE_PLUGIN_ROOT}/hooks/run_python.mjs" ... (all 3 hooks)
  • .mcp.json, .claude-plugin/plugin.json, .zcode-plugin/plugin.json: "command": "node"

The README currently says "ZCode 自带的 Node.js 负责启动这个解析器", but ZCode does not expose a bundled Node binary to third-party plugins. The desktop app runs its own agent on Electron's Node (ELECTRON_RUN_AS_NODE), and only official plugins' MCP servers get rewritten to that runtime. For third-party plugins, node is resolved from the user's PATH like any other command (see also docs/PLUGIN_DEVELOPMENT.md §4.3: "It requires node on PATH"). So users need to have Node.js installed themselves.

This matters especially for the Windows users from #14: a machine with Python installed but no Node.js will now fail with "node not found" instead of "python3 not found".

Suggestion: please update the README to

  1. remove the claim that ZCode provides Node.js, and
  2. list Node.js (on PATH) as a prerequisite alongside Python 3.10+, e.g. in the environment setup section.

It would also help to mention this in the PR description so reviewers know the fix for #14 assumes Node.js is available.

@dvd233
dvd233 force-pushed the contrib/fix-video-agent-python-launcher branch from f09c94b to 1aa797b Compare September 24, 2026 10:13
@dvd233

dvd233 commented Sep 24, 2026

Copy link
Copy Markdown
Author

Thanks for catching this. I updated plugins/video-agent-kit/README.md to document that third-party plugin entrypoints resolve node from the user's PATH; ZCode does not provide a bundled Node binary to third-party plugins, so Node.js is required alongside Python 3.10+. I also updated the PR description and bumped the installable plugin candidate to 0.4.5 because the packaged README changed. Validation passes: python scripts/validate.py, python scripts/build_dist.py, git diff --check, and the launcher exit-code smoke test.

@dvd233
dvd233 force-pushed the contrib/fix-video-agent-python-launcher branch from 1aa797b to 9693c93 Compare September 24, 2026 10:14
@panda920

Copy link
Copy Markdown
Collaborator

✅ Internal validation passed. A ZCode maintainer will review the change next; once merged it is published to the marketplace and this PR is closed automatically.

@panda920

Copy link
Copy Markdown
Collaborator

✅ Internal validation passed. A ZCode maintainer will review the change next; once merged it is published to the marketplace and this PR is closed automatically.

kittimzhe added a commit to kittimzhe/zcode-plugins that referenced this pull request Sep 27, 2026
0.10.0 ships the jev_classify fallback-id collision and null-prototype
tally fixes (zai-org#36), plus the jev_verify none-id fix (zai-org#38). Pinning 0.9.0
would ship the classify bugs this plugin's skill teaches agents to rely
on.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

video-agent-kit (0.4.3): hooks invoke python3, which doesn't exist on Windows — SessionStart/UserPromptSubmit/Stop hooks fail on every trigger

3 participants