{"record":{"id":"67f1cf5f62857a7b","repo":"multica-ai/multica","slug":"list-runs-w","errorCode":null,"errorMessage":"list runs: %w","messagePattern":"list runs: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_autopilot.go","lineNumber":514,"sourceCode":"\n\tparams := url.Values{}\n\tif v, _ := cmd.Flags().GetInt(\"limit\"); v > 0 {\n\t\tparams.Set(\"limit\", fmt.Sprintf(\"%d\", v))\n\t}\n\tif v, _ := cmd.Flags().GetInt(\"offset\"); v > 0 {\n\t\tparams.Set(\"offset\", fmt.Sprintf(\"%d\", v))\n\t}\n\tpath := \"/api/autopilots/\" + autopilotRef.ID + \"/runs\"\n\tif len(params) > 0 {\n\t\tpath += \"?\" + params.Encode()\n\t}\n\n\tvar resp struct {\n\t\tRuns  []map[string]any `json:\"runs\"`\n\t\tTotal int              `json:\"total\"`\n\t}\n\tif err := client.GetJSON(ctx, path, &resp); err != nil {\n\t\treturn fmt.Errorf(\"list runs: %w\", err)\n\t}\n\n\toutput, _ := cmd.Flags().GetString(\"output\")\n\tif output == \"json\" {\n\t\treturn cli.PrintJSON(os.Stdout, resp)\n\t}\n\n\theaders := []string{\"ID\", \"SOURCE\", \"STATUS\", \"ISSUE\", \"TRIGGERED_AT\", \"COMPLETED_AT\"}\n\trows := make([][]string, 0, len(resp.Runs))\n\tfor _, r := range resp.Runs {\n\t\trows = append(rows, []string{\n\t\t\tstrVal(r, \"id\"),\n\t\t\tstrVal(r, \"source\"),\n\t\t\tstrVal(r, \"status\"),\n\t\t\tstrVal(r, \"issue_id\"),\n\t\t\tstrVal(r, \"triggered_at\"),\n\t\t\tstrVal(r, \"completed_at\"),\n\t\t})","sourceCodeStart":496,"sourceCodeEnd":532,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_autopilot.go#L496-L532","documentation":"Wrapped error from GET /api/autopilots/{id}/runs (with optional limit/offset query params) in `multica autopilot runs`. The autopilot already resolved, so this failure is purely about fetching the run history: HTTP error status, network failure, or response body not matching the {runs, total} shape.","triggerScenarios":"Server returns 401/403 for the runs endpoint, 404 if the autopilot was deleted between resolution and the runs call, 5xx during query execution, connection reset, or the context from cli.APIContext is cancelled.","commonSituations":"Token revoked between two back-to-back requests; heavy database load making the runs query time out; querying runs of an autopilot that another operator just archived.","solutions":["Retry after checking the wrapped status — 5xx/network errors are usually transient","Reduce the window with `--limit` (e.g. --limit 20) to shrink the query","Confirm the autopilot still exists: `multica autopilots list`","Re-authenticate if the wrapped error shows 401"],"exampleFix":"// before\nmultica autopilot runs my-pilot\n// list runs: request failed: 504 Gateway Timeout\n\n// after\nmultica autopilot runs my-pilot --limit 20 --offset 0","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"Catch the CLI exit status; distinguish 5xx/network (retry with backoff, bounded) from 401/403/404 (fail with the message). Paginate with --limit/--offset to keep responses small.","preventionTips":["Use --limit to bound query cost on workspaces with long run histories","Monitor token expiry so listing/Runs calls do not fail mid-script","Re-check autopilot existence when 404 appears after a resolve succeeded"],"tags":["go","cli","http-get","pagination","api"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}