{"record":{"id":"39c782977e2a1072","repo":"t8y2/dbx","slug":"parent-schema-is-required-for-xugu-type-members","errorCode":null,"errorMessage":"parent_schema is required for Xugu type members","messagePattern":"parent_schema is required for Xugu type members","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/xugu/type_members.go","lineNumber":173,"sourceCode":"\tcase \"package\":\n\t\treturn s.completionAssistantSearchPackageMembers(request)\n\t}\n\t// Package members shipped before type members. Keep that request shape\n\t// working for already-running desktop clients that do not send parent_type.\n\treturn s.completionAssistantSearchPackageMembers(request)\n}\n\nfunc (s *server) completionAssistantSearchTypeMembers(request completionAssistantRequest) (completionAssistantResponse, error) {\n\tparentName := strings.TrimSpace(request.ParentName)\n\tif parentName == \"\" || !xuguCompletionRequestsTypeMembers(request.ObjectKinds) {\n\t\treturn completionAssistantResponse{}, errors.New(\"completion assistant search is not supported for this request\")\n\t}\n\tparentSchema := strings.TrimSpace(request.ParentSchema)\n\tif parentSchema == \"\" {\n\t\tparentSchema = strings.TrimSpace(request.Schema)\n\t}\n\tif parentSchema == \"\" {\n\t\treturn completionAssistantResponse{}, errors.New(\"parent_schema is required for Xugu type members\")\n\t}\n\n\ttypeDefinition, err := s.xuguTypeDefinition(parentSchema, parentName)\n\tif err != nil {\n\t\treturn completionAssistantResponse{}, err\n\t}\n\tif typeDefinition.Kind != xuguObjectTypeKind {\n\t\treturn completionAssistantResponse{Candidates: []completionAssistantCandidate{}, FallbackUsed: false}, nil\n\t}\n\n\tlimit := request.MaxResults\n\tif limit <= 0 {\n\t\tlimit = 100\n\t}\n\tif limit > 1000 {\n\t\tlimit = 1000\n\t}\n","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/xugu/type_members.go#L155-L191","documentation":"Raised by completionAssistantSearchTypeMembers after the request-shape check passes: it needs a schema in which to resolve the parent type (via xuguTypeDefinition) but neither parent_schema nor schema was provided. Xugu type names can be schema-qualified, so the schema is mandatory to locate the type definition.","triggerScenarios":"completionAssistantSearchTypeMembers is called with ParentName set and valid ObjectKinds, but both request.ParentSchema and request.Schema are empty after trimming whitespace.","commonSituations":"Client omits schema because it assumed a default schema; parent_name given unqualified with no schema context; serialization drops empty-string fields.","solutions":["Set parent_schema in the completion request to the schema owning the parent type","Alternatively set schema on the request so it is used as the parent schema fallback","Always send fully qualified type names (schema.type) where the API allows it"],"exampleFix":"// before\nreq := completionAssistantRequest{ParentName: \"my_type\"}\n// after\nreq := completionAssistantRequest{ParentName: \"my_type\", ParentSchema: \"my_schema\"}","handlingStrategy":"validation","validationCode":"if strings.TrimSpace(req.ParentSchema) == \"\" && strings.TrimSpace(req.Schema) == \"\" {\n    return errors.New(\"parent_schema (or schema) is required for Xugu type member completion\")\n}","typeGuard":"func hasParentSchema(r completionAssistantRequest) bool {\n    return strings.TrimSpace(r.ParentSchema) != \"\" || strings.TrimSpace(r.Schema) != \"\"\n}","tryCatchPattern":"resp, err := s.completionAssistantSearchTypeMembers(req)\nif err != nil && strings.Contains(err.Error(), \"parent_schema is required\") {\n    return nil, fmt.Errorf(\"client bug: send parent_schema for %q\", req.ParentName)\n}","preventionTips":["Send fully qualified type identifiers (schema.type) whenever possible","Default parent_schema from the connection's current schema on the client side","Never rely on server-side schema defaults for type resolution","Validate that both parent_name and parent_schema are present together"],"tags":["xugu","completion","validation","schema"],"backgroundTag":"missing-required-parameter","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}