[Bug]: agent tasks --output json hides truncation; the next-page cursor is only on stderr
Deployment type
self-host
Area
CLI
What happened?
Since #8804 (0.6.0), multica agent tasks <agent> --output json returns at most 200 runs. When more exist, the CLI prints the cursor only to stderr (cmd_agent.go#L911-L916):
More runs available; use --before "2026-09-30T04:09:26.643721Z|<task-id>" to fetch the next page.Stdout is a bare JSON array, the same shape as a complete history. A script that parses stdout and discards stderr, which is the usual pattern, cannot tell a truncated page from the whole history. Scripts written against 0.5.x, where the command returned every run, silently switched to the newest 200 on upgrade. For a busy agent that can be less than a day of history.
The script cannot rebuild the cursor from the last row either. Rows carry created_at at second precision (2026-09-30T04:09:26Z), while the cursor carries microseconds, so a cursor built from a row skips any runs that share that second.
Expected: in JSON mode, the next-page cursor is available on stdout.
Steps to reproduce
- Pick an agent with more than 200 runs.
- Run
multica agent tasks <agent-id> --output json 2>/dev/null | jq length. It prints200. - Nothing on stdout shows that older runs exist or how to fetch them.
Additional context
Suggested fix: behind a flag, so the bare array stays the default, emit {"tasks": [...], "next_cursor": "<cursor or null>"}. That matches the wrapper issue list --output json already returns with has_more. An --all flag that follows the cursor would also work, but for large histories it brings back the unbounded download that #8804 removed, so the wrapper is the better default.
Source: multica-ai/multica