Conversation
Keep JSON-RPC error data on copilot::Error and expose it through rpc_data() while retaining existing code, message, display, and source behavior. Add framed transport regressions for responses with and without data. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep structured data accessible through rpc_data without changing formatted error output. Cover non-object payloads and distinguish omitted data from explicit null in framed RPC tests. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
|
Updated the Rust error-data change to preserve existing Debug formatting. Structured data remains available through |
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation meets the stated contract with focused regression coverage and no unresolved issues.
Review effort: Balanced
Findings: None
What changed in this PR
Preserves structured JSON-RPC error payloads in the Rust SDK while maintaining existing error behavior.
Changes:
- Adds explicit
Error::rpc_data()access. - Retains payloads during RPC error conversion.
- Covers payload shapes, null handling, and formatting compatibility.
| File | Description |
|---|---|
| rust/tests/prepared_session_test.rs | Adds framed RPC error regression tests. |
| rust/src/lib.rs | Preserves data during RPC error conversion. |
| rust/src/errors.rs | Stores and exposes optional RPC data. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
copilot::ErrorError::rpc_data(); omitted and null data returnNoneFixes #2726
Follow-up validation
The Debug compatibility assertion failed before the correction (RED) and passed afterward (GREEN). The focused
client_call_selection passes all 3 tests; the affectederrorselection passes all 6 tests with backtraces enabled.Commands run from
rust/:git diff --checkalso passed. The framed tests use in-memory transport, with runtime downloads disabled. The existingvalidate_runtime_pairdead-code warning in that configuration is unchanged. No full local suite or Clippy rerun was needed for the follow-up.Original author-reported validation
cargo test --all-features --test prepared_session_test client_call_rustup run nightly-2026-04-14 cargo fmt --checkcargo clippy --all-features --all-targets -- -D warningscargo test --all-features