Compact output for create and add-comment #23
skudr opened 3 weeks ago

tod issue create and tod issue add-comment print the full created object – the whole description and every field for an issue, the whole text for a comment. An agent already has that text, so the echo only costs tokens. Would you accept a flag (for example --brief) that prints just the identity – id, number, reference and link?

  • Service Desk commented 3 weeks ago

    An opt-in --brief flag is a reasonable proposal: keep the existing JSON output by default, and have the flag return only identity fields that are present in the response. Issue identity and comment identity should be distinguished; a comment should not be assigned an issue number or reference of its own. This is a design recommendation, not a commitment that the feature will be accepted.

    Currently neither command has a compact-output option; both print the server response unchanged. You can already keep the full text out of the agent context by filtering stdout in the same shell invocation, for example in Bash with jq installed:

    set -o pipefail
    tod issue create 'Example title' --description 'Example description' |
      jq -c '{id, number, reference, link} | with_entries(select(.value != null))'
    
    tod issue add-comment TOD-23 'Example comment' |
      jq -c '{id, number, reference, link} | with_entries(select(.value != null))'
    

    This retains whichever of those identity fields the server actually supplies and omits the description/comment text. pipefail preserves a failure from tod. If no response fields are needed, redirect stdout to /dev/null; errors on stderr remain visible.

    Does this address your token-cost concern, or do you specifically need a built-in option?

  • skudr commented 3 weeks ago

    Thanks – the jq filter works, and it is what we do for now. We would still like the built-in option: an agent pays the token cost by default on every create and add-comment, and avoiding it requires knowing the trick in advance. An opt-in --brief with exactly the semantics you describe – identity fields only, and no number or reference for a comment – would cover it. Please keep this as an enhancement request.

  • Service Desk changed fields 3 weeks ago
    Name Previous Value Current Value
    Type
    Question
    Enhancement
    Assignee
    servicedesk
    robin
  • Service Desk commented 3 weeks ago

    Reclassified this as an enhancement request and kept it open. The requested behavior is an opt-in --brief for tod issue create and tod issue add-comment, returning only available identity fields while preserving the existing default output. A comment must not receive an issue number or reference of its own.

    @robin, please review this request for acceptance. skudr confirms the jq workaround works but still needs a built-in option for agents.

  • Robin Shen changed title 3 weeks ago
    Previous Value Current Value
    Question: compact output for create and add-comment?
    Compact output for create and add-comment
  • OneDev commented 3 weeks ago

    State changed as build TOD-239 (4.4.0) is successful

  • OneDev changed state to 'Closed' 3 weeks ago
    Previous Value Current Value
    Open
    Closed
1/1
Type
Enhancement
Priority
Minor
Assignee
Labels
No labels
Issue Votes (0)
Watchers (3)
Reference
TOD-23
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover