{"record":{"id":"01cec2b329828830","repo":"multica-ai/multica","slug":"list-child-issues-w","errorCode":null,"errorMessage":"list child issues: %w","messagePattern":"list child issues: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_issue.go","lineNumber":895,"sourceCode":"func runIssueChildren(cmd *cobra.Command, args []string) error {\n\tclient, err := newAPIClient(cmd)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tctx, cancel := cli.APIContext(context.Background())\n\tdefer cancel()\n\n\tissueRef, err := resolveIssueRef(ctx, client, args[0])\n\tif err != nil {\n\t\treturn fmt.Errorf(\"resolve issue: %w\", err)\n\t}\n\n\tvar resp struct {\n\t\tIssues []map[string]any `json:\"issues\"`\n\t}\n\tif err := client.GetJSON(ctx, \"/api/issues/\"+issueRef.ID+\"/children\", &resp); err != nil {\n\t\treturn fmt.Errorf(\"list child issues: %w\", err)\n\t}\n\tchildren := resp.Issues\n\n\t// Order by stage ascending (unstaged last), preserving the API's\n\t// within-stage order (position, then created_at desc).\n\tsort.SliceStable(children, func(i, j int) bool {\n\t\tsi, oki := childStage(children[i])\n\t\tsj, okj := childStage(children[j])\n\t\tif oki != okj {\n\t\t\treturn oki // staged before unstaged\n\t\t}\n\t\treturn si < sj\n\t})\n\n\toutput, _ := cmd.Flags().GetString(\"output\")\n\tif output == \"table\" {\n\t\tactors := loadActorDisplayLookup(ctx, client)\n\t\theaders := []string{\"STAGE\", \"KEY\", \"TITLE\", \"STATUS\", \"PRIORITY\", \"ASSIGNEE\"}","sourceCodeStart":877,"sourceCodeEnd":913,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_issue.go#L877-L913","documentation":"The parent issue resolved, but the GET to /api/issues/{id}/children failed while fetching sub-issues. The response is decoded into a struct with an `issues` array; the error fires before any decoding/sorting, so the cause is transport, auth, or an HTTP error status on this sub-resource.","triggerScenarios":"Running `multica issue children <valid-ref>` with the server down, an expired token (401), no read permission on the parent's children (403), or a server 5xx on this endpoint.","commonSituations":"Server restarts during tree-walking scripts; tokens expiring mid-traversal; workspace permission changes.","solutions":["Check the wrapped error's status: 401/403 → fix auth/scope; 5xx/connection → wait for server health and retry.","Confirm the parent still exists with `multica issue get <ref>` (a deleted parent surfaces here as 404).","In recursive tree scripts, catch and log per-parent failures instead of aborting."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"# tree-walk helper: retry transient, fail fast on auth\n for i in 1 2 3; do\n   out=$(multica issue children \"$PARENT_ID\" 2>&1) && break\n   case \"$out\" in *401*|*403*|*404*) echo \"$out\" >&2; exit 1;; esac\n   sleep $((i*2))\n done\n echo \"$out\"","preventionTips":["In recursive child traversals, catch per-parent errors and continue the walk.","Verify server health before starting large tree walks."],"tags":["cli","network","http","issue-children"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}