Skip to content

fix(autoresearch): keep pin-free RPC available - #3646

Merged
zackees merged 1 commit into
masterfrom
fix/rp2040-autoresearch-rpc-pump
Jul 15, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/rp2040-autoresearch-rpc-pump

Conversation

@zackees

@zackees zackees commented Jul 15, 2026 •

Copy link
Copy Markdown
Member

Summary

  • register AutoResearch RPC methods and start the RPC task before fallible RX/peripheral initialization, keeping pin-free diagnostics reachable on a stock unsoldered Pico
  • preserve structured JSON-RPC errors instead of masking them as timeouts
  • accept FastLED's compact rpc.discover schema while retaining legacy expanded-schema support
  • handle opaque arg0:unknown payloads honestly without weakening typed-schema checks

Closes #3628. Advances #3629 and #3630.

Validation

  • uv run --no-sync pytest ci/tests/test_rpc_schema_validator.py ci/tests/test_rpc_client_errors.py ci/tests/test_rpc_client_connect_spin_poll.py ci/tests/test_autoresearch_rpc_acceptance.py -q — 37 passed
  • targeted Ruff checks passed
  • repeated real builds of AutoResearch for rp2040 through fbuild
  • genuine Pico 1 COM12, VID:PID 2E8A:000A, serial 5303284720C4641C
  • RPC smoke PASS with 61 discovered methods and correct -32601 propagation
  • SIMD 85/85 PASS plus benchmark
  • IEEE-754 35/35 PASS
  • deliberate watchdog hang ACK, USB disconnect/reset, COM12 recovery, post-reset ping, and full RPC smoke PASS
  • ten consecutive fbuild deploy-to-RPC cycles: 10/10 PASS

No GPIO discovery, pins, jumpers, headers, logic analyser, or LED strip were used.

Summary by CodeRabbit

  • Bug Fixes
    • JSON-RPC server errors are now reported accurately instead of being incorrectly shown as timeouts.
    • RPC schema validation now supports both compact and expanded schema formats.
    • Validation messages are clearer for malformed schemas and invalid requests.
    • Methods with flexible or no parameters now accept appropriate payloads.
    • Remote RPC diagnostics remain available even when peripheral setup encounters an error.

@zackees
zackees merged commit 7f4ac4a into master Jul 15, 2026
9 of 11 checks passed
@zackees
zackees deleted the fix/rp2040-autoresearch-rpc-pump branch July 15, 2026 09:41
@coderabbitai

coderabbitai Bot commented Jul 15, 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: 713cb62b-f237-407a-ab16-6780b3f361b0

📥 Commits

Reviewing files that changed from the base of the PR and between 862508e and c3df8af.

📒 Files selected for processing (5)
  • ci/rpc_client.py
  • ci/rpc_schema_validator.py
  • ci/tests/test_rpc_client_errors.py
  • ci/tests/test_rpc_schema_validator.py
  • examples/AutoResearch/AutoResearch.ino

📝 Walkthrough

Walkthrough

RPC error propagation is preserved, RPC discovery schemas are normalized across compact and expanded formats, request validation handles opaque and empty parameters, and AutoResearch starts RPC setup before fallible RX initialization.

Changes

RPC reliability and schema handling

Layer / File(s) Summary
Preserve JSON-RPC errors
ci/rpc_client.py, ci/tests/test_rpc_client_errors.py
RpcError responses are re-raised instead of being converted into timeout/read errors, with regression coverage for method-not-found responses.
Parse and validate RPC schemas
ci/rpc_schema_validator.py, ci/tests/test_rpc_schema_validator.py
Compact and expanded discovery schemas are normalized, malformed inputs raise ValueError, and validation supports opaque and empty parameter shapes while retaining named-parameter checks.
Start AutoResearch RPC services early
examples/AutoResearch/AutoResearch.ino
RPC function registration, async task startup, and stub autorun registration move before RX-channel setup.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related issues

  • FastLED/FastLED 3629 — The RPC client and schema changes support RP2040 JSON-RPC smoke and validation suites.
  • FastLED/FastLED 3630 — The AutoResearch RPC workflow and error handling align with repeated watchdog and deployment-cycle testing.

Possibly related PRs

✨ 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 fix/rp2040-autoresearch-rpc-pump

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.

feat(autoresearch): add reusable pin-free JSON-RPC smoke mode

1 participant