feat(webhook): switch local-webhook to the Python port, drop nodejs - #157
Merged
Conversation
local-channels 0.8.0 rewrote webhook.mjs as webhook.py (single file, stdlib only, python3 >= 3.9) — see defangdevs/local-channels#4. Wire protocols and state formats are unchanged and the js/py IPC envelope interoperates both ways, so daemon and session peers can restart onto the new script in any order. - pin rev/sha256 to local-channels 5d6c932 and fetch webhook.py - daemon ExecStart and the agent-box-webhook wrapper run ${pkgs.python3} - drop the nodejs-slim PATH injection: the plugin's .mcp.json now runs a bare `python3`, which agentBaseTools already provides — the box's only nodejs dependency is gone - tests/webhook.nix: extract python3/webhook.py from ExecStart instead of node/webhook.mjs Verified: fetchurl pin builds against the new rev+hash; all 13 flake checks instantiate (x86_64 builds are CI's job — this box is aarch64); assemble-module --check passes; the port itself was parity-tested side by side with the JS implementation under Python 3.9.18 before the local-channels merge (CLI diff, MCP stdio diff, 4-way daemon/peer matrix, fd-activation emulation, real GitHub delivery replay). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PsqGhkpjsb4kKAdVz25xKN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Companion to defangdevs/local-channels#4 (local-webhook 0.8.0:
webhook.mjs→webhook.py, python3 ≥ 3.9, stdlib only).cfg.webhook.rev/sha256to local-channels5d6c932, fetchwebhook.pywebhookNode→webhookPython(${pkgs.python3}/bin/python3) in the daemonExecStartand theagent-box-webhookwrappernodejs-slimPATH injection — the plugin's.mcp.jsonnow runs a barepython3, whichagentBaseToolsalready provides. This removes the box's only nodejs dependency.tests/webhook.nix: peer stand-in extractspython3/webhook.pyfrom the unit's own ExecStart (same no-drift construction as before)Wire/state contracts are unchanged and the js/py IPC envelope interoperates in both directions (verified in the 4-way daemon/peer matrix on the local-channels side), so restart order doesn't matter during rollout.
Verified here: fetchurl pin builds against the new rev+hash;
assemble-module --checkpasses; all 13 flake checks instantiate. x86_64 builds (incl. the webhook VM test) are on CI — this box is aarch64.🤖 Generated with Claude Code
https://claude.ai/code/session_01PsqGhkpjsb4kKAdVz25xKN