Skip to content

fix(autoresearch): complete RP2040 RPC watchdog handshake - #3641

Merged
zackees merged 3 commits into
masterfrom
feat/rp2040-rpc-smoke-final
Jul 14, 2026
Merged

zackees merged 3 commits into
masterfrom
feat/rp2040-rpc-smoke-final

Conversation

@zackees

@zackees zackees commented Jul 14, 2026 •

Copy link
Copy Markdown
Member

Completes the RP2040 AutoResearch RPC watchdog handshake by returning on the async acknowledgement before the intentional hang, while preserving strict response correlation. Includes the Pico runtime VID/PID mapping and no-port stock BOOTSEL flow already on this branch. Validation: uv run --no-sync pytest ci/tests/test_autoresearch_phases.py -q (91 passed).

Summary by CodeRabbit

  • New Features

    • Added support for automatically detecting USB serial ports across RP2040-based board environments.
    • Added asynchronous acknowledgement handling for long-running remote operations.
  • Bug Fixes

    • Improved deliberate-hang recovery by ensuring acknowledgements are transmitted before the watchdog reset.
    • Watchdog soak testing now proceeds immediately after receiving confirmation, improving recovery reliability.
    • Added validation to avoid selecting incorrect USB serial devices during RP2040 detection.

@zackees
zackees merged commit 24b4cfc into master Jul 14, 2026
10 of 11 checks passed
@zackees
zackees deleted the feat/rp2040-rpc-smoke-final branch July 14, 2026 22:40
@coderabbitai

coderabbitai Bot commented Jul 14, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c84de1c2-1339-47d2-9eea-cb09a2f2e280

📥 Commits

Reviewing files that changed from the base of the PR and between 9cebcfa and 7539f9f.

📒 Files selected for processing (6)
  • ci/autoresearch/phases.py
  • ci/rpc_client.py
  • ci/tests/test_autoresearch_phases.py
  • ci/util/port_utils.py
  • examples/AutoResearch/AutoResearch.ino
  • examples/AutoResearch/AutoResearchRemoteSystemMethods.cpp

📝 Walkthrough

Walkthrough

The RPC client now supports returning on asynchronous acknowledgements. The deliberate-hang example emits and flushes its acknowledgement before resetting, the watchdog soak uses acknowledgement-only completion, and RP2040 environments receive strict VCOM port fingerprints with corresponding tests.

Changes

Watchdog recovery and RP2040 port detection

Layer / File(s) Summary
Asynchronous deliberate-hang acknowledgement
ci/rpc_client.py, examples/AutoResearch/*
RpcClient.send() can return on a matching async ACK, while deliberateHang is registered asynchronously and flushes pending output before the watchdog hang.
Watchdog soak acknowledgement handling
ci/autoresearch/phases.py
The watchdog soak invokes deliberateHang with return_on_ack=True.
RP2040 VCOM fingerprint selection
ci/util/port_utils.py, ci/tests/test_autoresearch_phases.py
RP2040-family environments use explicit VID:PID mappings, with tests covering accepted CDC devices and CP210x rejection.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

Possibly related PRs

  • FastLED/FastLED#3638 — Modifies the watchdog soak orchestration that this change updates to return on the RPC acknowledgement.
  • FastLED/FastLED#3639 — Updates the deliberate-hang output flush in the same recovery path.
  • FastLED/FastLED#3640 — Overlaps on the flush change and RP2040 port mappings and tests.

Sequence Diagram(s)

sequenceDiagram
  participant RpcClient
  participant WatchdogSoak
  participant AutoResearchRemoteControl
  participant AutoResearch
  WatchdogSoak->>RpcClient: send deliberateHang with return_on_ack=True
  RpcClient->>AutoResearchRemoteControl: invoke asynchronous deliberateHang
  AutoResearchRemoteControl->>AutoResearch: execute handler
  AutoResearch->>AutoResearch: flush RPC acknowledgement
  AutoResearch-->>RpcClient: return JSON-RPC ACK
  RpcClient-->>WatchdogSoak: return successful RpcResponse
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/rp2040-rpc-smoke-final

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant