Skip to content

Feat: Remote debug API.#798

Merged
gbin merged 45 commits into
masterfrom
gbin/remote_debug_api
Feb 10, 2026
Merged

Feat: Remote debug API.#798
gbin merged 45 commits into
masterfrom
gbin/remote_debug_api

Conversation

@gbin

@gbin gbin commented Feb 10, 2026

Copy link
Copy Markdown
Collaborator

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

  • Closes #

Changes

Testing

  • just std-ci
  • just lint
  • cargo +stable nextest run --workspace --all-targets
  • Other (please specify):

Checklist

  • I have updated docs or examples where needed
  • I have added or updated tests where needed
  • I have considered platform impact (Linux/macOS/Windows/embedded)
  • I have considered config/logging changes (if applicable)
  • This change is not a breaking change (or I documented it below)

Breaking changes (if any)

Additional context

@gbin gbin added enhancement New feature or request include in changelog labels Feb 10, 2026
gbin added 7 commits February 10, 2026 09:29
# 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
@gbin gbin requested a review from makeecat February 10, 2026 16:16
@gbin

gbin commented Feb 10, 2026

Copy link
Copy Markdown
Collaborator Author

@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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_debug module with Zenoh-based RPC server and client for remote debugging
  • Exposed new public methods total_entries() and current_index() in CuDebugSession
  • Added remote-debug feature 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.

Comment thread core/cu29_runtime/src/remote_debug.rs
Comment thread core/cu29_runtime/src/remote_debug.rs
Comment thread core/cu29_runtime/src/remote_debug.rs
Comment thread core/cu29_runtime/Cargo.toml
Comment thread core/cu29_runtime/src/remote_debug.rs
Comment thread core/cu29_runtime/src/remote_debug.rs
Comment thread core/cu29_runtime/src/remote_debug.rs Outdated
Comment thread core/cu29_runtime/src/remote_debug.rs
Comment thread examples/cu_remote_debug_session/src/main.rs Outdated
Comment thread core/cu29_runtime/src/remote_debug.rs
Comment thread core/cu29_runtime/src/remote_debug.rs
@gbin gbin requested a review from makeecat February 10, 2026 21:58
@gbin gbin merged commit dc58048 into master Feb 10, 2026
23 checks passed
@gbin gbin deleted the gbin/remote_debug_api branch February 10, 2026 22:31
@makeecat

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +1201 to +1205
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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +2669 to +2671
let previous_idx = state.session.current_index().ok_or_else(|| {
CuError::from("Non-mutating at queries require an initialized cursor")
})?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants