Add explicit connection-state tracking to the ZeuZ Python Node to auto connect browser#702
Add explicit connection-state tracking to the ZeuZ Python Node to auto connect browser#702ToWhiD073 wants to merge 3 commits into
Conversation
the server/browser can know which ZeuZ server the local node is
connected to or currently trying to connect to.
Changes included:
- Added runtime connection metadata to :
-
-
-
-
-
-
- Updated so immediately
records:
- the requested target server
- authenticating/disconnected state
- cleared previous connection/error state
- Extended so returns the new
connection metadata along with existing node status fields.
- Updated login/reconnect flow to keep connection
state accurate:
- marks node as before login
- marks node as after successful login
- marks node as when the target server is unavailable
- marks node as when authentication or unexpected login
errors occur
- clears target/error state when disconnected
This supports browser-side auto-connect behavior by allowing each
ZeuZ server tab to detect whether the local node is already
connected to that tab’s server or needs to reconnect.
🔎 ZeuZ PR ReviewOpen the full report in ZeuZ: Review findings and apply suggestions
Agent breakdown→ General ReviewStatus: ✅ Completed One correctness issue stands out: the new → Security ReviewStatus: ✅ Completed The PR adds connection-state telemetry, but it also exposes sensitive node metadata on the public → Performance ReviewStatus: ✅ Completed No performance issues found in this PR diff. The changes are state-tracking additions and do not introduce noticeable query, algorithmic, memory, or network regressions. → Testing ReviewStatus: ✅ Completed The PR adds new connection-state behavior, but there are no tests covering the new status/connect responses or the state transitions they drive.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 41fd3abe70
ℹ️ 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".
… = connected immediately after authentication. It now stays
authenticating after login succeeds, and only becomes connected after the deploy long-poll endpoint responds successfully.
Files changed
- projects/Zeuz_Python_Node/node_cli.py:253
- projects/Zeuz_Python_Node/Framework/deploy_handler/long_poll_handler.py:48
Backend changes
- In node_cli.py, login success now sets:
- connected_server = None
- target_server = server_name
- connection_state = authenticating
- In DeployHandler.run(), deploy service status now controls final connection state:
- resp.ok marks node as connected
- 502, no response, request errors mark node as offline
- deploy error payloads/unexpected exceptions mark node as failed
🔎 ZeuZ PR ReviewOpen the full report in ZeuZ: Review findings and apply suggestions
Agent breakdown→ General ReviewStatus: ✅ Completed One issue found: the new startup metadata is captured at import time, so → Security ReviewStatus: ✅ Completed One informational security concern: the PR expands the public status payload with connection and instance details that may be sensitive in an unauthenticated endpoint. → Performance ReviewStatus: ✅ Completed One performance concern: the new connection-state bookkeeping re-reads the config file in the deploy polling hot path, which is avoidable overhead. I flagged a small refactor to reuse the known host instead of hitting disk on every successful poll. → Testing ReviewStatus: ✅ Completed The PR adds connection-state tracking and new
|
🔎 ZeuZ PR ReviewOpen the full report in ZeuZ: Review findings and apply suggestions
Agent breakdown→ General ReviewStatus: ✅ Completed I found one meaningful issue: the new → Security ReviewStatus: ✅ Completed Found one medium-risk information exposure: the new public connection-status fields can leak raw backend error text and exception details to any → Performance ReviewStatus: ✅ Completed One hot-path regression: the reconnect loop now re-reads → Testing ReviewStatus: ✅ Completed The PR adds new connection-state tracking and status fields, but I don’t see regression tests covering the new state transitions or the
|
PR Type
PR Checklist
Overview
This PR updates the ZeuZ Python Node connection-state handling so the ZeuZ Server UI can automatically reconnect an available local node to
the currently active browser server tab.
Previously, the local node exposed only basic status information through
/api/v1/status, such as node state, node ID, and version. Thebrowser could discover that a node was running, but it could not reliably know which ZeuZ server the node was connected to or whether it was
already reconnecting to another server.
New behavior:
connection_stateconnected_servertarget_serverstarted_atinstance_idlast_connect_error/api/v1/statusnow returns this metadata./api/v1/connectimmediately marks the node as authenticating to the requested server.error.
This is backward-compatible because existing
/api/v1/statusfields are preserved. No database changes, dependency changes, or breaking APIchanges are introduced.
Test Cases
Manual verification performed:
node_cli.py./api/v1/connectstill accepts the same request body.