Repository navigation
Restore raw machine communication in the Console (Show verbose) - #576
Conversation
Since the GRBL protocol stack moved into the raydriver Rust session, raw lines no longer reached the Python logging pipeline, so the console's 'Show verbose' switch had nothing to display (besides high-level state changes). raydriver 0.4.0 now reports each complete line via raw_rx/raw_tx session events; the driver logs them with the same categories the old Python driver used: STATUS_POLL for status reports, MACHINE_RESPONSE for ok/error acknowledgements, MACHINE_EVENT for other incoming lines, and RAW_IO for outgoing commands. Bumps the raydriver requirement to ==0.4.0. Closes #573
raydriver 0.5.0 delivers a typed SessionEvent to the driver's event callback instead of (name, payload) string tuples, so _on_session_event now matches on the event variants; each former branch became a small named handler. The callback is annotated as a union of the stub's variant classes with assert_never in the fall-through, so an event added on the Rust side fails the type check here until it is handled. Also regenerates pixi.lock (raydriver 0.3.0 -> 0.4.0) and syncs requirements.txt and debian/requirements-bundle.txt with the pixi.toml pin; both were left at 0.3.0. Requires the raydriver typed-events change (barebaric/raydriver#5); the pin and lockfile move to 0.5.0 once it is released.
Raydriver 0.5.0 delivers the typed SessionEvent consumed by the driver's event callback. Relocks pixi.lock and syncs the requirement files with the pin.
Raydriver 0.5.1 types event_callback as Callable[[SessionEvent], Any] in its stubs, so _on_session_event takes the SessionEvent directly and the hand-written union of all variant classes is no longer needed; unknown events fall through to the debug log. Bumps raydriver to 0.5.1, relcoks pixi.lock and syncs the requirement files with the pin.
🤖 Estimated LLM implementation costReplayed each of the 4 commits in this pull request and counted the code lines each commit added or rewrote:
Added lines by language: Python 122, Plain Text 6, TOML 3 Full estimate
Cost model: ≈10 tokens per code line at $15/Mtok output and $3/Mtok input (assuming heavy prompt caching); input ≈ 15× output for conversation replay; a review round ≈ 42,000 tokens; a failed CI run ≈ 21,000 tokens; file reads capped at 20 kB each. Active window from first commit to merge: <1 day.
|
Summary
Since the GRBL protocol stack moved into the
raydriverRust session, raw lines no longer reached the Python logging pipeline, so the console's "Show verbose" switch had nothing left to display besides high-level state changes (#573).raydrivertyped events: the session delivers a single typedSessionEvent(PyO3 complex enum) instead of(name, payload)string tuples;raydriver0.5.1 additionally typesevent_callbackasCallable[[SessionEvent], Any]in its stubs._on_session_eventmatches on the event variants — no string matching, no hand-written union; each former branch is a small named handler with typed payloads, and unknown events fall through to the debug log.STATUS_POLLfor status reports,MACHINE_RESPONSEforok/error:acknowledgements,MACHINE_EVENTfor other incoming lines, andRAW_IOfor outgoing commands — so the console shows the full conversation again, with status polls gated behind "Show verbose".raydriverto==0.5.1, regeneratespixi.lock, and syncsrequirements.txt/debian/requirements-bundle.txtwith the pin.Test plan
TestRawLoggingtests intests/machine/driver/grbl/test_grbl_serial_driver.pyrun against the GRBL firmware emulator through the real Rust session; all 238 tests undertests/machine/driver/grblpass.pixi run lint(ruff + pyright) green; pyright checks the callback against the typedCallable[[SessionEvent], Any]stub signature.Closes #573