Skip to content

fix(cli): avoid panics when rendering agent JSON #1272

Description

@cedric013

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcliCLI commands / dispatchpriority: mediumNormalstatus: integratedFix merged to main but NOT yet in a tagged release

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions