Repository navigation
fix(rpc): parse Junos bare-text replies (release 0.19.4) - #153
Merged
Merged
Conversation
An SRX440 on Junos OS Evolved 25.4X300-D40.2-EVO answers `show lldp neighbors` (l2cpd not running) with bare text inside <rpc-reply>: "protocol: operation-failed\nerror: the l2cpd-service subsystem is not running". The parser rejected it as "significant text outside a reply payload", so the caller got a parse error instead of the device's error. repair.rs now rewrites that error shape into a real <rpc-error>, and wraps a bare JSON body (a `<command format="json">` reply) in an escaped <output> so it parses as a payload. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
show lldp neighbors(when l2cpd is not running) with bare text inside<rpc-reply>:protocol: operation-failed/error: the l2cpd-service subsystem is not running. The parser rejected it as "significant text outside a reply payload", so rust-junosmcp returned a parse error instead of the device's error (rust-junosmcp TODO 17). The raw reply was captured from the bench lab on 2026-11-30.repair.rsnow rewrites that error shape into a real<rpc-error>.<command format="json">returns, is wrapped in an escaped<output>so it parses as a payload. rust-junosmcp needs this before it can honour| display json.Follow-up
Needs a release (0.19.4), then the bump through rustez into rust-junosmcp. That unblocks
| display jsonin rust-junosmcp (mechubsec/rustjunosmcp#692). The CHANGELOG entry is left for the release.Test plan
src/rpc/reply: the EVO bare-text error becomes anrpc-error, bare JSON is wrapped as output, and other significant text is still rejectedcargo test --lib reply: 168 passed; clippy clean/verify: build and tests PASS (READY_FOR_SHIP)🤖 Generated with Claude Code