Skip to content

chat group member-role: prints usage text instead of JSON under -f json #422

Description

@PeterGuy326

Summary

dws chat group member-role prints human-readable usage text to stdout instead of JSON when -f json is requested, violating the -f json contract.

Repro

$ dws chat group member-role -f json
群自定义角色

Usage:
  dws chat group member-role [flags]

Flags:
  -h, --help   help for member-role
...

Exit code 0, stdout is usage text (not JSON).

Analysis

member-role is a dynamically generated node with no subcommands and no executable action (a group prefix from discovery with no mapped tool). When invoked, cobra prints usage. Under -f json this breaks JSON-only consumers (agents/MCP) that expect machine-readable output.

Expected

For an action-less command node invoked with -f json, emit a structured JSON response (e.g. a JSON error indicating a subcommand is required, or a JSON list of available subcommands) rather than plain usage text.

Found on v1.0.34 (1e95d03).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: cliCLI 仓库可修复type: bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions