Problem
The agent CLI currently uses serde_json::to_string_pretty(...).expect(...) for JSON output paths. These code paths can panic instead of returning a normal CLI error if serialization fails.
Scope
- Replace the agent command JSON rendering expects with a small helper.
- Preserve existing CLI output shape on success.
- Report a clean agent error on serialization failure.
Validation
- rustfmt --check src/cli/agent_cmd.rs
Problem
The agent CLI currently uses serde_json::to_string_pretty(...).expect(...) for JSON output paths. These code paths can panic instead of returning a normal CLI error if serialization fails.
Scope
Validation