Skip to content

fix(rpc): parse Junos bare-text replies (release 0.19.4) - #153

Merged
fastrevmd-lab merged 3 commits into
mainfrom
fix/bare-text-reply-repair
Nov 30, 2026
Merged

fastrevmd-lab merged 3 commits into
mainfrom
fix/bare-text-reply-repair

Conversation

@fastrevmd-lab

Copy link
Copy Markdown
Member

Summary

  • An SRX440 on Junos OS Evolved 25.4X300-D40.2-EVO answers 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.rs now rewrites that error shape into a real <rpc-error>.
  • A bare JSON body, which is what <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 json in rust-junosmcp (mechubsec/rustjunosmcp#692). The CHANGELOG entry is left for the release.

Test plan

  • 3 new tests in src/rpc/reply: the EVO bare-text error becomes an rpc-error, bare JSON is wrapped as output, and other significant text is still rejected
  • cargo test --lib reply: 168 passed; clippy clean
  • /verify: build and tests PASS (READY_FOR_SHIP)
  • rust-junosmcp's ignored e2e test passed against this branch through a temporary path override

🤖 Generated with Claude Code

fastrevmd-lab and others added 3 commits November 30, 2026 11:57
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>
@fastrevmd-lab fastrevmd-lab changed the title fix(reply): repair bare-text error and JSON replies from Junos Evolved fix(rpc): parse Junos bare-text replies (release 0.19.4) Nov 30, 2026
@fastrevmd-lab
fastrevmd-lab merged commit 0b47755 into main Nov 30, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant