Skip to content

bug: show/edit/complete under --json can drop into an interactive picker and errors are not machine-readable #152

Closed

Description

@ryanlewis

Hit this while trying to pipe things show <ref> --json into an agent.

things show <ref> --json with a ref that matches more than one task (e.g. a substring LIKE match) prints the "Multiple tasks match" picker on stderr and waits on stdin, because resolveTask in cmd/things/main.go only checks isInteractive() (stdin is a TTY) and ignores --json. A machine reader run from a terminal hangs on the prompt. A ref that matches nothing, or an ambiguous ref in non-interactive mode, returns a plain-text error on stderr with nothing on stdout, so a JSON consumer gets no structured failure.

Expected:

  • --json implies non-interactive: never prompt; ambiguity returns an error that lists the candidates.
  • Under --json, errors from show/edit/complete/cancel/open/search are emitted as a JSON object (e.g. {"error":"ambiguous task","query":"...","matches":[{"uuid":...,"title":...}]} / {"error":"not found","query":"..."}) with a non-zero exit, so an agent can parse the failure and retry with a UUID.
  • Plain-text mode unchanged.

Activity

  1. added
    bug
    on Sep 5, 2026
  2. added 2 commits that reference this issue on Sep 5, 2026
    5787d0d
    fc6893b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions