Skip to main content

onestep-control-plane

Control-plane reporter and WebSocket command integration plugin for onestep.

pip install onestep-control-plane

Most applications should install it through the core extra:

pip install 'onestep[control-plane]'

YAML usage:

reporter: true

Python usage:

from onestep_control_plane import ControlPlaneReporter, ControlPlaneReporterConfig

Compatibility imports also work when this plugin is installed:

from onestep import ControlPlaneReporter, ControlPlaneReporterConfig
from onestep.control_plane_ws import ControlPlaneWsSender

Presence beacon

Since 0.2.0 the reporter keeps an instance shown as online while its event loop is blocked inside a synchronous handler, instead of letting it flap offline/online on every slow call.

The heartbeat loop and every task handler share one asyncio event loop, so a handler making a blocking call starves the heartbeat. The reporter therefore starts a daemon thread that watches a timestamp the heartbeat loop updates each tick and POSTs /api/v1/agents/presence to the control plane only once that timestamp is older than the grace window. While the loop is healthy the thread sends nothing at all, so a normal deployment behaves exactly as before.

The control plane uses the frame to advance last_seen_at and nothing else: it carries no sequence and no health, so it cannot reorder or overwrite real telemetry. An agent whose WebSocket is broken while its loop is healthy keeps touching the timestamp, stays silent, and is still reported offline -- the beacon does not mask a real reporting outage.

The beacon starts only when the reporter built its own WebSocket sender. An injected sender (tests, custom transports) gets no background HTTP client unless you pass one explicitly:

from onestep_control_plane import ControlPlaneReporter, PresenceBeacon

reporter = ControlPlaneReporter(config, presence_beacon=PresenceBeacon(...))

Settings:

Env var Default Meaning
ONESTEP_CONTROL_PLANE_PRESENCE_ENABLED true false disables the beacon.
ONESTEP_CONTROL_PLANE_PRESENCE_INTERVAL_S heartbeat_interval_s Poll interval while the loop is stalled.
ONESTEP_CONTROL_PLANE_PRESENCE_GRACE_S 2 x presence_interval_s (so 2 x heartbeat_interval_s by default) Loop silence that counts as stalled; must be >= 2 x the interval.

If the control plane predates the route it answers 404; the beacon logs once and disables itself, leaving the WebSocket heartbeat as the only liveness signal. The plugin can therefore be upgraded before the plane.

Blocking handlers are still worth converting (asyncio.to_thread(), a real async client): the beacon keeps the instance shown as online, but a blocked loop still delays task throughput and command responses such as ping or drain.

Metadata

Release files for onestep-control-plane 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for onestep-control-plane 0.2.0
File Size Uploaded Provenance
onestep_control_plane-0.2.0.tar.gz 50.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for onestep-control-plane 0.2.0
File Interpreter ABI Platform
onestep_control_plane-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 79.7 kB

Release files / onestep_control_plane-0.2.0.tar.gz

Download URL onestep_control_plane-0.2.0.tar.gz
Size 50.7 kB
Tags Source
SHA-256 checksum
How to use checksums
33802e719c3c04fb504c1297b8d834a3884ac327d7e030ae491ee58c3052559b
BLAKE2b-256 checksum
How to use checksums
d06c5abbfb715ca058291277fce9ef4d387f4af25778f1843976fdc4ddd9d4c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / onestep_control_plane-0.2.0-py3-none-any.whl

Download URL onestep_control_plane-0.2.0-py3-none-any.whl
Size 29.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
373ef4bccd76f4bda7fbd389f39054d88d54e0268887dac60e1776253831dcc6
BLAKE2b-256 checksum
How to use checksums
0754ae110990199a39d43e7340188de1b46db2b4c2bbe1662c3cc2ed8216ac0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for onestep-control-plane 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page