Feat: Remote debug API.#798
Conversation
# Conflicts: # components/bridges/cu_iceoryx2_bridge/src/lib.rs # core/cu29/Cargo.toml # core/cu29_export/Cargo.toml # core/cu29_export/src/mcap_export.rs # core/cu29_export/src/serde_to_jsonschema.rs # core/cu29_runtime/Cargo.toml # core/cu29_runtime/src/debug.rs
|
@makeecat ok this one allows to have a replay debugger out of process so we can patch/restart copper. in examples/cu_remote_debug_session cargo run to see it in action |
There was a problem hiding this comment.
Pull request overview
This PR introduces a comprehensive remote debug API for the Copper runtime, enabling remote control and inspection of Copper applications over Zenoh. The feature allows developers to remotely navigate execution timelines, inspect task state, query schemas, and control replay sessions through a JSON-RPC-like protocol.
Changes:
- Added
remote_debugmodule with Zenoh-based RPC server and client for remote debugging - Exposed new public methods
total_entries()andcurrent_index()inCuDebugSession - Added
remote-debugfeature flag with zenoh and minicbor-serde dependencies - Created comprehensive example (
cu_remote_debug_session) demonstrating all RPC endpoints
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| core/cu29_runtime/src/remote_debug.rs | Core implementation of remote debug protocol with server, client, and RPC handlers |
| core/cu29_runtime/src/debug.rs | Added accessor methods for session introspection |
| core/cu29_runtime/src/lib.rs | Module export with feature gate |
| core/cu29_runtime/Cargo.toml | Dependencies for zenoh and minicbor-serde behind remote-debug feature |
| core/cu29/src/lib.rs | Re-exports remote_debug module in prelude |
| core/cu29/Cargo.toml | Feature flag propagation |
| Cargo.toml | Added cu_remote_debug_session to workspace members |
| examples/cu_remote_debug_session/* | Complete example demonstrating remote debug API usage |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
We could imagine a world where a server caches those processes to be hit by a CI/CD.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dc5804882c
ℹ️ 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".
| let jump = match seek_to_index(&mut state.session, resolved.idx) { | ||
| Ok(v) => v, | ||
| Err(e) => return err_response(request_id, "RunUntilFailed", &e.to_string()), | ||
| }; | ||
| update_after_jump(state, &jump); |
There was a problem hiding this comment.
Honor nav.run_until bounds before seeking to target
nav.run_until always executes seek_to_index to the resolved target before evaluating max_steps, so a request like max_steps: 10 can still replay thousands of steps and move the cursor all the way to the target, then report stopped_reason: "max_steps" afterward. This defeats the caller’s safety bound (and makes timeout_ms ineffective as well), which can unexpectedly turn a bounded operation into a long replay on large logs.
Useful? React with 👍 / 👎.
| let previous_idx = state.session.current_index().ok_or_else(|| { | ||
| CuError::from("Non-mutating at queries require an initialized cursor") | ||
| })?; |
There was a problem hiding this comment.
Permit read-only
at queries when cursor is unset
For non-mutating at queries, the code errors out unless a cursor is already initialized, which means state.inspect/state.read/state.search with mutate_cursor: false cannot be used immediately after session.open even when the request provides an explicit target. This breaks the expected read-only snapshot flow for fresh sessions and forces clients to perform an extra mutating navigation step first.
Useful? React with 👍 / 👎.
Summary
This adds a Zenoh endpoint to be able to remotely control the debugging API in Copper.
This allows to have a remote debugger / recompile-restart the stack etc.
It has a full inspection API to get remotely the state of the tasks & copperlists,
Related issues
Changes
Testing
just std-cijust lintcargo +stable nextest run --workspace --all-targetsChecklist
Breaking changes (if any)
Additional context