{"record":{"id":"ed5b48b9bc25eab2","repo":"multica-ai/multica","slug":"runtime-id-is-required","errorCode":null,"errorMessage":"--runtime-id is required","messagePattern":"--runtime-id is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_agent.go","lineNumber":643,"sourceCode":"\t\t\ttargets = append(targets, map[string]any{\"target_type\": \"member\", \"target_id\": m})\n\t\t}\n\t}\n\tbody[\"invocation_targets\"] = targets\n}\n\nfunc runAgentCreate(cmd *cobra.Command, _ []string) error {\n\tclient, err := newAPIClient(cmd)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tname, _ := cmd.Flags().GetString(\"name\")\n\tif name == \"\" {\n\t\treturn fmt.Errorf(\"--name is required\")\n\t}\n\truntimeID, _ := cmd.Flags().GetString(\"runtime-id\")\n\tif runtimeID == \"\" {\n\t\treturn fmt.Errorf(\"--runtime-id is required\")\n\t}\n\n\tbody := map[string]any{\n\t\t\"name\":       name,\n\t\t\"runtime_id\": runtimeID,\n\t}\n\tif v, _ := cmd.Flags().GetString(\"description\"); v != \"\" {\n\t\tbody[\"description\"] = v\n\t}\n\tif v, _ := cmd.Flags().GetString(\"instructions\"); v != \"\" {\n\t\tbody[\"instructions\"] = v\n\t}\n\tif cmd.Flags().Changed(\"runtime-config\") {\n\t\tv, _ := cmd.Flags().GetString(\"runtime-config\")\n\t\tvar rc any\n\t\tif err := json.Unmarshal([]byte(v), &rc); err != nil {\n\t\t\treturn fmt.Errorf(\"--runtime-config must be valid JSON: %w\", err)\n\t\t}","sourceCodeStart":625,"sourceCodeEnd":661,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_agent.go#L625-L661","documentation":"runAgentCreate's second required-flag check: the agent must reference a runtime, so --runtime-id must be non-empty before the create body is built. Without a runtime the server could not determine how to execute the agent.","triggerScenarios":"Running agent create with --name supplied but --runtime-id omitted or empty; referencing a runtime ID variable that was never populated.","commonSituations":"Not knowing which runtimes exist; copy-pasting a create command template and replacing only the name; runtime ID from a list command that was archived since.","solutions":["List available runtimes and copy the exact ID into --runtime-id.","In scripts, fail fast when the runtime variable is empty rather than calling the CLI.","Verify the runtime ID still exists if the command was drafted earlier."],"exampleFix":"# before\nmultica agent create --name \"code-reviewer\"\n\n# after\nmultica agent create --name \"code-reviewer\" --runtime-id rt_cli","handlingStrategy":"validation","validationCode":"runtimeID := strings.TrimSpace(runtimeIDFlag)\nif runtimeID == \"\" {\n    return fmt.Errorf(\"--runtime-id is required\")\n}\n// Optionally verify it exists before create:\nif !runtimeExists(ctx, client, runtimeID) {\n    return fmt.Errorf(\"runtime %q not found\", runtimeID)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Fetch the runtime list once and reference IDs from it, not memory.","Make create scripts fail fast when the runtime variable is empty.","Keep runtime IDs in a config file with a linter check rather than inline in many commands."],"tags":["go","cli","validation","agents"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}