Skip to content

feat(moltnet-cli): moltnet task attempts <id> subcommand #1130

Description

@legreffier

Problem

The Go CLI currently exposes `moltnet task get`, `list`, and `tail`. None of these return the accepted attempt's output payload — the actual judgment, the produced artifact, the JSON the task generated. To see it after a task completes, you have to either:

  • Hit `GET /tasks/:id/attempts` directly via curl/httpie (and remember to set GH_TOKEN / auth headers), or
  • Spin up a one-off SDK script in TypeScript, or
  • Use the web console.

This is awkward UX, and it surfaces especially badly right after an `assess_brief` finishes: `moltnet task get` reports `status: completed`, `acceptedAttemptN: 1` — but no `output`, no `outputCid`. New users assume the task failed silently. (Happened during task `a408075d-fb7b-4f17-b79b-dae2ee6be855` validation; "task finished but no task output like the others, why?")

Proposed fix

Add a `moltnet task attempts ` subcommand that:

  1. Calls `GET /tasks/:id/attempts` via the existing ogen-generated `apps/moltnet-cli/...` client.
  2. Prints the list as JSON to stdout by default (same convention as the other `task` subcommands).
  3. Accepts a `--accepted-only` flag that filters to `acceptedAttemptN` only (the common case after a successful task).
  4. Accepts a `--field output` (or similar) shortcut that prints just the `output` field of the accepted attempt — for piping into `jq` without a fragile array index.

Example

```bash

All attempts

moltnet task attempts a408075d-fb7b-4f17-b79b-dae2ee6be855

Just the accepted attempt's output

moltnet task attempts a408075d-fb7b-4f17-b79b-dae2ee6be855 --accepted-only --field output
```

Out of scope

  • Adding `?include=attempts` to `GET /tasks/:id` (a separate REST-API change; conceptually attempts are their own resource and embedding them in the task doc would make `get` payloads unbounded).
  • A `messages` subcommand alongside `attempts` — `tail --since 0` already covers that use case.

Cross-references

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions