@@ -8,6 +8,8 @@ import { OciClientError } from '@/lib/internal/oci/errors'
88import { executeOciObjectStorageNativeTool } from '@/lib/internal/oci-object-storage-native/execute-tool'
99import type { InternalToolOperationCall } from '@/lib/internal/tool-operations/types'
1010import { MAX_BUFFERED_TRANSFER_BYTES } from '@/lib/uploads/shared/types'
11+ import { OciObjectStorageNativeBlock } from '@/blocks/blocks/oci_object_storage_native'
12+ import { ociObjectStorageNativeGetNamespaceTool } from '@/tools/oci_object_storage_native/get_namespace'
1113import {
1214 createOciNativeOperationInput ,
1315 OCI_NATIVE_JSON_BYTES ,
@@ -85,6 +87,48 @@ describe('native OCI tool operation handler', () => {
8587 mocks . executeOciNativeOperation . mockResolvedValue ( { success : true , output : { } } )
8688 } )
8789
90+ it . each ( [ null , '' , undefined , 'compartment' ] ) (
91+ 'normalizes the optional namespace compartment through native merge (%s)' ,
92+ async ( compartmentId ) => {
93+ const raw = {
94+ operation : ociObjectStorageNativeGetNamespaceTool . id ,
95+ oauthCredential : 'selected' ,
96+ compartmentId,
97+ }
98+ const params = {
99+ ...raw ,
100+ ...OciObjectStorageNativeBlock . tools . config ?. params ?.( raw ) ,
101+ accessToken : 'authorized' ,
102+ }
103+ const response = await executeOciObjectStorageNativeTool (
104+ request ( 'get_namespace' , ociObjectStorageNativeGetNamespaceTool . operation . input ( params ) )
105+ )
106+ expect ( response . status ) . toBe ( 200 )
107+ expect ( mocks . executeOciNativeOperation ) . toHaveBeenCalledWith (
108+ expect . objectContaining ( {
109+ credentialId : 'authorized' ,
110+ } ) ,
111+ expect . anything ( )
112+ )
113+ expect ( mocks . executeOciNativeOperation . mock . lastCall ?. [ 0 ] . compartmentId ) . toBe (
114+ compartmentId || undefined
115+ )
116+ }
117+ )
118+
119+ it ( 'preserves zero-byte inline upload content when suppressing inactive fields' , ( ) => {
120+ const raw = {
121+ operation : 'oci_object_storage_native_upload_object' ,
122+ uploadSource : 'content' ,
123+ content : '' ,
124+ file : { id : 'stale' } ,
125+ newObjectName : 'empty.txt' ,
126+ }
127+ const params = { ...raw , ...OciObjectStorageNativeBlock . tools . config ?. params ?.( raw ) }
128+ expect ( params . content ) . toBe ( '' )
129+ expect ( params . file ) . toBeUndefined ( )
130+ } )
131+
88132 it . each ( CASES ) (
89133 'validates and dispatches %s with trusted workspace context' ,
90134 async ( operation , input ) => {
0 commit comments